slotify 0.1.0 → 0.2.1

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: 7901ad71acf99111a450667e96a494becbfc55d78c62ab2314b7c3b8dae7e588
4
- data.tar.gz: 73ef165ade4d766b69ef68cbba336bf488991e452038f751d3e5fb2f82c34bf5
3
+ metadata.gz: 7fe52ecf551de7b80d23c5a6924bc0f338da813a1eec26283ffe1ca8de082fee
4
+ data.tar.gz: be3a41ab56f4dc2d6040ce35cbc36512a8d723dc3d2e48249d9bac41d40ac123
5
5
  SHA512:
6
- metadata.gz: 906ce11515dcb698273445333d273233e96b9006454714b8d17d8a034f38fd333ef649c4d196e21d403e93ed1bca3c4016849aa4c1ac22c3803870d851dce1ba
7
- data.tar.gz: d45ebbafe579ff34b4727ab14edae97898a87fd87452b841b3989f438248d927cdb16593b4ab05321bf4dce8a7f1e99f39639065798a91a7436f72f442d2b227
6
+ metadata.gz: a9cea080765ad7fa9d08ce605fd743c39999ff1b001f994e2e3ce0802186715a5b75540480ebb94a0fc89cd1215de25a25608e965ebb5be33836690a994f5b20
7
+ data.tar.gz: e228bf1cc15765f6400d4b21aa237ce3bbe7bb33adc0722911c21ca6b16d76a8d035733cab92ca4dbb5173bfa8f4b9076171753c9b627cc0eb0b9e1c04cc0aaf
data/README.md CHANGED
@@ -178,9 +178,9 @@ the default value will be used instead.
178
178
  <%# slots: (title: "Default title", author: nil) -%>
179
179
  ```
180
180
 
181
- ### Setting slot values
181
+ ### Passing content to slots
182
182
 
183
- Content is passed into slots using dynamically generated `partial#with_<slot_name>` writer methods.
183
+ Content is passed to slots by calling the appropriate `.with_<slot_name>` writer method on the argument yielded to the block when rendering the partial.
184
184
 
185
185
  Content can be provided as either the **first argument** or **as a block** when calling these methods at render time.
186
186
  The following two examples are equivalent:
data/lib/slotify/error.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  module Slotify
2
+ class Error < StandardError
3
+ end
4
+
2
5
  class UnknownSlotError < NameError
3
6
  end
4
7
 
@@ -34,7 +34,7 @@ module Slotify
34
34
  end
35
35
 
36
36
  def missing_strict_locals_error?(error)
37
- error.template && defined?(ActionView::StrictLocalsError) && error.cause.is_a?(ActionView::StrictLocalsError) ||
37
+ error.template && Object.const_defined?("ActionView::StrictLocalsError") && error.cause.is_a?(ActionView::StrictLocalsError) ||
38
38
  (error.cause.is_a?(ArgumentError) && error.cause.message.match(/missing local/))
39
39
  end
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module Slotify
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/slotify.rb CHANGED
@@ -6,6 +6,7 @@ require_relative "slotify/error"
6
6
  loader = Zeitwerk::Loader.for_gem
7
7
  loader.tag = "slotify"
8
8
  loader.push_dir("#{__dir__}/slotify", namespace: Slotify)
9
+ loader.ignore("#{__dir__}/slotify/error")
9
10
  loader.collapse("#{__dir__}/slotify/concerns")
10
11
  loader.collapse("#{__dir__}/slotify/services")
11
12
  loader.enable_reloading if ENV["RAILS_ENV"] == "development"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-04-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: zeitwerk
@@ -38,8 +37,6 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
- description:
42
- email:
43
40
  executables: []
44
41
  extensions: []
45
42
  extra_rdoc_files: []
@@ -60,11 +57,9 @@ files:
60
57
  - lib/slotify/value_options.rb
61
58
  - lib/slotify/value_store.rb
62
59
  - lib/slotify/version.rb
63
- homepage:
64
60
  licenses:
65
61
  - MIT
66
62
  metadata: {}
67
- post_install_message:
68
63
  rdoc_options: []
69
64
  require_paths:
70
65
  - lib
@@ -79,8 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
74
  - !ruby/object:Gem::Version
80
75
  version: '0'
81
76
  requirements: []
82
- rubygems_version: 3.5.10
83
- signing_key:
77
+ rubygems_version: 3.6.9
84
78
  specification_version: 4
85
79
  summary: Superpowered slots for your Rails partials.
86
80
  test_files: []