relaton-nist 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -3
- data/lib/relaton_nist/hit_collection.rb +1 -0
- data/lib/relaton_nist/nist_bibliographic_item.rb +14 -14
- data/lib/relaton_nist/nist_bibliography.rb +3 -3
- data/lib/relaton_nist/scrapper.rb +9 -9
- data/lib/relaton_nist/version.rb +1 -1
- data/relaton_nist.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 860bed641e26ef2dd9e431c754d38d0dffb81a69
|
4
|
+
data.tar.gz: e7a3cddcdab9e27866ff220374bd73d6f3253b0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8afdc827eaa9d984bf344138f7965099fbb7ec717cb283f2ab5d5cfa2feb910432f26fd1d22608c9de3e3364d8706acbb0d55419382808610e050c40a35065e9
|
7
|
+
data.tar.gz: 01e02e9dfd1b33d0ed24ae1b7f8181637c77ed7694fc725092882ca327044219bc8871a70999808bcd4c93890994cf39705ea43d9b48059357265b3099e1c88e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
relaton-nist (0.
|
5
|
-
relaton-bib (~> 0.
|
4
|
+
relaton-nist (0.3.0)
|
5
|
+
relaton-bib (~> 0.3.0)
|
6
6
|
rubyzip
|
7
7
|
|
8
8
|
GEM
|
@@ -35,7 +35,7 @@ GEM
|
|
35
35
|
pry (~> 0.10)
|
36
36
|
public_suffix (3.1.1)
|
37
37
|
rake (10.5.0)
|
38
|
-
relaton-bib (0.
|
38
|
+
relaton-bib (0.3.0)
|
39
39
|
addressable
|
40
40
|
nokogiri (~> 1.10)
|
41
41
|
rspec (3.8.0)
|
@@ -33,17 +33,17 @@ module RelatonNist
|
|
33
33
|
# @param keyword [Array<RelatonNist::Keyword>]
|
34
34
|
# @param commentperiod [RelatonNist::CommentPeriod]
|
35
35
|
#
|
36
|
-
# @param
|
37
|
-
# @option
|
38
|
-
# @option
|
39
|
-
# @option
|
36
|
+
# @param date [Array<Hash>]
|
37
|
+
# @option date [String] :type
|
38
|
+
# @option date [String] :from
|
39
|
+
# @option date [String] :to
|
40
40
|
#
|
41
|
-
# @param
|
42
|
-
# @option
|
43
|
-
# @option
|
44
|
-
# @option
|
45
|
-
# @option
|
46
|
-
# @option
|
41
|
+
# @param contributor [Array<Hash>]
|
42
|
+
# @option contributor [String] :type
|
43
|
+
# @option contributor [String] :from
|
44
|
+
# @option contributor [String] :to
|
45
|
+
# @option contributor [String] :abbreviation
|
46
|
+
# @option contributor [Array<String>] :role
|
47
47
|
#
|
48
48
|
# @param abstract [Array<Hash>]
|
49
49
|
# @option abstract [String] :content
|
@@ -51,10 +51,10 @@ module RelatonNist
|
|
51
51
|
# @option abstract [String] :script
|
52
52
|
# @option abstract [String] :type
|
53
53
|
#
|
54
|
-
# @param
|
55
|
-
# @option
|
56
|
-
# @option
|
57
|
-
# @option
|
54
|
+
# @param relation [Array<Hash>]
|
55
|
+
# @option relation [String] :type
|
56
|
+
# @option relation [RelatonBib::BibliographicItem] :bibitem
|
57
|
+
# @option relation [Array<RelatonBib::BibItemLocality>] :bib_locality
|
58
58
|
def initialize(**args)
|
59
59
|
@doctype = args.delete(:doctype) || "standard"
|
60
60
|
@keyword = args.delete(:keyword) || []
|
@@ -91,16 +91,16 @@ module RelatonNist
|
|
91
91
|
result.each_slice(3) do |s| # ISO website only allows 3 connections
|
92
92
|
fetch_pages(s, 3).each_with_index do |r, _i|
|
93
93
|
if opts[:issued_date]
|
94
|
-
ids = r.
|
94
|
+
ids = r.date.select { |d| d.type == "issued" && d.on == opts[:issued_date] }
|
95
95
|
next if ids.empty?
|
96
96
|
elsif opts[:updated_date]
|
97
|
-
pds = r.
|
97
|
+
pds = r.date.select { |d| d.type == "published" && d.on == opts[:updated_date] }
|
98
98
|
next if pds.empty?
|
99
99
|
end
|
100
100
|
next if iter && r.status.iteration != iteration
|
101
101
|
return { ret: r } if !year
|
102
102
|
|
103
|
-
r.
|
103
|
+
r.date.select { |d| d.type == "published" }.each do |d|
|
104
104
|
return { ret: r } if year.to_i == d.on.year
|
105
105
|
|
106
106
|
missed_years << d.on.year
|
@@ -26,7 +26,7 @@ module RelatonNist
|
|
26
26
|
end
|
27
27
|
item_data[:fetched] = Date.today.to_s
|
28
28
|
item_data[:type] = "standard"
|
29
|
-
item_data[:
|
29
|
+
item_data[:title] = titles
|
30
30
|
item_data[:doctype] = doctype
|
31
31
|
|
32
32
|
NistBibliographicItem.new(**item_data)
|
@@ -39,15 +39,15 @@ module RelatonNist
|
|
39
39
|
{
|
40
40
|
link: fetch_link(json),
|
41
41
|
docid: fetch_docid(json["docidentifier"]),
|
42
|
-
|
43
|
-
|
42
|
+
date: fetch_dates(json, hit_data[:release_date]),
|
43
|
+
contributor: fetch_contributors(json),
|
44
44
|
edition: fetch_edition(json),
|
45
45
|
language: [json["language"]],
|
46
46
|
script: [json["script"]],
|
47
47
|
# abstract: fetch_abstract(doc),
|
48
48
|
docstatus: fetch_status(json, hit_data[:status]),
|
49
49
|
copyright: fetch_copyright(json["published-date"]),
|
50
|
-
|
50
|
+
relation: fetch_relations_json(json),
|
51
51
|
# series: fetch_series(json),
|
52
52
|
keyword: fetch_keywords(json),
|
53
53
|
commentperiod: fetch_commentperiod_json(json),
|
@@ -60,15 +60,15 @@ module RelatonNist
|
|
60
60
|
# id: fetch_id(doc),
|
61
61
|
link: fetch_link(doc),
|
62
62
|
docid: fetch_docid(doc),
|
63
|
-
|
64
|
-
|
63
|
+
date: fetch_dates(doc, hit_data[:release_date]),
|
64
|
+
contributor: fetch_contributors(doc),
|
65
65
|
edition: fetch_edition(hit_data[:code]),
|
66
66
|
language: ["en"],
|
67
67
|
script: ["Latn"],
|
68
68
|
abstract: fetch_abstract(doc),
|
69
69
|
docstatus: fetch_status(doc, hit_data[:status]),
|
70
70
|
copyright: fetch_copyright(doc),
|
71
|
-
|
71
|
+
relation: fetch_relations(doc),
|
72
72
|
series: fetch_series(doc),
|
73
73
|
keyword: fetch_keywords(doc),
|
74
74
|
commentperiod: fetch_commentperiod(doc),
|
@@ -285,8 +285,8 @@ module RelatonNist
|
|
285
285
|
def full_name(name, lang, script)
|
286
286
|
RelatonBib::FullName.new(
|
287
287
|
surname: RelatonBib::LocalizedString.new(name["surname"], lang, script),
|
288
|
-
|
289
|
-
|
288
|
+
forename: name_parts(name["givenName"], lang, script),
|
289
|
+
addition: name_parts(name["suffix"], lang, script),
|
290
290
|
prefix: name_parts(name["title"], lang, script),
|
291
291
|
completename: RelatonBib::LocalizedString.new(name["fullName"], lang, script),
|
292
292
|
)
|
data/lib/relaton_nist/version.rb
CHANGED
data/relaton_nist.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-nist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.
|
173
|
+
version: 0.3.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
180
|
+
version: 0.3.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rubyzip
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|