content_pack_rails 0.2.1 → 0.2.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: 8d7a3eaa15d894f901857b7f1fb609219777a46ab41241de2da90a9c7fcdf6a6
4
- data.tar.gz: 8da6f119eee95b9fada767afa4d5583940b8d3c0a13cbdfd47fbebb5733964a1
3
+ metadata.gz: 89dead0672c57816e3b38635b3261e2f8b2b96b0905307cf84f9ee98c646949f
4
+ data.tar.gz: d79dcad158c901efafb4b18e8bb5e02b9c749879e1161fa128b628ed2c3167bc
5
5
  SHA512:
6
- metadata.gz: cdfc6cc67ad7bbd8270cfa21b43fccee2cc9b063954bbb9a72312b28f85343fa3d7bbae22c0274eec469a346d258f7f51a7bf907209553197fff7f53998f6104
7
- data.tar.gz: 0f2a33e6fe84235b7f9bb09201851c78633171fe57d8904526ecc1cc4fe29ad38d768a2d3d474d06cfc27f0d1fbbd17c972fd32cdda5a6df8387d7cc75cde829
6
+ metadata.gz: 42e5a18de8b72bf349885cc7e68a1dac9b6ca25194f9471b9c309e45e9c86f77402da4b49001048730418a2fe1bd19d4e3199d77af8407ce928d589d5a9aa25d
7
+ data.tar.gz: c6ccae1428cf9f328d86527e3e9da3dfea7a877f7368257461936e3d9d4750ee308642d999583599439aef65fd22d7605383941c81df977c5b99f6d0cfe8e463
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2 (2021-12-08)
4
+
5
+ ### Bug Fixes
6
+
7
+ * prevent provide_content_pack from crash when no content collected
8
+
3
9
  ## 0.2.1 (2021-12-08)
4
10
 
5
11
  ### Bug Fixes
@@ -1,3 +1,3 @@
1
1
  module ContentPackRails
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -16,8 +16,10 @@ module ContentPackRails
16
16
  end
17
17
 
18
18
  define_method "provide_#{configs[:pack_name]}" do
19
- instance_variable_get(:"@_#{configs[:pack_name]}_ids").inject(nil) do |acc, id|
20
- acc ? acc.safe_concat(content_for(id)) : content_for(id)
19
+ return unless (ids = silent.call { instance_variable_get(:"@_#{configs[:pack_name]}_ids") })
20
+ ids.inject(nil) do |acc, id|
21
+ return acc unless (content = content_for(id))
22
+ acc ? acc.safe_concat(content) : content
21
23
  end
22
24
  end
23
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: content_pack_rails
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
  - Andrew Bohush