lib/rack/pagespeed/config.rb in rack-pagespeed-1.0.0 vs lib/rack/pagespeed/config.rb in rack-pagespeed-1.0.1
- old
+ new
@@ -29,12 +29,12 @@
else
raise NoSuchStorageMechanism, "No such storage mechanism: #{type}"
end
end
- def method_missing filter
- raise NoSuchFilter, "No such filter \"#{filter}\". Available filters: #{(Rack::PageSpeed::Filters::Base.available_filters).join(', ')}"
+ def method_missing filter, *args
+ raise NoSuchFilter, "No such filter \"#{filter}\". Available filters: #{(Rack::PageSpeed::Filter.available_filters).join(', ')}"
end
private
def sort_filters
@filters = @filters.sort_by do |filter|
@@ -59,10 +59,10 @@
when Hash then @options[:filters].each { |filter, options| self.send filter, options }
end
end
def filters_to_methods
- Rack::PageSpeed::Filters::Base.available_filters.each do |klass|
+ Rack::PageSpeed::Filter.available_filters.each do |klass|
(class << self; self; end).send :define_method, klass.name do |*options|
default_options = {:public => @options[:public], :store => @store}
instance = klass.new(options.any? ? default_options.merge(*options) : default_options)
@filters << instance if instance and !@filters.select { |k| k.is_a? instance.class }.any?
end
\ No newline at end of file