Class: Cumuli::CLI::RemoteCommander

Inherits:
Object
  • Object
show all
Defined in:
lib/cumuli/cli/remote_commander.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, dir) ⇒ RemoteCommander

Returns a new instance of RemoteCommander.



6
7
8
9
# File 'lib/cumuli/cli/remote_commander.rb', line 6

def initialize(command, dir)
  @raw_command = command
  @dir = dir
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



4
5
6
# File 'lib/cumuli/cli/remote_commander.rb', line 4

def dir
  @dir
end

#raw_commandObject (readonly)

Returns the value of attribute raw_command.



4
5
6
# File 'lib/cumuli/cli/remote_commander.rb', line 4

def raw_command
  @raw_command
end

Instance Method Details

#commandObject



11
12
13
# File 'lib/cumuli/cli/remote_commander.rb', line 11

def command
  Commander.new(raw_command).build
end

#performObject



15
16
17
18
19
# File 'lib/cumuli/cli/remote_commander.rb', line 15

def perform
  Dir.chdir(dir) do
    Terminal.new(command).spawn
  end
end