Sha256: b27ebdc6c4c6fdb676b78baab64c867f6a667b59719100a0b3f8a35dc282bc06
Contents?: true
Size: 895 Bytes
Versions: 1
Compression:
Stored size: 895 Bytes
Contents
module Cumuli class CLI class RemoteRakeCommand attr_reader :argv DIR_ENV = 'DIR=' COMMAND_ENV= 'COMMAND=' def initialize(argv) puts "argv: #{argv.inspect}" @argv = argv end def extract_env(env_var) found_arg = argv.detect{|arg| arg.include?(env_var)} found_arg && found_arg.gsub(env_var, '') end def dir extract_env(DIR_ENV) end def raw_command extract_env(COMMAND_ENV) || get_passed_command end def get_passed_command matched = argv.first.match(/\[(.*)\]/) (matched && matched[1]) || argv.first end def command Commander.new(raw_command).build end def perform Dir.chdir(dir) do puts "running #{command}, at #{dir}" Terminal.new(command).spawn end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cumuli-0.5.0 | lib/cumuli/cli/remote_rake_command.rb |