stimulus-rails 0.1.2 → 0.1.3

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: 9315f38125eef25637dac7d0a752284aae1774ff9a201b4ba1053b7e4be5883e
4
- data.tar.gz: 142e1f79541405565ee24ccf6d6db31d6f6271e0c34b29938cfcdaba5d3a6dd7
3
+ metadata.gz: 0ccf391e30e2e3ec0f91bdc894bba78582341c77dc33917dc094863f95767172
4
+ data.tar.gz: ac90fc101aabdf0e027bd281e69ab5d709116dc8d7a8200c258198d932534aeb
5
5
  SHA512:
6
- metadata.gz: 0d5eb9560d3b69c4f3b467b022ea7fab69fe5b1963bb1ecc2db06a047fe1e07f5e609e2f88b1cf1e723eb1d57a910a6ccf0eb0693d731dde467d89a97180f816
7
- data.tar.gz: 0d9cce5a56e595d947455cd69367b13c514cbaa658ab6dbea783d60ceb7ff961c136b8fe79bc785b4e1744f7a17d66f439337360bda26c7b34738b765160f710
6
+ metadata.gz: 1ff414d0de6993b78d077961f136d7f2cf72a5966a698ad0713698e96a14c40c70d46ca6c95cd575e14a3dfb044e0ac05dd784db268201b17fc067ab923ab5d1
7
+ data.tar.gz: 7f8f2e9a41e88ec03fdc936fadacaa109dd10890e6797cdd6d7b2484dc3eb746c31ee9d1fa07265ad5cf3e3ab87b40dd42efcddc87044eaa29ee897344ada441
@@ -1,6 +1,6 @@
1
1
  say "Copying Stimulus JavaScript"
2
2
  directory "#{__dir__}/app/assets/javascripts", "app/assets/javascripts"
3
- empty_directory "app/assets/javascripts/libraries"
3
+ empty_directory_with_keep_file "app/assets/javascripts/libraries"
4
4
 
5
5
  say "Add app/javascripts to asset pipeline manifest"
6
6
  append_to_file Rails.root.join("app/assets/config/manifest.js").to_s, "//= link_tree ../javascripts\n"
@@ -5,14 +5,15 @@ module Stimulus::ImportmapHelper
5
5
 
6
6
  def importmap_list_from(*paths)
7
7
  Array(paths).flat_map do |path|
8
- absolute_path = Rails.root.join(path)
9
- dirname = absolute_path.basename.to_s
8
+ if (absolute_path = Rails.root.join(path)).exist?
9
+ absolute_path.children.collect do |module_filename|
10
+ module_name = importmap_module_name_from(module_filename)
11
+ module_path = asset_path("#{absolute_path.basename.to_s}/#{module_filename.basename}")
10
12
 
11
- absolute_path.children.collect do |module_filename|
12
- module_name = importmap_module_name_from(module_filename)
13
- %("#{module_name}": "#{asset_path("#{dirname}/#{module_filename.basename}")}")
13
+ %("#{module_name}": "#{module_path}")
14
+ end
14
15
  end
15
- end.join(",\n")
16
+ end.compact.join(",\n")
16
17
  end
17
18
 
18
19
  private
@@ -1,3 +1,3 @@
1
1
  module Stimulus
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
8
8
  - Javan Mahkmali
9
9
  - David Heinemeier Hansson
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-12-28 00:00:00.000000000 Z
13
+ date: 2021-01-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -26,7 +26,7 @@ dependencies:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: 6.0.0
29
- description:
29
+ description:
30
30
  email: david@loudthinking.com
31
31
  executables: []
32
32
  extensions: []
@@ -57,7 +57,7 @@ licenses:
57
57
  metadata:
58
58
  homepage_uri: https://stimulus.hotwire.dev
59
59
  source_code_uri: https://github.com/hotwired/stimulus-rails
60
- post_install_message:
60
+ post_install_message:
61
61
  rdoc_options: []
62
62
  require_paths:
63
63
  - lib
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubygems_version: 3.1.2
76
- signing_key:
76
+ signing_key:
77
77
  specification_version: 4
78
78
  summary: A modest JavaScript framework for the HTML you already have.
79
79
  test_files: []