relaton-iso-bib 1.16.0 → 1.16.2

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: 9178932b5f1aeda46f0f96953c3af24f9a0f972b2a814a944fac874b1750aa18
4
- data.tar.gz: bc4581d1396b7da73f085dbfb2dc24563a7f5ff3e9d304364a68950e856f3841
3
+ metadata.gz: 4da0e98206115f1448b10d16ba8c6521a38bc25762f9b1ecabf07e11b415c293
4
+ data.tar.gz: f09b435e8ec48229bd3fbe516d476cda07f0ade028a5f141174fc97d7f3b07cc
5
5
  SHA512:
6
- metadata.gz: e2323ef8d43d2c64d4638f1c0ef7da3e7cce6cf9e0c660a4256c81062f60d26c293cc58165215f7472174936cd5fa3a746b5423183ad0ddeee8ebf40c5125ebd
7
- data.tar.gz: f5713dd3d4ec1e6b37e8623bec3ac3bd1b524f4bdf0a58cdcbde60f18303e6e05c05671c91daf69b0070413e8b7d60ea550d1375611e3da934fd4beb7ffc2252
6
+ metadata.gz: bd267c0503570dc5e86586a574cb0da0f032680019d68eea433ab5d97ac11551f41c2a646653aef17b7ed70dea3879cc0f9eb8cfcd7b73f4751bf33d58c40a6d
7
+ data.tar.gz: 1761fbed48d7aa9d0d200fb0061aa2ca17fc0e3c8264e3a75349ac3a797457f996c1557d23c16d43af6e4ddff6310f2ec6af57d0e5076150814805e4bc7b5937
data/README.adoc CHANGED
@@ -1,9 +1,7 @@
1
1
  = RelatonIsoBib
2
2
 
3
3
  image:https://img.shields.io/gem/v/relaton-iso-bib.svg["Gem Version", link="https://rubygems.org/gems/relaton-iso-bib"]
4
- image:https://github.com/relaton/relaton-iso-bib/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-iso-bib/actions?workflow=macos"]
5
- image:https://github.com/relaton/relaton-iso-bib/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-iso-bib/actions?workflow=windows"]
6
- image:https://github.com/relaton/relaton-iso-bib/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-iso-bib/actions?workflow=ubuntu"]
4
+ image:https://github.com/relaton/relaton-iso-bib/workflows/rake/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-iso-bib/actions?workflow=rake"]
7
5
  image:https://codeclimate.com/github/relaton/relaton-iso-bib/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-iso-bib"]
8
6
  image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-iso-bib.svg["Pull Requests", link="https://github.com/relaton/relaton-iso-bib/pulls"]
9
7
  image:https://img.shields.io/github/commits-since/relaton/relaton-iso-bib/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-iso-bib/releases"]
@@ -29,13 +27,24 @@ Or install it yourself as:
29
27
 
30
28
  == Usage
31
29
 
32
- === Create ISO bibliographic item
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.
33
33
 
34
34
  [source,ruby]
35
35
  ----
36
36
  require 'relaton_iso_bib'
37
37
  => true
38
38
 
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
+ ----
39
48
  hash = YAML.load_file "spec/examples/iso_bib_item.yml"
40
49
  => {
41
50
  "schema-version"=>"v1.0.0",
@@ -346,6 +346,8 @@
346
346
  <ref name="keyword"/>
347
347
  <ref name="xref"/>
348
348
  <ref name="hyperlink"/>
349
+ <ref name="index"/>
350
+ <ref name="index-xref"/>
349
351
  </choice>
350
352
  </oneOrMore>
351
353
  </element>
@@ -623,6 +625,8 @@
623
625
  <ref name="eref"/>
624
626
  <ref name="xref"/>
625
627
  <ref name="hyperlink"/>
628
+ <ref name="index"/>
629
+ <ref name="index-xref"/>
626
630
  </choice>
627
631
  </zeroOrMore>
628
632
  </element>
@@ -636,6 +640,8 @@
636
640
  <ref name="eref"/>
637
641
  <ref name="xref"/>
638
642
  <ref name="hyperlink"/>
643
+ <ref name="index"/>
644
+ <ref name="index-xref"/>
639
645
  </choice>
640
646
  </zeroOrMore>
641
647
  </element>
@@ -648,6 +654,8 @@
648
654
  <ref name="eref"/>
649
655
  <ref name="xref"/>
650
656
  <ref name="hyperlink"/>
657
+ <ref name="index"/>
658
+ <ref name="index-xref"/>
651
659
  </choice>
652
660
  </zeroOrMore>
653
661
  </element>
@@ -655,7 +663,11 @@
655
663
  <define name="keyword">
656
664
  <element name="keyword">
657
665
  <zeroOrMore>
658
- <ref name="PureTextElement"/>
666
+ <choice>
667
+ <ref name="PureTextElement"/>
668
+ <ref name="index"/>
669
+ <ref name="index-xref"/>
670
+ </choice>
659
671
  </zeroOrMore>
660
672
  </element>
661
673
  </define>
@@ -676,7 +688,11 @@
676
688
  <define name="strike">
677
689
  <element name="strike">
678
690
  <zeroOrMore>
679
- <ref name="PureTextElement"/>
691
+ <choice>
692
+ <ref name="PureTextElement"/>
693
+ <ref name="index"/>
694
+ <ref name="index-xref"/>
695
+ </choice>
680
696
  </zeroOrMore>
681
697
  </element>
682
698
  </define>
data/grammars/biblio.rng CHANGED
@@ -942,6 +942,7 @@
942
942
  <value>obsoleted</value>
943
943
  <value>confirmed</value>
944
944
  <value>updated</value>
945
+ <value>corrected</value>
945
946
  <value>issued</value>
946
947
  <value>transmitted</value>
947
948
  <value>copied</value>
@@ -0,0 +1,10 @@
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
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
- require "nokogiri"
4
- require "isoics"
5
- require "relaton_bib"
6
3
  require "relaton_iso_bib/editorial_group"
7
4
  require "relaton_iso_bib/xml_parser"
8
5
  require "relaton_iso_bib/structured_identifier"
@@ -151,7 +148,7 @@ module RelatonIsoBib
151
148
  end
152
149
 
153
150
  if args[:subdoctype] && !self.class::SUBDOCTYPES.include?(args[:subdoctype])
154
- warn "Invald subdoctype '#{args[:subdoctype]}'. Allowed values are: #{self.class::SUBDOCTYPES.join(', ')}"
151
+ Util.warn "Invald subdoctype `#{args[:subdoctype]}`. Allowed values are: #{self.class::SUBDOCTYPES.join(', ')}"
155
152
  end
156
153
  @subdoctype = args[:subdoctype]
157
154
  @structuredidentifier = args[:structuredidentifier]
@@ -231,8 +228,8 @@ module RelatonIsoBib
231
228
  # @raise ArgumentError
232
229
  def check_doctype(doctype)
233
230
  if doctype && !self.class::DOCTYPES.include?(doctype)
234
- warn "[relaton-iso-bib] WARNING: invalid doctype: #{doctype}"
235
- warn "[relaton-iso-bib] Allowed doctypes are: #{self.class::DOCTYPES.join(', ')}"
231
+ Util.warn "WARNING: invalid doctype: #{doctype}"
232
+ Util.warn "Allowed doctypes are: #{self.class::DOCTYPES.join(', ')}"
236
233
  end
237
234
  end
238
235
 
@@ -0,0 +1,9 @@
1
+ module RelatonIsoBib
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonIsoBib.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonIsoBib
2
- VERSION = "1.16.0".freeze
2
+ VERSION = "1.16.2".freeze
3
3
  end
@@ -1,4 +1,9 @@
1
+ require "nokogiri"
2
+ require "isoics"
3
+ require "relaton_bib"
1
4
  require "relaton_iso_bib/version"
5
+ require "relaton_iso_bib/config"
6
+ require "relaton_iso_bib/util"
2
7
  require "relaton_iso_bib/iso_bibliographic_item"
3
8
  require "digest/md5"
4
9
 
@@ -8,9 +13,9 @@ module RelatonIsoBib
8
13
  # Returns hash of XML reammar
9
14
  # @return [String]
10
15
  def self.grammar_hash
11
- gem_path = File.expand_path "..", __dir__
12
- grammars_path = File.join gem_path, "grammars", "*"
13
- grammars = Dir[grammars_path].sort.map { |gp| File.read gp, encoding: "UTF-8" }.join
14
- Digest::MD5.hexdigest grammars
16
+ # gem_path = File.expand_path "..", __dir__
17
+ # grammars_path = File.join gem_path, "grammars", "*"
18
+ # grammars = Dir[grammars_path].sort.map { |gp| File.read gp, encoding: "UTF-8" }.join
19
+ Digest::MD5.hexdigest RelatonIsoBib::VERSION + RelatonBib::VERSION # grammars
15
20
  end
16
21
  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.16.0
4
+ version: 1.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-03 00:00:00.000000000 Z
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: isoics
@@ -63,12 +63,14 @@ 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
66
67
  - lib/relaton_iso_bib/editorial_group.rb
67
68
  - lib/relaton_iso_bib/hash_converter.rb
68
69
  - lib/relaton_iso_bib/ics.rb
69
70
  - lib/relaton_iso_bib/iso_bibliographic_item.rb
70
71
  - lib/relaton_iso_bib/iso_document_relation.rb
71
72
  - lib/relaton_iso_bib/structured_identifier.rb
73
+ - lib/relaton_iso_bib/util.rb
72
74
  - lib/relaton_iso_bib/version.rb
73
75
  - lib/relaton_iso_bib/xml_parser.rb
74
76
  - relaton_iso_bib.gemspec
@@ -76,7 +78,7 @@ homepage: https://github.com/relaton/relaton-iso-bib
76
78
  licenses:
77
79
  - BSD-2-Clause
78
80
  metadata: {}
79
- post_install_message:
81
+ post_install_message:
80
82
  rdoc_options: []
81
83
  require_paths:
82
84
  - lib
@@ -91,8 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
93
  - !ruby/object:Gem::Version
92
94
  version: '0'
93
95
  requirements: []
94
- rubygems_version: 3.4.9
95
- signing_key:
96
+ rubygems_version: 3.3.26
97
+ signing_key:
96
98
  specification_version: 4
97
99
  summary: 'RelatonIsoBib: Ruby ISOXMLDOC impementation.'
98
100
  test_files: []