lib/requirejs/rails/config.rb in requirejs-rails-0.7.0 vs lib/requirejs/rails/config.rb in requirejs-rails-0.7.1
- old
+ new
@@ -11,10 +11,11 @@
def initialize
super
self.manifest = nil
+ self.logical_asset_filter = [/\.js$/,/\.html$/,/\.txt$/]
self.tmp_dir = Rails.root + 'tmp'
self.bin_dir = Pathname.new(__FILE__+'/../../../../bin').cleanpath
self.source_dir = self.tmp_dir + 'assets'
self.target_dir = Rails.root + 'public/assets'
@@ -127,8 +128,14 @@
self.target_dir+(module_name_for(mod)+'.js')
end
def get_binding
return binding()
+ end
+
+ def asset_allowed?(asset)
+ self.logical_asset_filter.reduce(false) do |accum, matcher|
+ accum || (matcher =~ asset)
+ end ? true : false
end
end
end