Sha256: 4700e401ec34f3a6076c09aa50c32d6dc6a79b83c0b0fb91a44b46a64c5fedfa

Contents?: true

Size: 760 Bytes

Versions: 2

Compression:

Stored size: 760 Bytes

Contents

#
# File::      configuration.rb
# Author::    wkm
# Copyright:: 2009
# License::   GPL
#
# Load and process SiteFuel YAML configuration files
#

module SiteFuel
  require 'yaml'

  class Configuration

    # exception which represents that a configuration could not be found
    class NotFound < StandardError
    end

    # given a directory path will attempt to location a configuration file
    # and load it, returning a SiteFuel::Configuration class
    def self.load(path)
      unless File.exist?(path)
        throw NotFound, path
      end

      yamlconfig = YAML::load_file(configfile)
      
      Configuration.new(yamlconfig)
    end

    # builds a sitefuel configuration from a parsed YAML file
    def initialize(yamlconfig)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sitefuel-0.0.0b lib/sitefuel/Configuration.rb
sitefuel-0.0.0a lib/sitefuel/Configuration.rb