Class: Hashup::Configuration
- Inherits:
-
Object
- Object
- Hashup::Configuration
- 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
- #configs ⇒ Object
-
#initialize(filename) ⇒ Configuration
constructor
A new instance of Configuration.
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
#configs ⇒ Object
21 22 23 24 |
# File 'lib/hashup/configuration.rb', line 21 def configs return YAML.load_file @filename if @filename DEFAULTS end |