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

Commit 2f79626

Browse files
committed
Fix faulty behavior for scripts with . in their name (not counting the .js extension)
1 parent 223370d commit 2f79626

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/tasks/requirejs-rails_tasks.rake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ OS X Homebrew users can use 'brew install node'.
110110
asset.write_to(file)
111111
end
112112
else
113-
bower_logical_path = Pathname.new(logical_path).dirname.sub_ext(".js").to_s
113+
bower_logical_path = "#{Pathname.new(logical_path).dirname.to_s}.js"
114114
asset = requirejs.env.find_asset(bower_logical_path)
115115

116116
if asset
@@ -148,13 +148,13 @@ OS X Homebrew users can use 'brew install node'.
148148
requirejs.config.build_config["modules"].each do |m|
149149
module_name = requirejs.config.module_name_for(m)
150150
paths = requirejs.config.build_config["paths"] || {}
151-
module_script_name = Pathname.new(module_name).sub_ext(".js").to_s
151+
module_script_name = "#{module_name}.js"
152152

153153
# Is there a `paths` entry for the module?
154154
if !paths[module_name]
155155
asset_name = module_script_name
156156
else
157-
asset_name = Pathname.new(paths[module_name]).sub_ext(".js").to_s
157+
asset_name = "#{paths[module_name]}.js"
158158
end
159159

160160
asset = requirejs.env.find_asset(asset_name)

0 commit comments

Comments
 (0)