Class: Hashup::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/hashup/configuration.rb

Constant Summary collapse

DEFAULTS =
{
  'template_dir' => "themes",
  'content_dir' => "contents",
  'output_dir' => "output",
  'server' => {
    'port' => 9817
  }
}

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Configuration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
# File 'lib/hashup/configuration.rb', line 13

def initialize filename
  if File.exists? filename
    @filename = filename
  else
    puts "#{filename} not found, maybe you are not in the right folder"
  end
end

Instance Method Details

#configsObject



21
22
23
24
# File 'lib/hashup/configuration.rb', line 21

def configs
  return YAML.load_file @filename if @filename
  DEFAULTS
end