relaton-cie 1.8.0 → 1.10.1

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: 28fe43fd5c44995ef59eabc4ec8cd9bf36fb0342e01c97d0e05e6d2a5dd1ba21
4
- data.tar.gz: ae6fd1b7e743c3193974bf228586fe8cb55b6de2b34c8e345d4e323be7f0521e
3
+ metadata.gz: '09b7564380e0580d981033ac23690f834b7647e95feab31702d7534daa961e7c'
4
+ data.tar.gz: b351710545bf6bd180947bb6aa7e87b016cd9abdb7387e4b63e3e30af1e5b50b
5
5
  SHA512:
6
- metadata.gz: d53219d78f9835917183abed0e0b9d0187040a18add7df9d405bcb6c6be81920960e5b8e713bf800b1fa0d78331064ed1001eb3f0aa04fa97919ec1f1d1bd557
7
- data.tar.gz: ef5fcc0c88932df602cefd7ee890f492442018ed8bb18a477da9b4e6862e37d7bb221072bfc4768ebc5b6047f2d1e5a5f911b3bed1af160a45e3ce9aeed45407
6
+ metadata.gz: 32583f5b589c57ae8c5644b4631eaeff2e777ec1e668ad1dffc11bdac518046ff14dd9bf4f2452ee1daae4f66fe292eb516a52ad491f0d4597b6c2c5075be932
7
+ data.tar.gz: 77f5c0515b777ea5385d09bc1008579117a3393bb0232800bb6369d209d1fafaede532d88adf3907ee177f7523e96fb25313e6e7334f46571ba3cf2b04a55f24
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
data/.rubocop.yml CHANGED
@@ -2,9 +2,11 @@
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
4
 
5
+ require: rubocop-rails
6
+
5
7
  inherit_from:
6
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
9
  AllCops:
8
- TargetRubyVersion: 2.4
10
+ TargetRubyVersion: 2.5
9
11
  Rails:
10
12
  Enabled: false
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in relaton_cie.gemspec
4
4
  gemspec
5
5
 
6
- gem "rake", "~> 12.0"
6
+ gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
data/README.adoc CHANGED
@@ -112,6 +112,15 @@ item.to_xml bibdata: true
112
112
  <doctype>document</doctype>
113
113
  </ext>
114
114
  </bibdata>"
115
+ ----
116
+ === Typed links
117
+
118
+ Each CIE document has `src` type link.
119
+
120
+ [source,ruby]
121
+ ----
122
+ item.link
123
+ => [#<RelatonBib::TypedUri:0x00007fe58e8d4048 @content=#<Addressable::URI:0xbe50 URI:https://www.techstreet.com/cie/standards/cie-001-1980?product_id=1210107>, @type="src">]
115
124
  ----
116
125
 
117
126
  === Parse a file locally
@@ -123,6 +132,25 @@ item = RelatonBib::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml")
123
132
  ...
124
133
  ----
125
134
 
135
+ === Fetch data
136
+
137
+ This gem uses the https://www.techstreet.com/cie/searches/31156444 dataset as one of data sources.
138
+
139
+ The method `RelatonCie::DataFetcher.fetch(output: "data", format: "yaml")` fetches all the documents from the datast and save them to the `./data` folder in YAML format.
140
+ Arguments:
141
+
142
+ - `output` - folder to save documents (default './data').
143
+ - `format` - format in which the documents are saved. Possimle formats are: `yaml`, `xml` (default `yaml`).
144
+
145
+ [source,ruby]
146
+ ----
147
+ RelatonCie::DataFetcher.fetch
148
+ Started at: 2021-09-08 16:37:53 +0200
149
+ Stopped at: 2021-09-08 16:49:17 +0200
150
+ Done in: 684 sec.
151
+ => nil
152
+ ----
153
+
126
154
  == Development
127
155
 
128
156
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/bin/rspec ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rspec-core", "rspec")
@@ -173,9 +173,11 @@
173
173
  <data type="dateTime"/>
174
174
  </attribute>
175
175
  </optional>
176
- <attribute name="from">
177
- <data type="IDREF"/>
178
- </attribute>
176
+ <optional>
177
+ <attribute name="from">
178
+ <data type="IDREF"/>
179
+ </attribute>
180
+ </optional>
179
181
  <optional>
180
182
  <attribute name="to">
181
183
  <data type="IDREF"/>
@@ -624,6 +626,9 @@
624
626
  <choice>
625
627
  <ref name="PureTextElement"/>
626
628
  <ref name="stem"/>
629
+ <ref name="eref"/>
630
+ <ref name="xref"/>
631
+ <ref name="hyperlink"/>
627
632
  </choice>
628
633
  </zeroOrMore>
629
634
  </element>
@@ -634,6 +639,9 @@
634
639
  <choice>
635
640
  <ref name="PureTextElement"/>
636
641
  <ref name="stem"/>
642
+ <ref name="eref"/>
643
+ <ref name="xref"/>
644
+ <ref name="hyperlink"/>
637
645
  </choice>
638
646
  </zeroOrMore>
639
647
  </element>
@@ -641,7 +649,12 @@
641
649
  <define name="tt">
642
650
  <element name="tt">
643
651
  <zeroOrMore>
644
- <ref name="PureTextElement"/>
652
+ <choice>
653
+ <ref name="PureTextElement"/>
654
+ <ref name="eref"/>
655
+ <ref name="xref"/>
656
+ <ref name="hyperlink"/>
657
+ </choice>
645
658
  </zeroOrMore>
646
659
  </element>
647
660
  </define>
@@ -822,7 +835,9 @@
822
835
  <attribute name="alt"/>
823
836
  </optional>
824
837
  <ref name="CitationType"/>
825
- <text/>
838
+ <oneOrMore>
839
+ <ref name="PureTextElement"/>
840
+ </oneOrMore>
826
841
  </define>
827
842
  <define name="hyperlink">
828
843
  <element name="link">
@@ -835,7 +850,9 @@
835
850
  <optional>
836
851
  <attribute name="alt"/>
837
852
  </optional>
838
- <text/>
853
+ <oneOrMore>
854
+ <ref name="PureTextElement"/>
855
+ </oneOrMore>
839
856
  </element>
840
857
  </define>
841
858
  <define name="xref">
@@ -849,7 +866,9 @@
849
866
  <optional>
850
867
  <attribute name="alt"/>
851
868
  </optional>
852
- <text/>
869
+ <oneOrMore>
870
+ <ref name="PureTextElement"/>
871
+ </oneOrMore>
853
872
  </element>
854
873
  </define>
855
874
  <define name="fn">
data/grammars/biblio.rng CHANGED
@@ -209,9 +209,6 @@
209
209
  <zeroOrMore>
210
210
  <ref name="contact"/>
211
211
  </zeroOrMore>
212
- <zeroOrMore>
213
- <ref name="uri"/>
214
- </zeroOrMore>
215
212
  </element>
216
213
  </define>
217
214
  <define name="fullname">
@@ -401,9 +398,9 @@
401
398
  <choice>
402
399
  <!-- iso191606 TODO -->
403
400
  <group>
404
- <oneOrMore>
401
+ <zeroOrMore>
405
402
  <ref name="street"/>
406
- </oneOrMore>
403
+ </zeroOrMore>
407
404
  <ref name="city"/>
408
405
  <optional>
409
406
  <ref name="state"/>
@@ -787,6 +784,7 @@
787
784
  <value>adapted</value>
788
785
  <value>vote-started</value>
789
786
  <value>vote-ended</value>
787
+ <value>announced</value>
790
788
  </choice>
791
789
  </define>
792
790
  <define name="bdate">
@@ -827,6 +825,11 @@
827
825
  <optional>
828
826
  <attribute name="scope"/>
829
827
  </optional>
828
+ <optional>
829
+ <attribute name="primary">
830
+ <data type="boolean"/>
831
+ </attribute>
832
+ </optional>
830
833
  <text/>
831
834
  </element>
832
835
  </define>