stimulizer 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: e783af7b60936cc4f7b1d13f98cf9519d81aed08d00b40696caf7d3b90166982
4
- data.tar.gz: e0c34c9c72c9f6cbbe7e3d57d262f230c91bc11d2f3451145bf062c36a4649bc
3
+ metadata.gz: ede79e02bdfb78d4042f27f862c167c67284704c4b198bb6a0782517ebf5f779
4
+ data.tar.gz: b62f26675aa4724f34912b16817ced4f49894b799a548fa104efaf2d42deaa8c
5
5
  SHA512:
6
- metadata.gz: 3a7217915c0e1daca592ad6493b2a3235c1f72ff5e4d0380ae1631e844d1d4601cb3305ec7b7b73f8feb653bc8ebfd2200f2c55ac9ca12fcd6ec9101a880b504
7
- data.tar.gz: 0a278b19ec5b6bd797894bf2905038aeea4d4ab01f2cfc409e0bf9cce1dc6807b8ffc8a93e85017333eef8d3def540e09f65eeeefe97976f57c6d5e20f1c6de2
6
+ metadata.gz: 7b1df244a9281ccf7afceef04e2be0ac128da7098f67b65788a000334752f52a7204eb6609a3e4571bf927b008364653b5bb0ce53eb1b0be9f44e09ada4206e4
7
+ data.tar.gz: 2cdd6844616929b08d1947ada11cec929d14b32b894a8299b5ae39bf7a8cb9cebc6510d59404cd9f6f37fbbfd7215ab4407fc8b1f3960000e49a5bc02303f8f3
data/CHANGELOG.md CHANGED
@@ -3,3 +3,7 @@
3
3
  ## [0.1.0] - 2022-11-03
4
4
 
5
5
  - Initial release
6
+
7
+ ## [0.2.1] - 2022-11-29
8
+
9
+ - Adds support for `outlets` in Stimulus 3.2.0
data/README.md CHANGED
@@ -49,6 +49,18 @@ Or install it yourself as:
49
49
  $ gem install stimulizer
50
50
 
51
51
  ## Usage
52
+ ### in a classic ERB View
53
+ Include the module in your ApplicationController (or individual controllers):
54
+
55
+ ```ruby
56
+ class ApplicationController < ActionController::Base
57
+ include Stimulizer
58
+ helper_method :stimulus
59
+ # ...
60
+ ```
61
+ NOTE that you have to add `helper_method :stimulus` to ensure the view templates can use the `stimulus` method.
62
+
63
+ ### in a ViewComponent
52
64
  Include this in your class:
53
65
 
54
66
  ```ruby
@@ -88,6 +100,9 @@ Render the stimulusjs data strings into your template...
88
100
 
89
101
  <!-- supports the 'params' feature -->
90
102
  <%= stimulus(params: {foo: "bar", this_thing: "whatever"})
103
+
104
+ <!-- supports the 'outlets' feature -->
105
+ <%= stimulus(outlets: {foo: ".my-class", bar: "#widget"})
91
106
  ```
92
107
  ... or combine them:
93
108
  ```
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stimulizer
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
data/lib/stimulizer.rb CHANGED
@@ -54,6 +54,7 @@ module Stimulizer
54
54
  .join(" ")
55
55
  .squish
56
56
  .strip
57
+ .html_safe
57
58
  end
58
59
 
59
60
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulizer
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
  - Matt E Patterson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-29 00:00:00.000000000 Z
11
+ date: 2023-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable