rixml 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/lib/rixml.rb +8 -2
  4. data/rixml.gemspec +2 -2
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fab589e31372623e5526eb41754db09abb35da0
4
- data.tar.gz: 175d32461bab5796ce2f57a3033a94efdaf6a923
3
+ metadata.gz: 359ba658516e9dea4907922d9d6f5298e79248e3
4
+ data.tar.gz: 2a93a37ef8d500378b307c85f10368b940d6c1c1
5
5
  SHA512:
6
- metadata.gz: 92e9412870a57c0d5ecc3faea33efe0f927672239cfca4083432655452dbc4acc641408d5404d31f0f15ef13344d3f8346c7b56f667f8e6509afe68509458a6f
7
- data.tar.gz: 8036e218d6571e3857c11d9a4d56150f6b6ce565568b9715447ad253803639fe0438d16054593bd8f590daa09c3eb05c0f6712ea933402cf229689d404f994df
6
+ metadata.gz: c7b3bd756e49d433df80f667d42e7cab07be1e712ca19c36381def79a6639a1cdf7ed78a248b202740e3d0c10c554f1da29113743094e29b97522c453b044637
7
+ data.tar.gz: e9bd78e4f11f083c6a5c07f86ec46fcbefc235ec5433e6e081751d65551eee2cd78139614d698986276c6a011d3770d140a23fa3862ebf13bc100ec3e655061f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rixml (0.1.3)
4
+ rixml (0.1.4)
5
5
  activesupport (>= 4.0.0)
6
6
  nokogiri (~> 1.5)
7
7
 
@@ -15,11 +15,11 @@ GEM
15
15
  tzinfo (~> 1.1)
16
16
  ast (2.3.0)
17
17
  byebug (9.0.6)
18
- concurrent-ruby (1.0.2)
19
- i18n (0.7.0)
18
+ concurrent-ruby (1.0.4)
19
+ i18n (0.8.0)
20
20
  mini_portile2 (2.1.0)
21
21
  minitest (5.9.1)
22
- nokogiri (1.6.8.1)
22
+ nokogiri (1.7.0.1)
23
23
  mini_portile2 (~> 2.1.0)
24
24
  parser (2.3.1.4)
25
25
  ast (~> 2.2)
@@ -22,11 +22,11 @@ class RIXML
22
22
  end
23
23
 
24
24
  def status
25
- @attrs.dig('Research', 'Product', 'StatusInfo', 'statusType')&.downcase&.to_sym || :published
25
+ current_status_info&.dig('statusType')&.downcase&.to_sym || :published
26
26
  end
27
27
 
28
28
  def publication_date
29
- time_str = @attrs.dig('Research', 'Product', 'StatusInfo', 'statusDateTime') || DateTime.now.to_s
29
+ time_str = current_status_info&.dig('statusDateTime') || DateTime.now.to_s
30
30
  DateTime.strptime(time_str)
31
31
  end
32
32
 
@@ -67,6 +67,12 @@ class RIXML
67
67
 
68
68
  private
69
69
 
70
+ def current_status_info
71
+ info = @attrs.dig('Research', 'Product', 'StatusInfo')
72
+ info = [info] unless info.is_a? Array
73
+ info.find { |status| status&.dig('currentStatusIndicator')&.downcase == 'yes' } || info.first
74
+ end
75
+
70
76
  def parse_info_from_author(author)
71
77
  person = author&.dig('Person')
72
78
  {
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'rixml'
4
- s.version = '0.1.3'
5
- s.date = '2016-12-07'
4
+ s.version = '0.1.5'
5
+ s.date = '2017-02-24'
6
6
  s.summary = 'RIXML Parser'
7
7
  s.description = 'Parse RIXML files'
8
8
  s.homepage = 'https://github.com/AlphaExchange/rixml'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rixml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Correia Santos
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-07 00:00:00.000000000 Z
12
+ date: 2017-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler