Sha256: dbd4d6fe9377863950b5fef8097bcf9bfa7b8503df40aaba10494f4ace46880b

Contents?: true

Size: 848 Bytes

Versions: 1

Compression:

Stored size: 848 Bytes

Contents

module WebResourceBundler
  class Settings
    @@defaults = {
      :cache_dir => 'cache',
      :base64_filter => {
        :max_image_size => 23, #kbytes
        :protocol => 'http',
        :domain => 'localhost:3000'
      },
      :bundle_filter => {
        :md5_additional_data => []
      },
      :cdn_filter => {
        :http_hosts => ['http://localhost:3000'],
        :https_hosts => ['https://localhost:3000']
      }
    }

    def initialize(hash = {})
      @settings = hash
    end

    def set(hash)
      @settings.merge!(hash)
    end

    def [](i)
      @settings[i]
    end

    def []=(i , v)
      @settings[i] = v 
    end

    def method_missing(m, *args, &block)
      m=m.to_s
      if /.*=\z/.match(m)
        @settings[m[0..-2].to_sym] = args[0] 
      else
        @settings[m.to_sym]
      end
    end


  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
web_resource_bundler-0.0.13 lib/web_resource_bundler/settings.rb