Class: Overapp::Load::Command

Inherits:
Base show all
Defined in:
lib/overapp/load/types/command.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#descriptor

Instance Method Summary collapse

Methods inherited from Base

#commit_message, #initialize, #load_full

Constructor Details

This class inherits a constructor from Overapp::Load::Base

Instance Attribute Details

#relative_output_pathObject

Returns the value of attribute relative_output_path.



4
5
6
# File 'lib/overapp/load/types/command.rb', line 4

def relative_output_path
  @relative_output_path
end

Instance Method Details

#commandObject



5
# File 'lib/overapp/load/types/command.rb', line 5

def command; descriptor; end

#load(base, ops = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/overapp/load/types/command.rb', line 15

def load(base,ops={})
  base.with_tmp do |dir|
    Overapp.ec "cd #{dir} && #{command}", :silent => true
    RawDir.new(:descriptor => target_path(dir))
  end
end

#target_path(dir) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/overapp/load/types/command.rb', line 7

def target_path(dir)
  if relative_output_path.present?
    "#{dir}/#{relative_output_path}"
  else
    dir
  end
end