importmap-rails 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35f2f43892e0e51811094caf1cc3239ff50cc84d6c25343ac462b77f284797a6
4
- data.tar.gz: 0f91507c1daf180e40744350b7335cb1a24a5bc063963cc7df88b71695de5a35
3
+ metadata.gz: b87e83df8630c47a117ee7a9a854a8d34bd65112e547c27a5ae9133fb62f3c8a
4
+ data.tar.gz: b6c77a31b534440c7a6a3132e1f88d14f658ed350fcd95d446bba9d58df11bc5
5
5
  SHA512:
6
- metadata.gz: 96a9a8b0bc81dc2f1f7ea085c9fa9cb765cfaf4545a643f5dac80e299ea9c12c6b3c7597361f67e79f9261c28298c68d0c06aea582efa8736ee79afcf5e0ad68
7
- data.tar.gz: b82ae667a77b3b96665bcf053388b2a2573926c4920d44c2c69316929fbacb7f034dbdd6f11b71fefc2965deb59e954925b5289323e7498328d7ac86a3338c68
6
+ metadata.gz: 40f0955bde9ab6792c5b1e0b5f0fa4eed8701aa09f2b71c69dd1fe1f6b088131d2dd0089e4bd68b14172e4042a49959a7de609adc9f711bbd6e819552ec6fb11
7
+ data.tar.gz: 471bc782818dc139c3a46fb8c1896784069b8d8c8ff777cdc2880d462f5efa207021292079d7b9de127af58cd916901153f8a7981944fc52e81ad80b418907fb
data/lib/importmap/map.rb CHANGED
@@ -76,16 +76,7 @@ class Importmap::Map
76
76
  end
77
77
 
78
78
  def module_name_from(filename, mapping)
79
- filename_without_ext_and_version = filename.to_s.remove(filename.extname).split("@").first
80
-
81
- case
82
- when filename_without_ext_and_version == "index" && mapping.under
83
- mapping.under
84
- when mapping.under
85
- "#{mapping.under}/#{filename_without_ext_and_version}"
86
- else
87
- module_name
88
- end
79
+ [ mapping.under, filename.to_s.remove(filename.extname).remove(/\/?index$/).presence ].compact.join("/")
89
80
  end
90
81
 
91
82
  def module_path_from(filename, mapping)
@@ -1,3 +1,3 @@
1
1
  module Importmap
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importmap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-20 00:00:00.000000000 Z
11
+ date: 2021-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails