Sha256: d3b5a88e940bfe26e4df1bc39cb5b2f9a888320d89e35edc50818c24bf4df29d

Contents?: true

Size: 487 Bytes

Versions: 22

Compression:

Stored size: 487 Bytes

Contents

module Insulin
# Author::  Sam (mailto:sam@cruft.co)
# License:: MIT

  # This class is a simple wrapper around a YAML config file
  class Config < Hash

    # Open the file at 'path'. If no path is provided, go to default
    def initialize path = nil
      if not path
        path = "conf/insulin.yaml"
      end
      self.update YAML.load File.open path
    end

    # Return a particular section (as a hash)
    def get_section section
      return self[section]
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
insulin-0.1.11 lib/insulin/config.rb
insulin-0.1.10 lib/insulin/config.rb
insulin-0.1.9 lib/insulin/config.rb
insulin-0.1.8 lib/insulin/config.rb
insulin-0.1.7 lib/insulin/config.rb
insulin-0.1.6 lib/insulin/config.rb
insulin-0.1.5 lib/insulin/config.rb
insulin-0.1.4 lib/insulin/config.rb
insulin-0.1.3 lib/insulin/config.rb
insulin-0.1.2 lib/insulin/config.rb
insulin-0.1.1 lib/insulin/config.rb
insulin-0.1.0 lib/insulin/config.rb
insulin-0.0.18 lib/insulin/config.rb
insulin-0.0.17 lib/insulin/config.rb
insulin-0.0.16 lib/insulin/config.rb
insulin-0.0.15 lib/insulin/config.rb
insulin-0.0.14 lib/insulin/config.rb
insulin-0.0.13 lib/insulin/config.rb
insulin-0.0.12 lib/insulin/config.rb
insulin-0.0.11 lib/insulin/config.rb