Class: Gaston

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/gaston.rb,
lib/gaston/parse.rb,
lib/gaston/builder.rb,
lib/gaston/version.rb,
lib/gaston/configuration.rb,
lib/gaston/generators/gaston/config_generator.rb

Defined Under Namespace

Modules: Generators Classes: Builder, Configuration, Parse

Constant Summary collapse

VERSION =
"0.6.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configure(&block) ⇒ Object

Define a configure block.

Delegates to Gaston::Configuration

Examples:

Define the option.

Gaston.configure do |config|
  config.env = :test
  config.files = Dir[Rails.root.join("config/libraries/**/*.rb"]
end

Parameters:

  • block (Proc)

    The block getting called.

Since:

  • 0.0.1



40
41
42
43
44
45
46
47
# File 'lib/gaston.rb', line 40

def configure(&block)
  self::Configuration.configure(&block)
  self.instance.store.each do |key, value|
    define_singleton_method key do
      value
    end
  end
end

Instance Method Details

#storeObject

Parse yml config files, merge them, and store into gaston::Store

Since:

  • 0.0.1



20
21
22
# File 'lib/gaston.rb', line 20

def store
  @store ||= Gaston::Builder.new(self.class, hash_from_files)
end