Sha256: d6fa64e7f662192d773f5ad6efaae5c77d03d4dc308dbcb02c7d932f52eaa42e

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

require "yaml"
module  Hashup
  class Configuration
    DEFAULTS = {
      'template_dir' => "themes",
      'content_dir' => "contents",
      'output_dir' => "output",
      'server' => {
        'port' => 9817
      }
    }

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hashup-0.0.5 lib/hashup/configuration.rb