Module: MiGA::Common::Path

Included in:
MiGA
Defined in:
lib/miga/common/path.rb

Instance Method Summary collapse

Instance Method Details

#root_pathObject

Root path to MiGA (as estimated from the location of the current file).



4
5
6
# File 'lib/miga/common/path.rb', line 4

def root_path
  File.expand_path('../../../..', __FILE__)
end

#script_path(task, opts = {}) ⇒ Object

Path to a script to be executed for task. Supported opts are:

  • :miga Path to the MiGA home to use. If not passed, the home of the library is used).



12
13
14
15
# File 'lib/miga/common/path.rb', line 12

def script_path(task, opts = {})
  opts[:miga] ||= root_path
  File.expand_path("scripts/#{task}.bash", opts[:miga])
end