lib/eslint-rails/runner.rb in eslint-rails-1.2.0 vs lib/eslint-rails/runner.rb in eslint-rails-1.2.1
- old
+ new
@@ -28,10 +28,12 @@
file = Pathname.new("#{file}.js") if !file.directory? && file.extname.empty? # Make sure it has an extension
file
end
def assets
- all_js_assets = Rails.application.assets.each_file.to_a.select { |pn| JAVASCRIPT_EXTENSIONS.include?(pn.extname) }
+ all_js_assets = Rails.application.assets.each_file.to_a.map { |path| Pathname.new(path) }.select do |asset|
+ JAVASCRIPT_EXTENSIONS.include?(asset.extname)
+ end
assets = all_js_assets.select{|a| is_descendant?(@file, a)}
assets.reject{|a| a.to_s =~ /eslint.js|vendor|gems|min.js|editorial/ }
end