nice_partials 0.9.2 → 0.9.3

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: e8c2fc27ad0c01eda3e489191c6ba385498ec49580f38400f8447600ee8d0488
4
- data.tar.gz: e138bd379b7f805e0be27054d6a689e31d58169e27ad118bec43a3538b24c9f9
3
+ metadata.gz: 14580892ce441161fda38b893e61d4b4733b1fd1c0130f22cf73dc7170f9ddd2
4
+ data.tar.gz: '0696801e28b1ab5f3574cca9d71bcb03a702fa76d5076a25881ef0dfaa883638'
5
5
  SHA512:
6
- metadata.gz: 24aa6946079c6663a907b6e7eb2c6158b07105bc3cf0273a9907c2a7732fc6ba030e3b733b8beacd1221288e32c995067a0af6b30649e8a6c8ec7960e8adcd22
7
- data.tar.gz: 70548909852322e987e7a11aafb81f927b9652ac03bef500f1ddf3b3daca915bc37d22270a537a37580ac67e0fa76ef158bc7a783bf8327c603ad108cc275a5b
6
+ metadata.gz: 302fdc205c1c433b670bcdd22d45a0a66bccdcdc15fae841ef88ae0209079a77cd2bddff199060a17be941164a7a8e852c16d6b508674483e123eebdb8f5c892
7
+ data.tar.gz: 8b9cff626b4a6c713d274609427c6ed28dbc20a31b9825aa52b21e8670c59f37e5c1f5552460a357ff06b47aca3af7a0fd78c937882bf6779c8f0281ac2b6b0c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 0.9.3
4
+
5
+ * Fixed: section predicates not respecting `local_assigns` content
6
+
7
+ Previously, when doing something like this:
8
+
9
+ ```erb
10
+ <%= render "card", title: "Hello there" %>
11
+ ```
12
+
13
+ If the inner card partial had this,
14
+
15
+ ```erb
16
+ <% if partial.title? %>
17
+ <%= partial.title %>
18
+ <% end %>
19
+ ```
20
+
21
+ The `title?` predicate would fail, because it didn't look up content from the passed `local_assigns`. Now it does.
22
+
3
23
  ### 0.9.2
4
24
 
5
25
  * Changed: view methods don't clobber section names
@@ -8,7 +8,7 @@ module NicePartials::RenderingWithLocalePrefix
8
8
  end
9
9
 
10
10
  def t(key, options = {})
11
- if (prefix = @_nice_partials_t_prefix) && key.first == '.'
11
+ if (prefix = @_nice_partials_t_prefix) && key&.start_with?(".")
12
12
  key = "#{prefix}#{key}"
13
13
  end
14
14
 
@@ -70,7 +70,7 @@ module NicePartials
70
70
  end
71
71
 
72
72
  def section?(name)
73
- @sections&.dig(name).present?
73
+ section_from(name).present?
74
74
  end
75
75
  alias content_for? section?
76
76
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NicePartials
4
- VERSION = "0.9.2"
4
+ VERSION = "0.9.3"
5
5
  end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ require File.dirname(__FILE__) + "/lib/nice_partials/version"
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "nice_partials"
7
+ gem.version = NicePartials::VERSION
8
+ gem.summary = "A little bit of magic to make partials perfect for components."
9
+ gem.description = "A little bit of magic to make partials perfect for components."
10
+ gem.authors = ["Andrew Culver", "Dom Christie"]
11
+ gem.email = ["andrew.culver@gmail.com", "christiedom@gmail.com"]
12
+ gem.homepage = "https://github.com/bullet-train-co/nice_partials"
13
+ gem.license = "MIT"
14
+
15
+ # Specify which files should be added to the gem when it is released.
16
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
+ gem.files = Dir.chdir(__dir__) do
18
+ `git ls-files -z`.split("\x0").reject do |f|
19
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
20
+ end
21
+ end
22
+ gem.bindir = "exe"
23
+ gem.executables = gem.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
24
+ gem.require_paths = ["lib"]
25
+
26
+ gem.required_ruby_version = ">= 2.0"
27
+
28
+ gem.add_dependency "actionview", '>= 4.2.6'
29
+
30
+ gem.add_development_dependency "rails"
31
+ gem.add_development_dependency "standard"
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nice_partials
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-02-15 00:00:00.000000000 Z
12
+ date: 2023-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionview
@@ -75,6 +75,7 @@ files:
75
75
  - lib/nice_partials/partial/section.rb
76
76
  - lib/nice_partials/partial/stack.rb
77
77
  - lib/nice_partials/version.rb
78
+ - nice_partials.gemspec
78
79
  homepage: https://github.com/bullet-train-co/nice_partials
79
80
  licenses:
80
81
  - MIT
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
- rubygems_version: 3.3.7
98
+ rubygems_version: 3.4.7
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: A little bit of magic to make partials perfect for components.