poms 1.2.1 → 1.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
  SHA1:
3
- metadata.gz: ee5228215b705f8652f6aaeb37488bf606504850
4
- data.tar.gz: e558535dd19b09a6bf2bf023d058264dae93718d
3
+ metadata.gz: 2cf1cb8d138dfb0cc64941c91166579039374f9f
4
+ data.tar.gz: 211325fcdf33276731f6955fff221311b3678e50
5
5
  SHA512:
6
- metadata.gz: 3f0a38243da2592fb5ce8f1508c3c94c5c28b102f842723a8805ec798c70034767635f1e6086dfb7cb0d4859b48bce23dee6f6193a996d2d0787b01e87a25838
7
- data.tar.gz: bc661c4464bbc297e37b2f93187b3593887729e2ebeb97199b38f438fcbf272545d64cd58adcd16e2e56f1ee2cd90e12de82c7f8f012299ac03e2b8a8d069dc8
6
+ metadata.gz: 943723499c03b7dfa58465c365d07787aede3b30d710332bbc6c046fce03f6050ece00da032c9416c41e09383668e69bf0ff9ea9c5b5be6bcae153765b75aab7
7
+ data.tar.gz: e73de97e4ef76cfd6db078e671d2ced5c4582e5021ec5132041e76fdee3246d86625a72fe83981c5174079fd9509eaf46f17becc12b706c04f634256833fa44d
@@ -1,5 +1,9 @@
1
1
  # Poms Release notes
2
2
 
3
+ ## 1.2.2
4
+
5
+ * Fix issue with description type that did not exist.
6
+
3
7
  ## 1.2.1
4
8
 
5
9
  * [#25](https://github.com/brightin/poms/pull/25) Fix issue with `Timestamp.convert`
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- poms (1.2.0)
4
+ poms (1.2.2)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -72,7 +72,9 @@ module Poms
72
72
  # @param key The key of the array we want to look in
73
73
  # @param type The type to select
74
74
  def value_of_type(item, key, type)
75
- item[key].find { |value| value['type'] == type }['value']
75
+ res = item[key].find { |value| value['type'] == type }
76
+ return unless res
77
+ res['value']
76
78
  end
77
79
  end
78
80
  end
@@ -1,4 +1,4 @@
1
1
  # The version
2
2
  module Poms
3
- VERSION = '1.2.1'
3
+ VERSION = '1.2.2'
4
4
  end
@@ -7,6 +7,10 @@ describe Poms::Fields do
7
7
  it 'returns the first MAIN title' do
8
8
  expect(described_class.title(poms_data)).to eq('VRijland')
9
9
  end
10
+
11
+ it 'returns nil if no title can be found' do
12
+ expect(described_class.title(poms_data, 'NONEXISTANTTYPE')).to be_nil
13
+ end
10
14
  end
11
15
 
12
16
  describe '#description' do
@@ -16,6 +20,11 @@ een baantje aan bij de uitdragerij en vraagt zich meteen af of dat wel zo slim \
16
20
  was. Timon en Joep zien de criminele organisatie de Rijland Angels. Timon wil \
17
21
  naar hun loods, maar is dat wel een goed idee?")
18
22
  end
23
+
24
+ it 'returns nil if no description can be found' do
25
+ expect(described_class.description(poms_data, 'NONEXISTANTTYPE'))
26
+ .to be_nil
27
+ end
19
28
  end
20
29
 
21
30
  describe '#first_image_id' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Kruijsen