relaton-cie 1.16.2 → 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: 561352bffe788d129ff1c272153061bd306227e93f30b2e85ccf09bf93d4cc40
4
- data.tar.gz: 9a247f69e38255bb6a4ed8dbbd567762bc783df5a4f321f0f539ff6ce216a3b7
3
+ metadata.gz: 11878869c776cb0e77ce456b8f774fd549d45a1681ab05a1b18d0178d6ec9dc9
4
+ data.tar.gz: d6a0c2395217422c2c16de2313eba99818aae4792a280bb27e5abdd6d62ebdc8
5
5
  SHA512:
6
- metadata.gz: 301d5f5d99a0f5812e986629cf25a7b195c1acef3e1600c11814176c7f3005868ceb81cb6ada5ee01f135626c2e3cd2c13602df1ee1a8e4dffe12737b857ef8c
7
- data.tar.gz: d485fef67999bef353f2777cd527e642d5e5a698e32858550ceca4e58ec9b3f9986881e5ede1d47ab110cfd2b199a594ae0b02bcc3017165f9658b89779e2034
6
+ metadata.gz: f3884f990e810108ef61152b8b7b178d5208f310d640aeec04bbd573327ec9cf28370e96842f427155e4d0e917d987074bfeeb5348cdfe43cce71965fbe8d7e6
7
+ data.tar.gz: 914aac83049568ca9ba66fbf496d8ea4688a263cc8e47418ea828bc2e822d08a03fac95c5aa80daae24460db6cc283ebf3f9b6faa9a0c9f67817a9f715f656a4
data/README.adoc CHANGED
@@ -48,15 +48,15 @@ end
48
48
  [source,ruby]
49
49
  ----
50
50
  item = RelatonCie::CieBibliography.get 'CIE 001-1980'
51
- [relaton-cie] (CIE 001-1980) fetching...
52
- [relaton-cie] (CIE 001-1980) found `CIE 001-1980`
51
+ [relaton-cie] (CIE 001-1980) Fetching from Realton repository ...
52
+ [relaton-cie] (CIE 001-1980) Found: `CIE 001-1980`
53
53
  => #<RelatonBib::BibliographicItem:0x007fb3f6098920
54
54
  ...
55
55
 
56
56
  # Return nil if a document doesn't exist.
57
57
  RelatonCie::CieBibliography.get '1111'
58
- [relaton-cie] (1111) fetching...
59
- [relaton-cie] WARNING no match found online for `1111`. The code must be exactly like it is on the standards website.
58
+ [relaton-cie] (1111) Fetching from Realton repository ...
59
+ [relaton-cie] (1111) Not found.
60
60
  => nil
61
61
  ----
62
62
 
@@ -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>
@@ -160,6 +160,10 @@ module RelatonCie
160
160
  contribs << { entity: org, role: [{ type: "publisher" }] }
161
161
  end
162
162
 
163
+ def fetch_doctype
164
+ RelatonBib::DocumentType.new(type: "document")
165
+ end
166
+
163
167
  # @param bib [RelatonCie::BibliographicItem]
164
168
  def write_file(bib) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
165
169
  id = bib.docidentifier[0].id.gsub(%r{[/\s\-:.]}, "_")
@@ -191,7 +195,7 @@ module RelatonCie
191
195
  abstract: fetch_abstract(doc), date: fetch_date(doc),
192
196
  edition: fetch_edition(doc), contributor: fetch_contributor(doc),
193
197
  relation: fetch_relation(doc), language: ["en"], script: ["Latn"],
194
- doctype: "document"
198
+ doctype: fetch_doctype
195
199
  )
196
200
  write_file item
197
201
  rescue StandardError => e
@@ -1,11 +1,11 @@
1
1
  module RelatonCie
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- # @param item_hash [Hash]
5
- # @return [RelatonCie::BibliographicItem]
6
- def bib_item(item_hash)
7
- BibliographicItem.new(**item_hash)
8
- end
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+ # @param item_hash [Hash]
6
+ # @return [RelatonCie::BibliographicItem]
7
+ def bib_item(item_hash)
8
+ BibliographicItem.new(**item_hash)
9
9
  end
10
10
  end
11
11
  end
@@ -0,0 +1,6 @@
1
+ module RelatonCie
2
+ class NameParser < Parslet::Parser
3
+ root(:name)
4
+ rule(:name) { name_part.as(:name_part) >> (comma >> name_part).repeat }
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonCie
2
- VERSION = "1.16.2".freeze
2
+ VERSION = "1.17.0".freeze
3
3
  end
data/relaton_cie.gemspec CHANGED
@@ -31,6 +31,6 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency "mechanize", "~> 2.8.0"
33
33
  spec.add_dependency "parslet", "~> 2.0.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
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
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-10-08 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: mechanize
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.16.0
47
+ version: 1.17.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.16.0
54
+ version: 1.17.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: relaton-index
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -98,6 +98,7 @@ files:
98
98
  - lib/relaton_cie/config.rb
99
99
  - lib/relaton_cie/data_fetcher.rb
100
100
  - lib/relaton_cie/hash_converter.rb
101
+ - lib/relaton_cie/name_parser.rb
101
102
  - lib/relaton_cie/processor.rb
102
103
  - lib/relaton_cie/scrapper.rb
103
104
  - lib/relaton_cie/util.rb