Method: Tco::Config#initialize

Defined in:
lib/tco/config.rb

#initialize(locations = []) ⇒ Config

Returns a new instance of Config.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/tco/config.rb', line 30

def initialize(locations=[])
  @options = {
    "palette" => "extended",
    "output"  => "term",
    "disabled" => false
  }
  @colour_values = {}
  @names = {
    "black" => "@0",
    "red" => "@1",
    "green" => "@2",
    "yellow" => "@3",
    "blue" => "@4",
    "magenta" => "@5",
    "cyan" => "@6",
    "light-grey" => "@7",
    "grey" => "@8",
    "light-red" => "@9",
    "light-green" => "@10",
    "light-yellow" => "@11",
    "light-blue" => "@12",
    "light-magenta" => "@13",
    "light-cyan" => "@14",
    "white" => "@15"
  }

  @styles = {}

  locations.each do |conf_file|
    conf_file = File.expand_path conf_file
    next unless File.exists? conf_file
    load conf_file
  end
end