Sha256: 2b45d2247c56a04add3aa83885b554c9ffa6a5ebda018e0fb470036f433963f7

Contents?: true

Size: 1.03 KB

Versions: 15

Compression:

Stored size: 1.03 KB

Contents

# Configuration options for SectionsRails.
# Set in an initializer file in /config/initializers/.
#
# Example:
# SectionsRails.configure do |config|
#   config.spec_dir  = "spec/javascripts"
#   config.driver    = :webkit
# end if defined?(Konacha)
module SectionsRails

  class << self
    def config
      @config ||= Config.new
    end
  end

  class Config
    attr_accessor :path, :js_extensions, :css_extensions, :partial_extensions

    def initialize options = {}
      options.reverse_merge!({ :path           => 'app/sections',
                               :js_extensions  => ['js',  'js.coffee', 'coffee'],
                               :css_extensions => ['css', 'css.scss', 'css.sass', 'sass', 'scss'],
                               :partial_extensions => ['html.erb', 'html.haml'] })

      options.each do |option, value|
        if self.respond_to? option
          send("#{option}=", value)
        else
          raise ArgumentError.new "Invalid option '#{option}' for #{self.class.name}"
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sections_rails-0.8.0 lib/sections_rails/config.rb
sections_rails-0.7.2 lib/sections_rails/config.rb
sections_rails-0.7.1 lib/sections_rails/config.rb
sections_rails-0.7.0 lib/sections_rails/config.rb
sections_rails-0.6.12 lib/sections_rails/config.rb
sections_rails-0.6.11 lib/sections_rails/config.rb
sections_rails-0.6.10 lib/sections_rails/config.rb
sections_rails-0.6.9 lib/sections_rails/config.rb
sections_rails-0.6.8 lib/sections_rails/config.rb
sections_rails-0.6.7 lib/sections_rails/config.rb
sections_rails-0.6.6 lib/sections_rails/config.rb
sections_rails-0.6.5 lib/sections_rails/config.rb
sections_rails-0.6.4 lib/sections_rails/config.rb
sections_rails-0.6.3 lib/sections_rails/config.rb
sections_rails-0.6.2 lib/sections_rails/config.rb