iecbib 0.1.1 → 0.1.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
  SHA256:
3
- metadata.gz: 26a37510b59074822007109b47913b77db41dc9caea1c15f6f4392f5ff092d77
4
- data.tar.gz: f220aca85402102dfebf9c1a2b3904a20c3ba45e6e436d02e25c424281e15788
3
+ metadata.gz: feecc825cdc434c2f25252e3f5ef250ab76698d19eefba1a64cd88dc37706239
4
+ data.tar.gz: c72f802c87d13f1dc07e9ceac088efd43260cd84c445ca591f575355cf15e13b
5
5
  SHA512:
6
- metadata.gz: 18a68279b7bc1cdf52b55c365fb3bb57f048af3ecc4525205ac160627a8172e2b085ae980940091787582d0c0504eddc1d377c213128bd4281fb0677d47a23bd
7
- data.tar.gz: 7047b8f2a1d1344528c6ba51c978becc44db6418354960daf7d9155c6076f1c5da9c4e4605cfdc9e3989be8ee4486e2f74cbf742c8b45d075093c8c4df839a3b
6
+ metadata.gz: 943b393a77f6966f666ae8f0aef6508dc89d80442541d24a56db40ad04aa811d3c68f34313365e1e85c231a632908c0576d88c70e394bb7e6f3eedc6f2a8a127
7
+ data.tar.gz: d36bf454ee3a68f7486f0b9a2e343651e5fc61632c2bfb54ebf79986f77b59c7ac0281831e142e208c8396a61749a28ac7089a2ca6d6686eadd71769b77b3fe6
data/Gemfile.lock CHANGED
@@ -2,6 +2,7 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  iecbib (0.1.1)
5
+ addressable
5
6
  iso-bib-item (~> 0.3.0)
6
7
 
7
8
  GEM
@@ -18,7 +19,7 @@ GEM
18
19
  equivalent-xml (0.6.0)
19
20
  nokogiri (>= 1.4.3)
20
21
  hashdiff (0.3.7)
21
- iso-bib-item (0.3.0)
22
+ iso-bib-item (0.3.1)
22
23
  isoics (~> 0.1.6)
23
24
  nokogiri (~> 1.8.4)
24
25
  ruby_deep_clone (~> 0.8.0)
data/iecbib.gemspec CHANGED
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'webmock'
34
34
 
35
35
  spec.add_dependency 'iso-bib-item', '~> 0.3.0'
36
+ spec.add_dependency 'addressable'
36
37
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'iecbib/hit'
4
+ require "addressable/uri"
4
5
 
5
6
  module Iecbib
6
7
  # Page of hit collection.
@@ -28,7 +29,7 @@ module Iecbib
28
29
  to = from.next_year.prev_day
29
30
  end
30
31
  url = "#{DOMAIN}/searchkey&RefNbr=#{ref_nbr}&From=#{from}&To=#{to}&start=1"
31
- doc = Nokogiri::HTML OpenURI.open_uri(Addressable::URI.parse(url).normalize)
32
+ doc = Nokogiri::HTML OpenURI.open_uri(::Addressable::URI.parse(url).normalize)
32
33
  hits = doc.css('ul.search-results > li').map do |h|
33
34
  link = h.at('a[@href!="#"]')
34
35
  code = link.text.tr [194, 160].pack('c*').force_encoding('UTF-8'), ''
@@ -29,9 +29,9 @@ module Iecbib
29
29
  code += '-1' if opts[:all_parts]
30
30
  ret = iecbib_get1(code, year, opts)
31
31
  return nil if ret.nil?
32
- ret.to_most_recent_reference unless year
32
+ ret.to_most_recent_reference unless year || opts[:keep_year]
33
33
  ret.to_all_parts if opts[:all_parts]
34
- ret # .to_xml
34
+ ret
35
35
  end
36
36
 
37
37
  private
@@ -1,3 +1,3 @@
1
1
  module Iecbib
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iecbib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-19 00:00:00.000000000 Z
11
+ date: 2018-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.3.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: addressable
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: 'IsoBib: retrieve ISO Standards for bibliographic use using the BibliographicItem
140
154
  model'
141
155
  email: