Top Level Namespace

Defined Under Namespace

Modules: HelpHelpers, Mina

Constant Summary

Constants included from HelpHelpers

HelpHelpers::SYSTEM_TASKS

Instance Method Summary collapse

Methods included from Mina::Helpers

capture, commands, die, echo_cmd, erb, error, in_directory, indent, invoke, isolate, measure, method_missing, mina_cleanup!, queue, queue!, reindent, report_time, run!, set, set_default, settings, simulate_mode?, to, unindent, verbose_mode?

Methods included from Mina::DeployHelpers

deploy, deploy_script

Methods included from Mina::SshHelpers

ssh, ssh_command

Methods included from Mina::OutputHelpers

color, print_char, print_clear, print_command, print_error, print_status, print_stderr, print_stdout, print_str, puts

Methods included from Mina::ExecHelpers

pretty_system

Methods included from HelpHelpers

get_tasks, print_tasks, show_task_help, sub_tasks, system_tasks, top_tasks

Instance Method Details

#check_for_changes_script(options = {}) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/mina/rails.rb', line 76

def check_for_changes_script(options={})
  diffs = options[:at].map { |path|
    %[diff -r "#{deploy_to}/#{current_path}/#{path}" "./#{path}" 2>/dev/null]
  }.join("\n")

  unindent %[
    if [ -e "#{deploy_to}/#{current_path}/#{options[:check]}" ]; then
      count=`(
        #{reindent 4, diffs}
      ) | wc -l`

      if [ "$((count))" = "0" ]; then
        #{reindent 4, options[:skip]} &&
        exit
      else
        #{reindent 4, options[:changed]}
      fi
    else
      #{reindent 2, options[:default]}
    fi
  ]
end