has_stimulus_attrs 0.2.1 → 0.2.2

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: ab9a410dcca140dff84d140d63c800df80079dc0262b8f1aa4f2483843ce31f5
4
- data.tar.gz: ee2fe71c3d4dede74df29b28318bdd0abcb8ca5ac90fb474d2fb180122f7eb32
3
+ metadata.gz: 3a3a965811c25f20f220e33a4d7e579081309e45501235c168238b8ed83db4b3
4
+ data.tar.gz: '0804e6cd1db9b7399bb70ec14e3df96b78a67bd84a92d6d799d39709924923cb'
5
5
  SHA512:
6
- metadata.gz: d5ee171cd41a62288db206cb1f170d2b065629284329cb9ea9b7850a94e4b40b38624e30e76ceae2184b70806ba6cc601f903d95fae0d219c5875936cbd78eb2
7
- data.tar.gz: 5f0993dea9aacad431660fe91f587a27b37b41bc37f0839afeac188d1aa43a302f22bd402d351f79989aac87f316ebae6e6d7586b423690436036056172f38e5
6
+ metadata.gz: 850a00e3ee81c9783f59711efdd2045b4405225dc424759c6f8a5071526187aa588f1e1136cd572ddaef16dc9b1134142eeaef4c17a69e5726eaa3e35a0d8a69
7
+ data.tar.gz: 9e81d373052c1861e0304beb023ce2b0ed0e345bcd844a7afcba10fe7dec2c9cdb7173fba46893339d83102b247f0bd2da56ea4c61484a820561f60675951ef8
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.4
1
+ 3.3.5
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## [0.2.0](https://github.com/tomasc/has_stimulus_attrs/compare/v0.1.0...v0.2.0) (2023-03-22)
3
+ ## [0.2.2](https://github.com/tomasc/has_stimulus_attrs/compare/v0.2.1...v0.2.2) (2025-01-31)
4
+
5
+ ### Features
4
6
 
7
+ * allow has_stimulus_action to accept proc ([PR#6](https://github.com/tomasc/has_stimulus_attrs/pull/6))
8
+
9
+
10
+ ## [0.2.0](https://github.com/tomasc/has_stimulus_attrs/compare/v0.1.0...v0.2.0) (2023-03-22)
5
11
 
6
12
  ### Features
7
13
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HasStimulusAttrs
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
@@ -35,7 +35,13 @@ module HasStimulusAttrs
35
35
  end
36
36
 
37
37
  key = :action
38
- val = -> { stimulus_action((controller || controller_name), event, action).values.first }
38
+ val = -> {
39
+ a = case action
40
+ when Proc then instance_exec(&action)
41
+ else action.to_s
42
+ end
43
+ stimulus_action((controller || controller_name), event, a).values.first
44
+ }
39
45
 
40
46
  prepend___has_stimulus___method(key, val, **options)
41
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_stimulus_attrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-07-25 00:00:00.000000000 Z
12
+ date: 2025-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: stimulus_helpers
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.5.11
167
+ rubygems_version: 3.5.16
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Helper methods for dealing with stimulus attributes.