relaton-iso-bib 1.18.2 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +15 -22
- data/lib/relaton_iso_bib/document_type.rb +1 -1
- data/lib/relaton_iso_bib/iso_bibliographic_item.rb +0 -9
- data/lib/relaton_iso_bib/util.rb +1 -4
- data/lib/relaton_iso_bib/version.rb +1 -1
- data/lib/relaton_iso_bib.rb +0 -1
- data/relaton_iso_bib.gemspec +1 -1
- metadata +5 -6
- data/lib/relaton_iso_bib/config.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d11075e07bb8d16a20b5a1c9f980a858d8650f6cc249f34e92f33ad4ddd45e05
|
4
|
+
data.tar.gz: e74a8835551db834aa32e77eb64053f748f77b86537d9a9106d7781a24af0921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 970553f2568402967d1cea211101d388eef52201d193ef292c0a5d5c356e2aa490d1ef3a0c065dc1dc1ffbccb5f619d10da8cd024dadf18064cc4b30ce6fcd11
|
7
|
+
data.tar.gz: c0383507f0765c6f57e34218bde7d20e840b9a6a4236344a1a9eefd2a47a882fc4891e03815787f928f72ed5753632d09ebd8147b247ed0043e750043100b168
|
data/README.adoc
CHANGED
@@ -27,34 +27,23 @@ Or install it yourself as:
|
|
27
27
|
|
28
28
|
== Usage
|
29
29
|
|
30
|
-
===
|
31
|
-
|
32
|
-
Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonIsoBib.configure` block.
|
30
|
+
=== Create ISO bibliographic item
|
33
31
|
|
34
32
|
[source,ruby]
|
35
33
|
----
|
36
34
|
require 'relaton_iso_bib'
|
37
35
|
=> true
|
38
36
|
|
39
|
-
RelatonIsoBib.configure do |config|
|
40
|
-
config.logger.level = Logger::DEBUG
|
41
|
-
end
|
42
|
-
----
|
43
|
-
|
44
|
-
=== Create ISO bibliographic item
|
45
|
-
|
46
|
-
[source,ruby]
|
47
|
-
----
|
48
37
|
hash = YAML.load_file "spec/examples/iso_bib_item.yml"
|
49
38
|
=> {
|
50
|
-
"schema-version"=>"v1.0.
|
39
|
+
"schema-version"=>"v1.0.3",
|
51
40
|
"id"=>"ISO/TC211",
|
52
41
|
"title"=>[
|
53
42
|
{"type"=>"title-intro", "content"=>"Geographic information", "language"=>"en", "script"=>"Latn", "format"=>"text/plain"},
|
54
43
|
...
|
55
44
|
|
56
45
|
bib_hash = RelatonIsoBib::HashConverter.hash_to_bib hash
|
57
|
-
=> {:"schema-version"=>"v1.0.
|
46
|
+
=> {:"schema-version"=>"v1.0.3",
|
58
47
|
:id=>"ISO/TC211",
|
59
48
|
:fetched=>"2011-06-22",
|
60
49
|
:title=>
|
@@ -188,19 +177,19 @@ item.date
|
|
188
177
|
#<RelatonBib::BibliographicDate:0x00007ff76f161f70 @from=nil, @on="2014-04", @to=nil, @type="published">,
|
189
178
|
#<RelatonBib::BibliographicDate:0x00007ff76f1605f8 @from=nil, @on="2015-05-20", @to=nil, @type="accessed">]
|
190
179
|
|
191
|
-
item.date
|
180
|
+
item.date(type: "published").first.on
|
192
181
|
=> "2014-04"
|
193
182
|
|
194
|
-
item.date
|
183
|
+
item.date(type: "published").first.on :year
|
195
184
|
=> 2014
|
196
185
|
|
197
|
-
item.date
|
186
|
+
item.date(type: "published").first.on :month
|
198
187
|
=> 4
|
199
188
|
|
200
|
-
item.date
|
189
|
+
item.date(type: "published").first.on :day
|
201
190
|
=> nil
|
202
191
|
|
203
|
-
item.date
|
192
|
+
item.date(type: "published").first.on :date
|
204
193
|
=> #<Date: 2014-04-01 ((2456749j,0s,0n),+0s,2299161j)>
|
205
194
|
----
|
206
195
|
|
@@ -373,7 +362,7 @@ item.to_xml(bibdata: true)
|
|
373
362
|
<title type="title-part" format="text/plain" language="fr" script="Latn">Information géographique</title>
|
374
363
|
<title type="main" format="text/plain" language="fr" script="Latn">Information géographique – Métadonnées – Information géographique</title>
|
375
364
|
...
|
376
|
-
<ext schema-version="v1.0.
|
365
|
+
<ext schema-version="v1.0.3">
|
377
366
|
<doctype>international-standard</doctype>
|
378
367
|
...
|
379
368
|
</ext>
|
@@ -438,12 +427,12 @@ title.format:: text/plain
|
|
438
427
|
[source,ruby]
|
439
428
|
----
|
440
429
|
hash = YAML.load_file 'spec/examples/iso_bib_item.yml'
|
441
|
-
=> {"schema-version"=>"v1.0.
|
430
|
+
=> {"schema-version"=>"v1.0.3",
|
442
431
|
"id"=>"ISO/TC211",
|
443
432
|
...
|
444
433
|
|
445
434
|
bib_hash = RelatonIsoBib::HashConverter.hash_to_bib hash
|
446
|
-
=> {:"schema-version"=>"v1.0.
|
435
|
+
=> {:"schema-version"=>"v1.0.3",
|
447
436
|
:id=>"ISO/TC211",
|
448
437
|
...
|
449
438
|
|
@@ -452,6 +441,10 @@ RelatonIsoBib::IsoBibliographicItem.new **bib_hash
|
|
452
441
|
...
|
453
442
|
----
|
454
443
|
|
444
|
+
=== Logging
|
445
|
+
|
446
|
+
RelatonIsoBib uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
|
447
|
+
|
455
448
|
== BibliographicItem
|
456
449
|
|
457
450
|
The ISO standards use a subset of the generic bibliographic fields specified in the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model]:
|
@@ -6,15 +6,6 @@ require "relaton_iso_bib/structured_identifier"
|
|
6
6
|
require "relaton_iso_bib/ics"
|
7
7
|
require "relaton_iso_bib/hash_converter"
|
8
8
|
|
9
|
-
# Add filter method to Array.
|
10
|
-
class Array
|
11
|
-
# @param type [String]
|
12
|
-
# @return [Array]
|
13
|
-
def filter(type:)
|
14
|
-
select { |e| e.type == type }
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
9
|
module RelatonIsoBib
|
19
10
|
# Bibliographic item.
|
20
11
|
class IsoBibliographicItem < RelatonBib::BibliographicItem
|
data/lib/relaton_iso_bib/util.rb
CHANGED
data/lib/relaton_iso_bib.rb
CHANGED
data/relaton_iso_bib.gemspec
CHANGED
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: 1.
|
4
|
+
version: 1.19.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: 2024-
|
11
|
+
date: 2024-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: isoics
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.19.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.19.0
|
41
41
|
description: 'RelatonIsoBib: Ruby ISOXMLDOC impementation.'
|
42
42
|
email:
|
43
43
|
- open.source@ribose.com
|
@@ -63,7 +63,6 @@ files:
|
|
63
63
|
- grammars/relaton-iso-compile.rng
|
64
64
|
- grammars/relaton-iso.rng
|
65
65
|
- lib/relaton_iso_bib.rb
|
66
|
-
- lib/relaton_iso_bib/config.rb
|
67
66
|
- lib/relaton_iso_bib/document_type.rb
|
68
67
|
- lib/relaton_iso_bib/editorial_group.rb
|
69
68
|
- lib/relaton_iso_bib/hash_converter.rb
|
@@ -94,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
93
|
- !ruby/object:Gem::Version
|
95
94
|
version: '0'
|
96
95
|
requirements: []
|
97
|
-
rubygems_version: 3.3.
|
96
|
+
rubygems_version: 3.3.27
|
98
97
|
signing_key:
|
99
98
|
specification_version: 4
|
100
99
|
summary: 'RelatonIsoBib: Ruby ISOXMLDOC impementation.'
|