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

#apply_to, #commit_message

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



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

def load(base,ops={})
  if relative_output_path.present?
    TmpDir.with do |dir|
      Overapp.ec "cd #{dir} && #{command}", :silent => false
      RawDir.new(:descriptor => "#{dir}/#{relative_output_path}").load(base,ops)
    end
  else
    Overapp.ec "cd #{ops[:path]} && #{command}", :silent => false
    RawDir.new(:descriptor => ops[:path]).load(base,ops)
  end
end