Class: Nbuild::Cmd

Inherits:
Object
  • Object
show all
Defined in:
lib/nbuild/cmd.rb

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Cmd

Returns a new instance of Cmd.



3
4
5
# File 'lib/nbuild/cmd.rb', line 3

def initialize params
  @params = params
end

Instance Method Details

#commandObject



7
8
9
# File 'lib/nbuild/cmd.rb', line 7

def command
  @params[:command]
end

#executeObject



11
12
13
14
15
16
17
# File 'lib/nbuild/cmd.rb', line 11

def execute
  if @params[:wd]
    execute_in @params[:wd]
  else
    execute_internal
  end
end

#execute_in(wd) ⇒ Object



19
20
21
# File 'lib/nbuild/cmd.rb', line 19

def execute_in wd
  Dir.chdir(wd) { execute_internal }
end