Method: TestLab#initialize

Defined in:
lib/testlab.rb

#initialize(options = {}) ⇒ TestLab

Returns a new instance of TestLab.



147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/testlab.rb', line 147

def initialize(options={})
  self.ui        = (options[:ui] || ZTK::UI.new)
  self.class.ui  = self.ui

  _labfile_path  = (options[:labfile_path] || ENV['LABFILE'] || 'Labfile')
  @labfile_path  = ZTK::Locator.find(_labfile_path)

  @repo_dir      = (options[:repo_dir] || File.dirname(@labfile_path))

  @config_dir    = (options[:config_dir] || File.join(@repo_dir, ".testlab-#{TestLab.hostname}"))
  File.exists?(@config_dir) or FileUtils.mkdir_p(@config_dir)
end