iecbib 0.2.0 → 0.2.1

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: 734a19a758fa1e66bd77553d4d0112fe916d020e3e767c98a834ea279e97f5e3
4
- data.tar.gz: ce07f84366f28b2f3d43ea477b7810024da673783fef07636ad28f25da8efcf1
3
+ metadata.gz: 8ed23406ac6281c063eeb14f712e1a3bc26a16d989a437c762076c376df40d30
4
+ data.tar.gz: 1bbba4f22b5d531789c57f550d6b8acdbe5ef70a7e04d047925908bd75c9f7ce
5
5
  SHA512:
6
- metadata.gz: 96b342ed0b6c2dde9319a5580553609ccc5a1637273e50f01e22ee1c0b0e1f2319004b9e1ebe203fb9886b8c0782fe6c18ff3d1b346a9217b1464b3e1185bfa9
7
- data.tar.gz: 258909fd3da87275d645480d685ef3ae60bdf41e4648fd33e9f8503eb0bd0399242d60e3bae7e3dfe9ad598e0e230bde8481b409cb4c5a2030bb7049382a576e
6
+ metadata.gz: d71c2f4ae19b8d2571f0c07d0d301ed69970d703f2dfb75b7ea68b13b1e72b3f291b7d48f96068956a9b138421bcc7c70c0dbe47100ab1159fca172005f0df38
7
+ data.tar.gz: f8533167f7cfb28d89cf8f3833b8c1fba2470509b93374910a7bdc7985300d0f1d26016e05f3a8fbca79a59fc6ec3a5d343365a70883235df9645cf69a2ff641
data/.travis.yml CHANGED
@@ -1,5 +1,14 @@
1
1
  sudo: false
2
2
  language: ruby
3
+
3
4
  rvm:
4
- - 2.4.0
5
+ - 2.5
6
+ - 2.4
7
+ - 2.3
8
+ - ruby-head
9
+
5
10
  before_install: gem install bundler -v 1.16.1
11
+
12
+ matrix:
13
+ allow_failures:
14
+ - rvm: ruby-head
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- iecbib (0.2.0)
4
+ iecbib (0.2.1)
5
5
  addressable
6
- iso-bib-item (~> 0.4.0)
6
+ iso-bib-item (~> 0.4.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -19,7 +19,7 @@ GEM
19
19
  equivalent-xml (0.6.0)
20
20
  nokogiri (>= 1.4.3)
21
21
  hashdiff (0.3.7)
22
- iso-bib-item (0.4.0)
22
+ iso-bib-item (0.4.2)
23
23
  isoics (~> 0.1.6)
24
24
  nokogiri (~> 1.8.4)
25
25
  ruby_deep_clone (~> 0.8.0)
data/README.adoc CHANGED
@@ -44,8 +44,8 @@ This gem retrieves bibliographic descriptions of ISO documents by doing searches
44
44
 
45
45
  == Contributing
46
46
 
47
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/iecbib.
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/riboseinc/iecbib.
48
48
 
49
49
  == License
50
50
 
51
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
51
+ The gem is available as open source under the terms of the https://opensource.org/licenses/MIT[MIT License].
data/iecbib.gemspec CHANGED
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'vcr'
33
33
  spec.add_development_dependency 'webmock'
34
34
 
35
- spec.add_dependency 'iso-bib-item', '~> 0.4.0'
35
+ spec.add_dependency 'iso-bib-item', '~> 0.4.2'
36
36
  spec.add_dependency 'addressable'
37
37
  end
@@ -3,6 +3,7 @@
3
3
  # require 'isobib/iso_bibliographic_item'
4
4
  require 'iecbib/scrapper'
5
5
  require 'iecbib/hit_collection'
6
+ require "date"
6
7
 
7
8
  module Iecbib
8
9
  # Class methods for search ISO standards.
@@ -76,6 +77,7 @@ module Iecbib
76
77
  def iev(code = "IEC 60050")
77
78
  IsoBibItem::XMLParser.from_xml(<<~"END")
78
79
  <bibitem type="international-standard" id="IEV">
80
+ <fetched>#{Date.today.to_s}</fetched>
79
81
  <title format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary</title>
80
82
  <link type="src">http://www.electropedia.org</link>
81
83
  <docidentifier>#{code}:2011</docidentifier>
@@ -378,13 +378,18 @@ module Iecbib
378
378
  # @param title [String]
379
379
  # @return [Hash]
380
380
  def fetch_copyright(code, doc)
381
- owner_name = code.match(/.*?(?=\s)/).to_s
381
+ abbreviation = code.match(/.*?(?=\s)/).to_s
382
+ case abbreviation
383
+ when 'IEC'
384
+ name = 'International Electrotechnical Commission'
385
+ url = 'www.iec.ch'
386
+ end
382
387
  from = code.match(/(?<=:)\d{4}/).to_s
383
388
  if from.empty?
384
389
  from = doc.xpath("//span[@itemprop='releaseDate']").text
385
390
  .match(/\d{4}/).to_s
386
391
  end
387
- { owner: { name: owner_name }, from: from }
392
+ { owner: { name: name, abbreviation: abbreviation, url: url }, from: from }
388
393
  end
389
394
  end
390
395
  end
@@ -1,3 +1,3 @@
1
1
  module Iecbib
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
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.2.0
4
+ version: 0.2.1
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-10-16 00:00:00.000000000 Z
11
+ date: 2018-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.4.0
131
+ version: 0.4.2
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.4.0
138
+ version: 0.4.2
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: addressable
141
141
  requirement: !ruby/object:Gem::Requirement