relaton-iana 1.16.1 → 1.17.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: b9e7fe65f2c63a9d011127f013f61f5bd85b1dc32043f80eb2eb2653755facd4
4
- data.tar.gz: d0cc07f003041384cfe5c43bdff9f7bfa399ab37c752446746fe3d52b454107e
3
+ metadata.gz: 5affee1debd80ebe3bc401baa233edc1652f692254de493e39ebc31703c66b3f
4
+ data.tar.gz: ca0cfad11fbe7b397e3a25d4e62c122d3bafc298960b6de2882b932fef8d3291
5
5
  SHA512:
6
- metadata.gz: ba25eadde028828f0a016fc4ee186166c5e012062ef8f46838d1ddb401768da7680321cd73469fe1cfe1032e1b6d37b26c8c121e26d98ae8065340101e2d8124
7
- data.tar.gz: 269afa4728fb2bdd13722c8a3b91df76bef7dec287eb004d7c5ac1d240bc6e72a75860acd777ad46587119c11b95932f1314d43d9b996f5fe8755f371dd90748
6
+ metadata.gz: cd127457d696cceb56b83437cbfc708a96b3cf279ad19b58d1966fcd436be840158cd687195dd763c0d566f3f3cd7ca626d8c0e8590013c49a5283da91683b7f
7
+ data.tar.gz: 810cc8bf7f4457e601e1e37d4a94658da47c6ad8dc7510cdbc0519f104608179fc8925253ac975b93342591effc8321e85613467159035f8ecad0e8f9b7ec06d
data/README.adoc CHANGED
@@ -23,16 +23,27 @@ Or install it yourself as:
23
23
 
24
24
  == Usage
25
25
 
26
- === Search for a standard using keywords
26
+ === Configuration
27
+
28
+ 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 `RelatonIana.configure` block.
27
29
 
28
30
  [source,ruby]
29
31
  ----
30
32
  require 'relaton_iana'
31
33
  => true
32
34
 
33
- item = RelatonIana::IanaBibliography.get "IANA service-names-port-numbers"
34
- [relaton-iana] ("IANA service-names-port-numbers") fetching...
35
- [relaton-iana] ("IANA service-names-port-numbers") found IANA service-names-port-numbers
35
+ RelatonIana.configure do |config|
36
+ config.logger.level = Logger::DEBUG
37
+ end
38
+ ----
39
+
40
+ === Search for a standard using keywords
41
+
42
+ [source,ruby]
43
+ ----
44
+ item = RelatonIana::IanaBibliography.get "IANA service-names-port-numbers"
45
+ [relaton-iana] (IANA service-names-port-numbers) Fetching from Relaton repository ...
46
+ [relaton-iana] (IANA service-names-port-numbers) Found: `IANA service-names-port-numbers`
36
47
  => #<RelatonIana::IanaBibliographicItem:0x00007f7c6cc024d0
37
48
  ...
38
49
  ----
@@ -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>
@@ -1,8 +1,11 @@
1
1
  module RelatonIana
2
- class HashConverter < RelatonBib::HashConverter
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+
3
6
  # @param item_hash [Hash]
4
7
  # @return [RelatonIana::IanaBibliographicItem]
5
- def self.bib_item(item_hash)
8
+ def bib_item(item_hash)
6
9
  IanaBibliographicItem.new(**item_hash)
7
10
  end
8
11
  end
@@ -8,7 +8,7 @@ module RelatonIana
8
8
 
9
9
  # @param text [String]
10
10
  # @return [RelatonIana::IanaBibliographicItem]
11
- def search(text) # rubocop:disable Metrics/MethodLength
11
+ def search(text) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
12
12
  # file = text.sub(/^IANA\s/, "").gsub(/[\s,:\/]/, "_").downcase
13
13
  # url = "#{SOURCE}#{file}.yaml"
14
14
  index = Relaton::Index.find_or_create :IANA, url: "#{SOURCE}index-v1.zip", file: INDEX_FILE
@@ -34,14 +34,14 @@ module RelatonIana
34
34
  # @param opts [Hash] options
35
35
  # @return [RelatonIana::IanaBibliographicItem]
36
36
  def get(ref, _year = nil, _opts = {})
37
- Util.warn "(#{ref}) fetching..."
37
+ Util.warn "(#{ref}) Fetching from Relaton repository ..."
38
38
  result = search(ref)
39
39
  unless result
40
- Util.warn "(#{ref}) not found"
40
+ Util.warn "(#{ref}) Not found."
41
41
  return
42
42
  end
43
43
 
44
- Util.warn "(#{ref}) found `#{result.docidentifier[0].id}`"
44
+ Util.warn "(#{ref}) Found: `#{result.docidentifier[0].id}`"
45
45
  result
46
46
  end
47
47
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIana
4
- VERSION = "1.16.1"
4
+ VERSION = "1.17.0"
5
5
  end
data/relaton_iana.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.require_paths = ["lib"]
32
32
 
33
33
  spec.add_dependency "faraday", "~> 2.7.0"
34
- spec.add_dependency "relaton-bib", "~> 1.16.0"
34
+ spec.add_dependency "relaton-bib", "~> 1.17.0"
35
35
  spec.add_dependency "relaton-index", "~> 0.2.0"
36
36
 
37
37
  # Uncomment to register a new dependency of your gem
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.1
4
+ version: 1.17.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: 2023-09-20 00:00:00.000000000 Z
11
+ date: 2023-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.16.0
33
+ version: 1.17.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.16.0
40
+ version: 1.17.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-index
43
43
  requirement: !ruby/object:Gem::Requirement