iso-bib-item 0.1.10 → 0.1.11
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 +4 -4
- data/Gemfile.lock +5 -5
- data/README.adoc +4 -4
- data/iso-bib-item.gemspec +2 -2
- data/lib/iso_bib_item/bibliographic_item.rb +1 -1
- data/lib/iso_bib_item/document_relation_collection.rb +1 -0
- data/lib/iso_bib_item/from_xml.rb +27 -0
- data/lib/iso_bib_item/iso_bibliographic_item.rb +6 -3
- data/lib/iso_bib_item/version.rb +1 -1
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35146363462622bb4a40fd392cd10ee47b411bbfee238108da476e365944f263
|
4
|
+
data.tar.gz: a1ed4d24e83c8ace967b7c38d4a745b160497744f43e956a5644610641d0eda5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b62d9e9c5aeab6ab50f62a2fd3f81b0e4d981034dd258cd05c15279be94afe4f410a99e1fbfd8fc028a7f596a4cf00e564d581b89c6ed0651244554e51d280e3
|
7
|
+
data.tar.gz: 69921f12e852458b2047f01825412e35228a4fcd9df581b30b6ec82d1bb4755f152bca5aedde1a3cbdfaa360eeed031bb0f6f52b18c95a4e0b507d077d5ef811
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
iso-bib-item (0.1.
|
5
|
-
duplicate
|
4
|
+
iso-bib-item (0.1.11)
|
6
5
|
isoics (~> 0.1.6)
|
7
|
-
nokogiri
|
6
|
+
nokogiri (~> 1.8.4)
|
7
|
+
ruby_deep_clone (~> 0.8.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -13,14 +13,13 @@ GEM
|
|
13
13
|
coderay (1.1.2)
|
14
14
|
diff-lcs (1.3)
|
15
15
|
docile (1.3.1)
|
16
|
-
duplicate (1.1.1)
|
17
16
|
equivalent-xml (0.6.0)
|
18
17
|
nokogiri (>= 1.4.3)
|
19
18
|
isoics (0.1.6)
|
20
19
|
json (2.1.0)
|
21
20
|
method_source (0.9.0)
|
22
21
|
mini_portile2 (2.3.0)
|
23
|
-
nokogiri (1.8.
|
22
|
+
nokogiri (1.8.4)
|
24
23
|
mini_portile2 (~> 2.3.0)
|
25
24
|
pry (0.11.3)
|
26
25
|
coderay (~> 1.1.0)
|
@@ -42,6 +41,7 @@ GEM
|
|
42
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
43
42
|
rspec-support (~> 3.7.0)
|
44
43
|
rspec-support (3.7.1)
|
44
|
+
ruby_deep_clone (0.8.0)
|
45
45
|
simplecov (0.16.1)
|
46
46
|
docile (~> 1.1)
|
47
47
|
json (>= 1.8, < 3)
|
data/README.adoc
CHANGED
@@ -76,7 +76,7 @@ item = IsoBibItem::IsoBibliographicItem.new(
|
|
76
76
|
}
|
77
77
|
],
|
78
78
|
copyright: { owner: { name: "ISO" }, from: "2014" },
|
79
|
-
|
79
|
+
link: [
|
80
80
|
{ type: "src", content: "https://www.iso.org/standard/53798.html" },
|
81
81
|
{ type: "obp", content: "https://www.iso.org/obp/ui/#!iso:std:53798:en" },
|
82
82
|
{ type: "rss", content: "https://www.iso.org/contents/data/standard/05/37/53798.detail.rss" }
|
@@ -278,9 +278,9 @@ item.to_xml
|
|
278
278
|
=>"<bibitem type='international-standard' id='ISO19115-1'>
|
279
279
|
<title format='text/plain' language='en' script='Latn'>Geographic information -- Metadata -- Part 1: Fundamentals</title>
|
280
280
|
<title format='text/plain' language='fr' script='Latn'>Information géographique -- Métadonnées -- Partie 1: Principes de base</title>
|
281
|
-
<
|
282
|
-
<
|
283
|
-
<
|
281
|
+
<link type='src'>https://www.iso.org/standard/53798.html</link>
|
282
|
+
<link type='obp'>https://www.iso.org/obp/ui/#!iso:std:53798:en</link>
|
283
|
+
<link type='rss'>https://www.iso.org/contents/data/standard/05/37/53798.detail.rss</link>
|
284
284
|
<docidentifier>ISO 19115-1</docidentifier>
|
285
285
|
<date type='published'>
|
286
286
|
<on>2014</on>
|
data/iso-bib-item.gemspec
CHANGED
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
31
31
|
|
32
32
|
spec.add_dependency 'isoics', '~> 0.1.6'
|
33
|
-
spec.add_dependency 'nokogiri'
|
34
|
-
spec.add_dependency '
|
33
|
+
spec.add_dependency 'nokogiri', "~> 1.8.4"
|
34
|
+
spec.add_dependency 'ruby_deep_clone', "~> 0.8.0"
|
35
35
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
module IsoBibItem
|
3
|
+
class << self
|
4
|
+
def from_xml(doc)
|
5
|
+
xml = Nokogiri::XML(doc)
|
6
|
+
IsoBibliographicItem.new(
|
7
|
+
=begin
|
8
|
+
docid: fetch_docid(doc),
|
9
|
+
edition: edition,
|
10
|
+
language: langs(doc).map { |l| l[:lang] },
|
11
|
+
script: langs(doc).map { |l| script(l[:lang]) }.uniq,
|
12
|
+
titles: titles,
|
13
|
+
type: fetch_type(hit_data['title']),
|
14
|
+
docstatus: fetch_status(doc, hit_data['status']),
|
15
|
+
ics: fetch_ics(doc),
|
16
|
+
dates: fetch_dates(doc),
|
17
|
+
contributors: fetch_contributors(hit_data['title']),
|
18
|
+
workgroup: fetch_workgroup(doc),
|
19
|
+
abstract: abstract,
|
20
|
+
copyright: fetch_copyright(hit_data['title'], doc),
|
21
|
+
link: fetch_link(doc, url),
|
22
|
+
relations: fetch_relations(doc)
|
23
|
+
=end
|
24
|
+
)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
require 'nokogiri'
|
4
4
|
require 'isoics'
|
5
|
-
require '
|
5
|
+
require 'deep_clone'
|
6
6
|
require 'iso_bib_item/bibliographic_item'
|
7
7
|
require 'iso_bib_item/iso_document_status'
|
8
8
|
require 'iso_bib_item/iso_localized_title'
|
9
9
|
require 'iso_bib_item/iso_project_group'
|
10
10
|
require 'iso_bib_item/document_relation_collection'
|
11
|
+
require 'iso_bib_item/from_xml'
|
11
12
|
|
12
13
|
# Add filter method to Array.
|
13
14
|
class Array
|
@@ -142,7 +143,8 @@ module IsoBibItem
|
|
142
143
|
# convert ISO nnn-1 reference into an All Parts reference:
|
143
144
|
# remove title part components and abstract
|
144
145
|
def to_all_parts
|
145
|
-
me = Duplicate.duplicate(self)
|
146
|
+
#me = Duplicate.duplicate(self)
|
147
|
+
me = DeepClone.clone(self)
|
146
148
|
me.disable_id_attribute
|
147
149
|
@relations << DocumentRelation.new(type: "partOf", identifier: nil, url: nil, bibitem: me)
|
148
150
|
|
@@ -157,7 +159,8 @@ module IsoBibItem
|
|
157
159
|
# date of publication, abstracts. Make dated reference Instance relation
|
158
160
|
# of the redacated document
|
159
161
|
def to_most_recent_reference
|
160
|
-
me = Duplicate.duplicate(self)
|
162
|
+
#me = Duplicate.duplicate(self)
|
163
|
+
me = DeepClone.clone(self)
|
161
164
|
me.disable_id_attribute
|
162
165
|
@relations << DocumentRelation.new(type: "instance", identifier: nil, url: nil, bibitem: me)
|
163
166
|
@abstract = []
|
data/lib/iso_bib_item/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso-bib-item
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
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-07-
|
11
|
+
date: 2018-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -112,30 +112,30 @@ dependencies:
|
|
112
112
|
name: nokogiri
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 1.8.4
|
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: 1.8.4
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: ruby_deep_clone
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 0.8.0
|
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:
|
138
|
+
version: 0.8.0
|
139
139
|
description: 'IsoBibItem: Ruby ISOXMLDOC impementation.'
|
140
140
|
email:
|
141
141
|
- open.source@ribose.com
|
@@ -163,6 +163,7 @@ files:
|
|
163
163
|
- lib/iso_bib_item/document_relation_collection.rb
|
164
164
|
- lib/iso_bib_item/document_status.rb
|
165
165
|
- lib/iso_bib_item/formatted_string.rb
|
166
|
+
- lib/iso_bib_item/from_xml.rb
|
166
167
|
- lib/iso_bib_item/iso_bibliographic_item.rb
|
167
168
|
- lib/iso_bib_item/iso_document_status.rb
|
168
169
|
- lib/iso_bib_item/iso_localized_title.rb
|