lib/compressible/configurable.rb in compressible-0.0.2.4 vs lib/compressible/configurable.rb in compressible-0.0.2.6
- old
+ new
@@ -18,10 +18,14 @@
config[type] = [config[type]] unless config[type].is_a?(Array)
end
self
end
+
+ def define!(*args, &block)
+ Compressible::Builder.define!(*args, &block)
+ end
def defaults
{
:js => [],
:css => [],
@@ -36,10 +40,10 @@
end
def add_to_config(type, key, value)
raise "Please define a name for the cached #{type.to_s} using ':to => :my_name'" unless key
item = find_or_create(type, key)
- item[:paths] = value.collect {|i| asset_name(i)}
+ item[:paths] = value.flatten.collect {|i| asset_name(i)}
item
end
def find_or_create(type, key)
result = config[type].detect {|i| i[:to].to_s == key.to_s}
\ No newline at end of file