Module: Kryten::Setup

Defined in:
lib/kryten/setup.rb

Class Method Summary collapse

Class Method Details

.base_pathObject



8
9
10
# File 'lib/kryten/setup.rb', line 8

def base_path
  File.expand_path(File.join(ENV['BUNDLE_GEMFILE'], '..'))
end

.configureObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/kryten/setup.rb', line 12

def configure
  classname = self.name.split('::')
  classname = if classname.one?
                classname.first.downcase
              else
                classname[0...-1].collect(&:downcase).join('-')
              end
  file = File.open(File.join(self.base_path, "config/#{classname}.yml"))
  YAML.load(file)[classname]
end