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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 062733471325a76083d3861ebc60e24de61c9ca6825f5c1f67a12f5fa5a1426f
4
- data.tar.gz: e0558fe1ed34f8acca66e8ea69e2da281818425f233befffb58b8de708800eb7
3
+ metadata.gz: 5151a1020627fe9e31d83862d49578c488acd438f01e148d0380514fdcdda432
4
+ data.tar.gz: 7e409bde21abdf03fa1d90bdae3dc2a466dd050b21b3f8a111640f0be26ff2a5
5
5
  SHA512:
6
- metadata.gz: 5dbcd1ac7939a7839512db3db717a109631050faf6c9413539e7804488e90fea1f17725bf1091726ea444a9456adab66edc7089b8b1b941cb929dd1cfa3036b8
7
- data.tar.gz: d442c75a097ac2a2fd73281828c64ef0b39c8339603508201573caa755109cec41c08db4fb5475a2640ac515946e0967da01e6c1485b73cbf6c583dcfbe2289e
6
+ metadata.gz: 88dd20297251eec216bae0ff627a75049e93e6fd8f4bdfc309cbe726090eee77e4c236312c70e05dc779e4e3452ee370d89596e25c5cbed808d075e6a85d931e
7
+ data.tar.gz: 2f6146f219fe838c04936a500d38e4b4effb464a6f08062c8e09ca9d21d263823a15e808eb94b9056bdadbfc9187fc61eee0638fd334635dadc85e5a2fb24e65
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stimulux
4
- VERSION = '0.1.0'
4
+ VERSION = '1.0.0'
5
5
  end
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 controllers(*args)
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 targets(*names)
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["data-#{kebabize(controller)}-target"] = target_name
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 actions(*names)
43
+ def stimulus_action(*names)
41
44
  { 'data-action' => names.join(' ') }
42
45
  end
43
46
 
44
- def classes(*definitions)
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: 0.1.0
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-03 00:00:00.000000000 Z
10
+ date: 2026-01-04 00:00:00.000000000 Z
11
11
  dependencies: []
12
- description: 'Stimulus, without brain gymnastics: helpers for Phlex and HtmlSlice
13
- ''data-'' atributes generation'
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 Phlex and HtmlSlice ''data-''
44
- atributes generation'
43
+ summary: 'Stimulus, without brain gymnastics: helpers for ''data-'' atributes generation
44
+ in Phlex and HtmlSlice'
45
45
  test_files: []