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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3772db04334749e7660ad48d85986192d3fa3f12fa0a13ace255750c49bf46ff
4
- data.tar.gz: e5960422e57fff1057e0caf7dfcb53ad7d03efa4a3c9cf865b117dd5d9e45afc
3
+ metadata.gz: d11075e07bb8d16a20b5a1c9f980a858d8650f6cc249f34e92f33ad4ddd45e05
4
+ data.tar.gz: e74a8835551db834aa32e77eb64053f748f77b86537d9a9106d7781a24af0921
5
5
  SHA512:
6
- metadata.gz: d90be3009cb539fd5f8e4859e648a9a419510b594295ca6d0a7ed538428456eb39571ec516da73c5a9844d36b6e9521185ca70606a08016f5572a9bdf94f6fed
7
- data.tar.gz: 2aa5a4573faf9422cd9ffe67259d346e835b1d7440b219239610e159521b22624d844b461f4c7c8eb95dea8b210873f8527dfff2b8d3b38cbb39aacd5bde6b48
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
- === Configuration
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.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.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.filter(type: "published").first.on
180
+ item.date(type: "published").first.on
192
181
  => "2014-04"
193
182
 
194
- item.date.filter(type: "published").first.on :year
183
+ item.date(type: "published").first.on :year
195
184
  => 2014
196
185
 
197
- item.date.filter(type: "published").first.on :month
186
+ item.date(type: "published").first.on :month
198
187
  => 4
199
188
 
200
- item.date.filter(type: "published").first.on :day
189
+ item.date(type: "published").first.on :day
201
190
  => nil
202
191
 
203
- item.date.filter(type: "published").first.on :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.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.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.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]:
@@ -24,7 +24,7 @@ module RelatonIsoBib
24
24
  #
25
25
  def check_doctype(type)
26
26
  unless DOCTYPES.include? type
27
- Util.warn "WARNING: invalid doctype: `#{type}`"
27
+ Util.warn "Invalid doctype: `#{type}`"
28
28
  Util.warn "Allowed doctypes are: `#{DOCTYPES.join('`, `')}`"
29
29
  end
30
30
  end
@@ -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
@@ -1,9 +1,6 @@
1
1
  module RelatonIsoBib
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonIsoBib.configuration.logger
7
- end
4
+ PROGNAME = "relaton-iso-bib".freeze
8
5
  end
9
6
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIsoBib
2
- VERSION = "1.18.2".freeze
2
+ VERSION = "1.19.0".freeze
3
3
  end
@@ -2,7 +2,6 @@ require "nokogiri"
2
2
  require "isoics"
3
3
  require "relaton_bib"
4
4
  require "relaton_iso_bib/version"
5
- require "relaton_iso_bib/config"
6
5
  require "relaton_iso_bib/util"
7
6
  require "relaton_iso_bib/document_type"
8
7
  require "relaton_iso_bib/iso_bibliographic_item"
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
28
28
 
29
29
  spec.add_dependency "isoics", "~> 0.1.6"
30
- spec.add_dependency "relaton-bib", "~> 1.18.2"
30
+ spec.add_dependency "relaton-bib", "~> 1.19.0"
31
31
  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: 1.18.2
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-02-22 00:00:00.000000000 Z
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.18.2
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.18.2
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.26
96
+ rubygems_version: 3.3.27
98
97
  signing_key:
99
98
  specification_version: 4
100
99
  summary: 'RelatonIsoBib: Ruby ISOXMLDOC impementation.'
@@ -1,10 +0,0 @@
1
- module RelatonIsoBib
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-iso-bib".freeze
9
- end
10
- end