gbbib 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/Gemfile.lock +3 -3
- data/gbbib.gemspec +1 -1
- data/lib/gbbib/scrapper.rb +6 -3
- data/lib/gbbib/version.rb +1 -1
- data/lib/relaton/processor.rb +2 -2
- 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: 76d8a97d0f8f27e188045a0ade66539907128459ef7c4ca8a25c3a588f3d174c
|
4
|
+
data.tar.gz: e017d5d7c24ea899336d206e5499659d6fe022386879bafdebe8d6b10a8a0206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d373bb28e44d4e59ac060c4e7b39a353fa493ba825527b593f7dc461840b03e93e9b188d7ad0d7b2e436e172a0e8700948981354b5cec8cd5cafb996bf0b4f3f
|
7
|
+
data.tar.gz: 82220a39f925bb98e861a6876573cc918f36bd0f984697ca483f41d093777c1f1f65d1c1cda2d884f9efca77d970615f605be3f2e23dd8deb3b975ae09cffcb2
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gbbib (0.
|
4
|
+
gbbib (0.3.0)
|
5
5
|
cnccs (~> 0.1.1)
|
6
6
|
gb-agencies (~> 0.0.1)
|
7
|
-
iso-bib-item (~> 0.
|
7
|
+
iso-bib-item (~> 0.3.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
equivalent-xml (0.6.0)
|
18
18
|
nokogiri (>= 1.4.3)
|
19
19
|
gb-agencies (0.0.3)
|
20
|
-
iso-bib-item (0.
|
20
|
+
iso-bib-item (0.3.0)
|
21
21
|
isoics (~> 0.1.6)
|
22
22
|
nokogiri (~> 1.8.4)
|
23
23
|
ruby_deep_clone (~> 0.8.0)
|
data/gbbib.gemspec
CHANGED
@@ -31,6 +31,6 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
32
32
|
|
33
33
|
spec.add_dependency 'cnccs', "~> 0.1.1"
|
34
|
-
spec.add_dependency 'iso-bib-item', "~> 0.
|
34
|
+
spec.add_dependency 'iso-bib-item', "~> 0.3.0"
|
35
35
|
spec.add_dependency 'gb-agencies', "~> 0.0.1"
|
36
36
|
end
|
data/lib/gbbib/scrapper.rb
CHANGED
@@ -37,9 +37,12 @@ module Gbbib
|
|
37
37
|
# * :project_number [String]
|
38
38
|
# * :part_number [String]
|
39
39
|
def get_docid(doc, xpt = '//dt[text()="标准号"]/following-sibling::dd[1]')
|
40
|
-
item_ref = doc.xpath(xpt)
|
40
|
+
item_ref = doc.xpath(xpt) or
|
41
|
+
return { project_number: "?", part_number: "?", prefix: nil, id: "?" }
|
42
|
+
m = item_ref.text.match(/^([^–—.-]*\d+)\.?((?<=\.)\d+|)/)
|
41
43
|
#prefix = doc.xpath(xpt).text.match(/^[^\s]+/).to_s
|
42
|
-
{ project_number:
|
44
|
+
{ project_number: m[1], part_number: m[2], prefix: nil,
|
45
|
+
id: item_ref.text, type: "Chinese Standard" }
|
43
46
|
end
|
44
47
|
|
45
48
|
def get_contributors(doc, xpt = '//dt[text()="标准号"]/following-sibling::dd[1]')
|
@@ -54,7 +57,7 @@ module Gbbib
|
|
54
57
|
]
|
55
58
|
[{ entity: entity, roles: ['publisher'] }]
|
56
59
|
end
|
57
|
-
|
60
|
+
|
58
61
|
|
59
62
|
# @param doc [Nokogiri::HTML::Document]
|
60
63
|
# @return [Array<Hash>]
|
data/lib/gbbib/version.rb
CHANGED
data/lib/relaton/processor.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gbbib
|
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: 2018-
|
11
|
+
date: 2018-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 0.3.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 0.3.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: gb-agencies
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|