Sha256: fbbb2e9423f0be853c0e480763987774fc6017414e34f3321ba400c21196366c

Contents?: true

Size: 883 Bytes

Versions: 9

Compression:

Stored size: 883 Bytes

Contents

module Spinebox
  module Config
    
    # Reset the config
    def self.reset!
      @@configuration = nil
    end
    reset!
    
    # Offer the configuration
    def self.configuration(&block)
      @@configuration ||= OpenStruct.new(
        :assets => Sprockets::Environment.new,
        :views  => Sprockets::Environment.new
      )
      
      block.call(@@configuration) if block
      @@configuration
    end
    
  end
  
  class << self
    
    # Offers the configuration with the assets
    def config
      block = Proc.new if block_given?
      Config.configuration(&block)
    end
    
    # Straight access to the assets
    def assets
      config.assets
    end
    
    # Straight access to the views
    def views
      config.views
    end
    
    # Load the config
    def load_config!(config = "./config/config.rb")
      load config
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spinebox-0.0.10 lib/spinebox/config.rb
spinebox-0.0.9 lib/spinebox/config.rb
spinebox-0.0.8 lib/spinebox/config.rb
spinebox-0.0.7 lib/spinebox/config.rb
spinebox-0.0.6 lib/spinebox/config.rb
spinebox-0.0.5 lib/spinebox/config.rb
spinebox-0.0.4 lib/spinebox/config.rb
spinebox-0.0.3 lib/spinebox/config.rb
spinebox-0.0.2 lib/spinebox/config.rb