iecbib 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -1
- data/Gemfile.lock +3 -3
- data/README.adoc +2 -2
- data/iecbib.gemspec +1 -1
- data/lib/iecbib/iec_bibliography.rb +2 -0
- data/lib/iecbib/scrapper.rb +7 -2
- data/lib/iecbib/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ed23406ac6281c063eeb14f712e1a3bc26a16d989a437c762076c376df40d30
|
4
|
+
data.tar.gz: 1bbba4f22b5d531789c57f550d6b8acdbe5ef70a7e04d047925908bd75c9f7ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d71c2f4ae19b8d2571f0c07d0d301ed69970d703f2dfb75b7ea68b13b1e72b3f291b7d48f96068956a9b138421bcc7c70c0dbe47100ab1159fca172005f0df38
|
7
|
+
data.tar.gz: f8533167f7cfb28d89cf8f3833b8c1fba2470509b93374910a7bdc7985300d0f1d26016e05f3a8fbca79a59fc6ec3a5d343365a70883235df9645cf69a2ff641
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
iecbib (0.2.
|
4
|
+
iecbib (0.2.1)
|
5
5
|
addressable
|
6
|
-
iso-bib-item (~> 0.4.
|
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.
|
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/
|
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
|
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.
|
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>
|
data/lib/iecbib/scrapper.rb
CHANGED
@@ -378,13 +378,18 @@ module Iecbib
|
|
378
378
|
# @param title [String]
|
379
379
|
# @return [Hash]
|
380
380
|
def fetch_copyright(code, doc)
|
381
|
-
|
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:
|
392
|
+
{ owner: { name: name, abbreviation: abbreviation, url: url }, from: from }
|
388
393
|
end
|
389
394
|
end
|
390
395
|
end
|
data/lib/iecbib/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
138
|
+
version: 0.4.2
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: addressable
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|