Skip to content

Commit c5ae500

Browse files
author
David Heinemeier Hansson
committed
Use double dashes for nesting
Reduce chance of collision, make it clearer
1 parent 6b42a12 commit c5ae500

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/importmap/packager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ def vendored_package_path(package)
121121
end
122122

123123
def package_filename(package)
124-
"#{package.gsub("/", "-")}.js"
124+
"#{package.gsub("/", "--")}.js"
125125
end
126126
end

test/packager_integration_test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ class Importmap::PackagerIntegrationTest < ActiveSupport::TestCase
2323
Importmap::Packager.endpoint = original_endpoint
2424
end
2525

26-
test "successful download from live service" do
26+
test "successful downloads from live service" do
2727
Dir.mktmpdir do |vendor_dir|
2828
@packager = Importmap::Packager.new \
2929
Rails.root.join("config/importmap.rb"),
3030
vendor_path: Pathname.new(vendor_dir)
3131

32+
@packager.download("@github/webauthn-json",
33+
"https://ga.jspm.io/npm:@github/[email protected]/dist/main/webauthn-json.js")
34+
assert File.exist?(Pathname.new(vendor_dir).join("@github--webauthn-json.js"))
35+
3236
@packager.download("react", "https://ga.jspm.io/npm:[email protected]/index.js")
3337
assert File.exist?(Pathname.new(vendor_dir).join("react.js"))
3438

0 commit comments

Comments
 (0)