inline_partial 0.1.0 → 0.1.2

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: 001e33d06f529c175c05f8c34d8fed9868a3d6c1e6945b1ba0df95de8bf96cc9
4
- data.tar.gz: 33bf987d20b9be8c0937df970d87c04e37953687eaf179a20e5b51a16da3a8c5
3
+ metadata.gz: cf589099fdc68511ac7d1e64ac5492ad210099aa6604af9c4ee8d49f3d6a6f73
4
+ data.tar.gz: b9a405ca7894b06eb720d3f730f6a16dfa5e2bd118ea2c83a03115335633a484
5
5
  SHA512:
6
- metadata.gz: 036bc1842e3861a1a9c4559832628765bb8683c0aaf3465e72354f657a111cc170b4db3658960f06170344792d5ceb7e5ee8509858152aa37b01809de4fd01eb
7
- data.tar.gz: b507b7a9d180329ef87e1b40a673824c0f71194f89d0c720d3cab812042f36aa5a53415d7501a66f10ba091a4d06c5ebee42a327286b02b4da5c805355acd9ab
6
+ metadata.gz: 1f39cfa31235ed73a17dc8cb14400fdf095a06b52ce1a86f85133dd964598feb4ec227f9f77c848ba5db071bda26aad25caa138e69dc7e29e152c51322d23b94
7
+ data.tar.gz: '0218cffaa9da21814eeb1606784ff6108b211b24b94717bf596db14f5156d47ac7237e3c221fd53732bb4447fd6d11c5448a26d8d3388d59080976bd33c1d83e'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  ## [Unreleased]
2
2
 
3
+ - No changes yet.
4
+
5
+ ## [0.1.2] - 2025-06-28
6
+
7
+ - Update README to emphasize that partial templates can be defined with **any name**
8
+ - Clarify README and RBS documentation for inline_partial usage and parameters
9
+
10
+ ## [0.1.1] - 2025-06-28
11
+
12
+ - Second release of inline_partial gem.
13
+ - Refactored `render_inline_partial` method to use explicit object parameter instead of `*args`.
14
+
3
15
  ## [0.1.0] - 2025-06-28
4
16
 
5
17
  - Initial release
data/README.md CHANGED
@@ -22,7 +22,7 @@ You can define a reusable ERB partial directly in your view:
22
22
  <%= render_inline_partial :foo %>
23
23
  ```
24
24
 
25
- This example defines a partial template named `user_row`. In this way, you can define partial templates with any name.
25
+ This example defines a partial template named `:user_row`. You can define inline partials with **any name**, using either a **symbol** or a **string**.
26
26
 
27
27
  ```erb
28
28
  <% inline_partial(:user_row) do |user| %>
@@ -10,7 +10,7 @@ module InlinePartial
10
10
  nil
11
11
  end
12
12
 
13
- def render_inline_partial(name, *args, collection: nil)
13
+ def render_inline_partial(name, object = nil, collection: nil)
14
14
  raise ArgumentError, "partial name must be present (not nil)" if name.nil?
15
15
 
16
16
  if collection
@@ -21,7 +21,7 @@ module InlinePartial
21
21
  partial = @_inline_partials&.[](name)
22
22
  raise ArgumentError, "inline partial :#{name.inspect} not found" unless partial
23
23
 
24
- capture(*args, &partial)
24
+ capture(object, &partial)
25
25
  end
26
26
  end
27
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InlinePartial
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -3,10 +3,10 @@ module InlinePartial
3
3
 
4
4
  module Helper
5
5
  # パーシャルの定義(ブロック必須)
6
- def inline_partial: ((Symbol | String)?) { (*untyped) -> untyped } -> nil
6
+ def inline_partial: ((Symbol | String), { (*untyped) -> untyped }) -> nil
7
7
 
8
- # collection キーワード引数に対応
9
- def render_inline_partial: (Symbol | String, *untyped, ?collection: untyped) -> untyped
8
+ # objectパラメータとcollectionキーワード引数に対応
9
+ def render_inline_partial: ((Symbol | String), ?untyped, ?collection: untyped) -> untyped
10
10
  end
11
11
 
12
12
  class Railtie < Rails::Railtie
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_partial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - lef237