Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit f1016f0

Browse files
committed
Fix #221
1 parent b05d053 commit f1016f0

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

lib/requirejs/rails/config.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,6 @@ def module_name_for(mod)
158158
def get_binding
159159
return binding()
160160
end
161-
162-
def asset_allowed?(logical_path)
163-
logical_path_patterns.reduce(false) do |accum, pattern|
164-
accum || !!(pattern.match(logical_path))
165-
end
166-
end
167161
end
168162
end
169163
end

lib/tasks/requirejs-rails_tasks.rake

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ OS X Homebrew users can use 'brew install node'.
9898
original_cache = requirejs.env.cache
9999
requirejs.env.cache = nil
100100

101-
js_ext = requirejs.env.mime_types["application/javascript"][:extensions].first
102-
103-
requirejs.env.logical_paths do |logical_path, physical_path|
104-
next \
105-
if !requirejs.config.asset_allowed?(logical_path)
101+
if ::Sprockets::VERSION.split(".", -1)[0].to_i >= 3
102+
js_ext = requirejs.env.mime_types["application/javascript"][:extensions].first
103+
else
104+
js_ext = requirejs.env.extension_for_mime_type("application/javascript")
105+
end
106106

107+
requirejs.env.each_logical_path(requirejs.config.logical_path_patterns) do |logical_path|
107108
m = ::Requirejs::Rails::Config::BOWER_PATH_PATTERN.match(logical_path)
108109

109110
if !m

0 commit comments

Comments
 (0)