relaton-iso-bib 0.2.4 → 0.3.0
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 +3 -3
- data/README.adoc +7 -7
- data/lib/relaton_iso_bib/iso_bibliographic_item.rb +27 -27
- data/lib/relaton_iso_bib/version.rb +1 -1
- data/relaton_iso_bib.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: 2a8f8aa9ba99729a50ba5fc2eab63740b576628e
|
|
4
|
+
data.tar.gz: 247308010387c4838c56001b8efddad5fadde7fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2681d0833b05755f655a423675964f093120b3bec9c7cc59b0abddc91c6effa8b3a42c125d5fc6c7b715eec235002149ab426dce4fce52148967eee86f821e8c
|
|
7
|
+
data.tar.gz: 9647416af631193cfb4f82e8f9ccd62db863748a364b3cfe4f3842719923f24f24c863919182d780ee9569621a10053bf8e706e9ba8ade8af80d6e4835cc65d0
|
data/Gemfile.lock
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
relaton-iso-bib (0.
|
|
4
|
+
relaton-iso-bib (0.3.0)
|
|
5
5
|
isoics (~> 0.1.6)
|
|
6
|
-
relaton-bib (~> 0.
|
|
6
|
+
relaton-bib (~> 0.3.0)
|
|
7
7
|
ruby_deep_clone (~> 0.8.0)
|
|
8
8
|
|
|
9
9
|
GEM
|
|
@@ -34,7 +34,7 @@ GEM
|
|
|
34
34
|
pry (~> 0.10)
|
|
35
35
|
public_suffix (3.1.1)
|
|
36
36
|
rake (10.5.0)
|
|
37
|
-
relaton-bib (0.
|
|
37
|
+
relaton-bib (0.3.0)
|
|
38
38
|
addressable
|
|
39
39
|
nokogiri (~> 1.10)
|
|
40
40
|
rspec (3.8.0)
|
data/README.adoc
CHANGED
|
@@ -35,7 +35,7 @@ item = RelatonIsoBib::IsoBibliographicItem.new(
|
|
|
35
35
|
type: "sid", project_number: "ISO 1-2:2014", part: 2, subpart: 2,
|
|
36
36
|
),
|
|
37
37
|
docnumber: "123456",
|
|
38
|
-
|
|
38
|
+
title: [
|
|
39
39
|
{ title_intro: "Geographic information", title_main: "Metadata",
|
|
40
40
|
title_part: "Part 1: Fundamentals", language: "en", script: "Latn" },
|
|
41
41
|
{ title_intro: "Information géographique", title_main: "Métadonnées",
|
|
@@ -55,17 +55,17 @@ item = RelatonIsoBib::IsoBibliographicItem.new(
|
|
|
55
55
|
{ content: "L'ISO 19115-1:2014 définit le schéma requis pour ...",
|
|
56
56
|
language: "fr", script: "Latn", format: "text/plain" },
|
|
57
57
|
],
|
|
58
|
-
|
|
58
|
+
contributor: [
|
|
59
59
|
{ entity: { name: "International Organization for Standardization",
|
|
60
60
|
url: "www.iso.org", abbreviation: "ISO" },
|
|
61
|
-
|
|
61
|
+
role: ["publisher"] },
|
|
62
62
|
{
|
|
63
63
|
entity: RelatonBib::Person.new(
|
|
64
64
|
name: RelatonBib::FullName.new(
|
|
65
65
|
completename: RelatonBib::LocalizedString.new("John Smith"),
|
|
66
66
|
),
|
|
67
67
|
),
|
|
68
|
-
|
|
68
|
+
role: ["author"],
|
|
69
69
|
},
|
|
70
70
|
],
|
|
71
71
|
copyright: { owner: {
|
|
@@ -79,7 +79,7 @@ item = RelatonIsoBib::IsoBibliographicItem.new(
|
|
|
79
79
|
{ type: "rss", content: "https://www.iso.org/contents/data/standard"\
|
|
80
80
|
"/05/37/53798.detail.rss" },
|
|
81
81
|
],
|
|
82
|
-
|
|
82
|
+
relation: [
|
|
83
83
|
RelatonBib::DocumentRelation.new(
|
|
84
84
|
type: "updates",
|
|
85
85
|
bibitem: RelatonIsoBib::IsoBibliographicItem.new(
|
|
@@ -284,7 +284,7 @@ wg = item.editorialgroup
|
|
|
284
284
|
|
|
285
285
|
[source,ruby]
|
|
286
286
|
----
|
|
287
|
-
item.
|
|
287
|
+
item.relation
|
|
288
288
|
=> [#<RelatonBib::DocumentRelation:0x007fe5198cec80
|
|
289
289
|
@bib_locality=[#<RelatonBib::BibItemLocality:0x007fe5198cef78 @reference_from="Reference form", @reference_to=nil, @type="updates">],
|
|
290
290
|
@bibitem=
|
|
@@ -319,7 +319,7 @@ item.title(lang: "en")
|
|
|
319
319
|
item.shortref(item.structuredidentifier)
|
|
320
320
|
=> "ISO1-2014(allparts):2014: All Parts"
|
|
321
321
|
|
|
322
|
-
item.
|
|
322
|
+
item.relation.last.bibitem.title
|
|
323
323
|
=> [#<RelatonIsoBib::TypedTitleString:0x007fe51b293620
|
|
324
324
|
@title=#<RelatonBib::FormattedString:0x007fe51b293530 @content="Metadata", @format="text/plain", @language=["en"], @script=["Latn"]>,
|
|
325
325
|
@type="title-main">,
|
|
@@ -65,12 +65,12 @@ module RelatonIsoBib
|
|
|
65
65
|
# @param docid [Array<RelatonBib::DocumentIdentifier>]
|
|
66
66
|
# @param structuredidentifier [RelatonIsoBib::StructuredIdentifier]
|
|
67
67
|
#
|
|
68
|
-
# @param
|
|
69
|
-
# @option
|
|
70
|
-
# @option
|
|
71
|
-
# @option
|
|
72
|
-
# @option
|
|
73
|
-
# @option
|
|
68
|
+
# @param title [Array<Hash>]
|
|
69
|
+
# @option title [String] :title_intro
|
|
70
|
+
# @option title [String] :title_main
|
|
71
|
+
# @option title [String] :title_part
|
|
72
|
+
# @option title [String] :language
|
|
73
|
+
# @option title [String] :script
|
|
74
74
|
#
|
|
75
75
|
# @param editorialgroup [Hash, RelatonIsoBib::EditorialGroup]
|
|
76
76
|
# @option workgrpup [String] :name
|
|
@@ -86,10 +86,10 @@ module RelatonIsoBib
|
|
|
86
86
|
# @option ics [Integer] :group
|
|
87
87
|
# @option ics [Integer] :subgroup
|
|
88
88
|
#
|
|
89
|
-
# @param
|
|
90
|
-
# @option
|
|
91
|
-
# @option
|
|
92
|
-
# @option
|
|
89
|
+
# @param date [Array<Hash>]
|
|
90
|
+
# @option date [String] :type
|
|
91
|
+
# @option date [String] :from
|
|
92
|
+
# @option date [String] :to
|
|
93
93
|
#
|
|
94
94
|
# @param abstract [Array<Hash>]
|
|
95
95
|
# @option abstract [String] :content
|
|
@@ -97,12 +97,12 @@ module RelatonIsoBib
|
|
|
97
97
|
# @option abstract [String] :script
|
|
98
98
|
# @option abstract [String] :type
|
|
99
99
|
#
|
|
100
|
-
# @param
|
|
101
|
-
# @option
|
|
100
|
+
# @param contributor [Array<Hash>]
|
|
101
|
+
# @option contributor [Hash] :entity
|
|
102
102
|
# @option entity [String] :name
|
|
103
103
|
# @option entity [String] :url
|
|
104
104
|
# @option entity [String] :abbreviation
|
|
105
|
-
# @option
|
|
105
|
+
# @option contributor [Array<String>] :role
|
|
106
106
|
#
|
|
107
107
|
# @param copyright [Hash]
|
|
108
108
|
# @option copyright [Hash] :owner
|
|
@@ -112,14 +112,14 @@ module RelatonIsoBib
|
|
|
112
112
|
# @option copyright [String] :from
|
|
113
113
|
# @option copyright [String] :to
|
|
114
114
|
#
|
|
115
|
-
# @param link [Array<Hash,
|
|
115
|
+
# @param link [Array<Hash, RelatonBib::TypedUri>]
|
|
116
116
|
# @option link [String] :type
|
|
117
117
|
# @option link [String] :content
|
|
118
118
|
#
|
|
119
|
-
# @param
|
|
120
|
-
# @option
|
|
121
|
-
# @option
|
|
122
|
-
# @option
|
|
119
|
+
# @param relation [Array<Hash>]
|
|
120
|
+
# @option relation [String] :type
|
|
121
|
+
# @option relation [RelatonIsoBib::IsoBibliographicItem] :bibitem
|
|
122
|
+
# @option relation [Array<RelatonBib::BibItemLocality>] :bib_locality
|
|
123
123
|
#
|
|
124
124
|
# @raise [ArgumentError]
|
|
125
125
|
def initialize(**args)
|
|
@@ -128,14 +128,14 @@ module RelatonIsoBib
|
|
|
128
128
|
#check_script args.fetch(:script, [])
|
|
129
129
|
|
|
130
130
|
super_args = args.select do |k|
|
|
131
|
-
%i[id docnumber language script docstatus
|
|
132
|
-
edition version
|
|
131
|
+
%i[id docnumber language script docstatus date abstract contributor
|
|
132
|
+
edition version relation biblionote series medium place copyright
|
|
133
133
|
link fetched docid formattedref extent accesslocation classification
|
|
134
134
|
validity].include? k
|
|
135
135
|
end.merge(type: "standard")
|
|
136
136
|
super(super_args)
|
|
137
137
|
|
|
138
|
-
@title = args.fetch(:
|
|
138
|
+
@title = args.fetch(:title, []).reduce([]) do |a, t|
|
|
139
139
|
if t.is_a? Hash
|
|
140
140
|
a + typed_titles(t)
|
|
141
141
|
else
|
|
@@ -153,9 +153,9 @@ module RelatonIsoBib
|
|
|
153
153
|
@structuredidentifier = args[:structuredidentifier]
|
|
154
154
|
@doctype ||= args[:type]
|
|
155
155
|
@ics = args.fetch(:ics, []).map { |i| i.is_a?(Hash) ? Ics.new(i) : i }
|
|
156
|
-
@link = args.fetch(:link, []).map do |s|
|
|
157
|
-
|
|
158
|
-
end
|
|
156
|
+
# @link = args.fetch(:link, []).map do |s|
|
|
157
|
+
# s.is_a?(Hash) ? RelatonBib::TypedUri.new(s) : s
|
|
158
|
+
# end
|
|
159
159
|
@id_attribute = true
|
|
160
160
|
end
|
|
161
161
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
|
@@ -169,7 +169,7 @@ module RelatonIsoBib
|
|
|
169
169
|
def to_all_parts
|
|
170
170
|
me = DeepClone.clone(self)
|
|
171
171
|
me.disable_id_attribute
|
|
172
|
-
@
|
|
172
|
+
@relation << RelatonBib::DocumentRelation.new(
|
|
173
173
|
type: "partOf", bibitem: me,
|
|
174
174
|
)
|
|
175
175
|
@language.each do |l|
|
|
@@ -193,9 +193,9 @@ module RelatonIsoBib
|
|
|
193
193
|
def to_most_recent_reference
|
|
194
194
|
me = DeepClone.clone(self)
|
|
195
195
|
me.disable_id_attribute
|
|
196
|
-
@
|
|
196
|
+
@relation << RelatonBib::DocumentRelation.new(type: "instance", bibitem: me)
|
|
197
197
|
@abstract = []
|
|
198
|
-
@
|
|
198
|
+
@date = []
|
|
199
199
|
@docidentifier.each &:remove_date
|
|
200
200
|
@structuredidentifier&.remove_date
|
|
201
201
|
@id&.sub! /-[12]\d\d\d/, ""
|
data/relaton_iso_bib.gemspec
CHANGED
|
@@ -35,6 +35,6 @@ Gem::Specification.new do |spec|
|
|
|
35
35
|
spec.add_development_dependency "debase"
|
|
36
36
|
|
|
37
37
|
spec.add_dependency "isoics", "~> 0.1.6"
|
|
38
|
-
spec.add_dependency "relaton-bib", "~>0.
|
|
38
|
+
spec.add_dependency "relaton-bib", "~>0.3.0"
|
|
39
39
|
spec.add_dependency "ruby_deep_clone", "~> 0.8.0"
|
|
40
40
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-iso-bib
|
|
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-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -142,14 +142,14 @@ dependencies:
|
|
|
142
142
|
requirements:
|
|
143
143
|
- - "~>"
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 0.
|
|
145
|
+
version: 0.3.0
|
|
146
146
|
type: :runtime
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
150
|
- - "~>"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: 0.
|
|
152
|
+
version: 0.3.0
|
|
153
153
|
- !ruby/object:Gem::Dependency
|
|
154
154
|
name: ruby_deep_clone
|
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|