lib/capsaicin/invocation.rb in joekhoobyar-capsaicin-0.1.5 vs lib/capsaicin/invocation.rb in joekhoobyar-capsaicin-0.1.6

- old
+ new

@@ -1,9 +1,17 @@ module Capsaicin module Invocation + # Automatically uses the :run_method variable to run things. + # Equivalent to +invoke_command *args, :via=>fetch(:run_method, :run)+ + def vrun(*args, &block) + options = Hash===args.last ? args.pop.dup : {} + options[:via] = fetch(:run_method, :run) + invoke_command *args.push(options), &block + end + # Capistrano's system() override is only available from the base deployment strategy. # Also, we could do with a few more windows checks. def local_run(*args, &block) args.pop if Hash===args.last cmd = args.join(' ') @@ -41,8 +49,6 @@ cmd = args[0].gsub(/[$\\`"]/) { |m| "\\#{m}" } args[0] = "echo \"#{cmd}\" | #{sudo} su - #{fetch(:runner, nil)}" run *args.push(options), &block end end - - Capistrano::Configuration.send :include, Invocation end