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 +4 -4
- data/.github/workflows/rake.yml +1 -11
- data/.rubocop.yml +3 -1
- data/Gemfile +1 -1
- data/README.adoc +28 -0
- data/bin/rspec +29 -0
- data/grammars/basicdoc.rng +26 -7
- data/grammars/biblio.rng +8 -5
- data/grammars/isodoc.rng +686 -96
- data/grammars/reqt.rng +34 -5
- data/lib/relaton_cie/cie_bibliography.rb +1 -1
- data/lib/relaton_cie/data_fetcher.rb +192 -0
- data/lib/relaton_cie/processor.rb +14 -1
- data/lib/relaton_cie/scrapper.rb +2 -2
- data/lib/relaton_cie/version.rb +1 -1
- data/lib/relaton_cie.rb +1 -0
- data/relaton_cie.gemspec +3 -5
- metadata +21 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09b7564380e0580d981033ac23690f834b7647e95feab31702d7534daa961e7c'
|
4
|
+
data.tar.gz: b351710545bf6bd180947bb6aa7e87b016cd9abdb7387e4b63e3e30af1e5b50b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32583f5b589c57ae8c5644b4631eaeff2e777ec1e668ad1dffc11bdac518046ff14dd9bf4f2452ee1daae4f66fe292eb516a52ad491f0d4597b6c2c5075be932
|
7
|
+
data.tar.gz: 77f5c0515b777ea5385d09bc1008579117a3393bb0232800bb6369d209d1fafaede532d88adf3907ee177f7523e96fb25313e6e7334f46571ba3cf2b04a55f24
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '2.7', '2.6', '2.5'
|
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.
|
10
|
+
TargetRubyVersion: 2.5
|
9
11
|
Rails:
|
10
12
|
Enabled: false
|
data/Gemfile
CHANGED
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")
|
data/grammars/basicdoc.rng
CHANGED
@@ -173,9 +173,11 @@
|
|
173
173
|
<data type="dateTime"/>
|
174
174
|
</attribute>
|
175
175
|
</optional>
|
176
|
-
<
|
177
|
-
<
|
178
|
-
|
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
|
-
<
|
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
|
-
<
|
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
|
-
<
|
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
|
-
<
|
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
|
-
<
|
401
|
+
<zeroOrMore>
|
405
402
|
<ref name="street"/>
|
406
|
-
</
|
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>
|