stimulux 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stimulux/version.rb +1 -1
- data/lib/stimulux.rb +9 -6
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5151a1020627fe9e31d83862d49578c488acd438f01e148d0380514fdcdda432
|
|
4
|
+
data.tar.gz: 7e409bde21abdf03fa1d90bdae3dc2a466dd050b21b3f8a111640f0be26ff2a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88dd20297251eec216bae0ff627a75049e93e6fd8f4bdfc309cbe726090eee77e4c236312c70e05dc779e4e3452ee370d89596e25c5cbed808d075e6a85d931e
|
|
7
|
+
data.tar.gz: 2f6146f219fe838c04936a500d38e4b4effb464a6f08062c8e09ca9d21d263823a15e808eb94b9056bdadbfc9187fc61eee0638fd334635dadc85e5a2fb24e65
|
data/lib/stimulux/version.rb
CHANGED
data/lib/stimulux.rb
CHANGED
|
@@ -5,7 +5,7 @@ require_relative 'stimulux/version'
|
|
|
5
5
|
module Stimulux
|
|
6
6
|
extend self
|
|
7
7
|
|
|
8
|
-
def
|
|
8
|
+
def stimulus_controller(*args)
|
|
9
9
|
controller_names = []
|
|
10
10
|
value_attributes = {}
|
|
11
11
|
|
|
@@ -30,18 +30,21 @@ module Stimulux
|
|
|
30
30
|
{ 'data-controller' => controller_names.join(' ') }.merge(value_attributes)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def
|
|
34
|
-
names.each_with_object({}) do |name, hash|
|
|
33
|
+
def stimulus_target(*names)
|
|
34
|
+
stimulus_target = names.each_with_object(Hash.new { |h, k| h[k] = [] }) do |name, hash|
|
|
35
35
|
controller, target_name = name.to_s.split('#')
|
|
36
|
-
hash[
|
|
36
|
+
hash[kebabize(controller)] << target_name
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
stimulus_target.transform_keys { |key| "data-#{key}-target" }
|
|
40
|
+
.transform_values { |value| value.join(' ') }
|
|
38
41
|
end
|
|
39
42
|
|
|
40
|
-
def
|
|
43
|
+
def stimulus_action(*names)
|
|
41
44
|
{ 'data-action' => names.join(' ') }
|
|
42
45
|
end
|
|
43
46
|
|
|
44
|
-
def
|
|
47
|
+
def stimulus_class(*definitions)
|
|
45
48
|
definitions.each_with_object({}) do |(name, classes_hash), hash|
|
|
46
49
|
controller_name = kebabize(name)
|
|
47
50
|
classes_hash.each do |key, value|
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stimulux
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- henrique-ft
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-01-
|
|
10
|
+
date: 2026-01-04 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
|
-
description: 'Stimulus, without brain gymnastics: helpers for
|
|
13
|
-
|
|
12
|
+
description: 'Stimulus, without brain gymnastics: helpers for ''data-'' atributes
|
|
13
|
+
generation in Phlex and HtmlSlice'
|
|
14
14
|
email:
|
|
15
15
|
- hriqueft@gmail.com
|
|
16
16
|
executables: []
|
|
@@ -40,6 +40,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
40
40
|
requirements: []
|
|
41
41
|
rubygems_version: 3.6.6
|
|
42
42
|
specification_version: 4
|
|
43
|
-
summary: 'Stimulus, without brain gymnastics: helpers for
|
|
44
|
-
|
|
43
|
+
summary: 'Stimulus, without brain gymnastics: helpers for ''data-'' atributes generation
|
|
44
|
+
in Phlex and HtmlSlice'
|
|
45
45
|
test_files: []
|