Class: Gemi::Conf

Inherits:
Object
  • Object
show all
Defined in:
lib/gemi/conf.rb

Defined Under Namespace

Classes: GemircError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml_path) ⇒ Conf

Returns a new instance of Conf.



20
21
22
23
24
25
26
27
# File 'lib/gemi/conf.rb', line 20

def initialize(yaml_path)
  if yaml_path
    yaml = YAML.load_file(yaml_path)
    @rubys = parse_rubys(yaml["rubys"])
  else
    @rubys = [Ruby::Default]
  end
end

Instance Attribute Details

#rubysObject (readonly)

Returns the value of attribute rubys.



28
29
30
# File 'lib/gemi/conf.rb', line 28

def rubys
  @rubys
end

Class Method Details

.createObject



12
13
14
15
16
17
18
# File 'lib/gemi/conf.rb', line 12

def self.create
  unless File.exist?(GEMIRC)
    here = File.dirname(__FILE__)
    template_path = File.expand_path("../../gemirc.yml", here)
    FileUtils.cp(template_path, GEMIRC)
  end
end