relaton-ecma 1.13.0 → 1.14.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 +0 -1
- data/.github/workflows/release.yml +22 -0
- data/Gemfile +7 -1
- data/README.adoc +81 -37
- data/grammars/basicdoc.rng +3 -28
- data/grammars/biblio-standoc.rng +164 -0
- data/grammars/biblio.rng +94 -21
- data/grammars/relaton-ecma-compile.rng +11 -0
- data/grammars/relaton-ecma.rng +4 -0
- data/lib/relaton_ecma/bibliographic_item.rb +12 -0
- data/lib/relaton_ecma/data_fetcher.rb +97 -0
- data/lib/relaton_ecma/data_parser.rb +215 -0
- data/lib/relaton_ecma/ecma_bibliography.rb +53 -7
- data/lib/relaton_ecma/hash_converter.rb +11 -0
- data/lib/relaton_ecma/processor.rb +18 -5
- data/lib/relaton_ecma/version.rb +1 -1
- data/lib/relaton_ecma/xml_parser.rb +13 -0
- data/lib/relaton_ecma.rb +6 -1
- data/relaton_ecma.gemspec +3 -8
- metadata +27 -63
- data/grammars/isodoc.rng +0 -2807
- data/grammars/reqt.rng +0 -223
- data/lib/relaton_ecma/scrapper.rb +0 -27
@@ -7,26 +7,39 @@ module RelatonEcma
|
|
7
7
|
@prefix = "ECMA"
|
8
8
|
@defaultprefix = /^ECMA(-|\s)/
|
9
9
|
@idtype = "ECMA"
|
10
|
+
@datasets = %w[ecma-standards]
|
10
11
|
end
|
11
12
|
|
12
13
|
# @param code [String]
|
13
14
|
# @param date [String, NilClass] year
|
14
15
|
# @param opts [Hash]
|
15
|
-
# @return [
|
16
|
+
# @return [RelatonEcma::BibliographicItem]
|
16
17
|
def get(code, date, opts)
|
17
18
|
::RelatonEcma::EcmaBibliography.get(code, date, opts)
|
18
19
|
end
|
19
20
|
|
21
|
+
#
|
22
|
+
# Fetch all the documents from a source
|
23
|
+
#
|
24
|
+
# @param [String] source source name (iec-harmonized-all, iec-harmonized-latest)
|
25
|
+
# @param [Hash] opts
|
26
|
+
# @option opts [String] :output directory to output documents
|
27
|
+
# @option opts [String] :format output format (xml, yaml, bibxml)
|
28
|
+
#
|
29
|
+
def fetch_data(_source, opts)
|
30
|
+
DataFetcher.new(**opts).fetch
|
31
|
+
end
|
32
|
+
|
20
33
|
# @param xml [String]
|
21
|
-
# @return [
|
34
|
+
# @return [RelatonEcma::BibliographicItem]
|
22
35
|
def from_xml(xml)
|
23
|
-
::
|
36
|
+
::RelatonEcma::XMLParser.from_xml xml
|
24
37
|
end
|
25
38
|
|
26
39
|
# @param hash [Hash]
|
27
|
-
# @return [
|
40
|
+
# @return [RelatonEcma::BibliographicItem]
|
28
41
|
def hash_to_bib(hash)
|
29
|
-
::
|
42
|
+
::RelatonEcma::BibliographicItem.new hash
|
30
43
|
end
|
31
44
|
|
32
45
|
# Returns hash of XML grammar
|
data/lib/relaton_ecma/version.rb
CHANGED
data/lib/relaton_ecma.rb
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
require "nokogiri"
|
2
2
|
require "open-uri"
|
3
3
|
require "yaml"
|
4
|
+
require "relaton/index"
|
4
5
|
require "relaton_bib"
|
5
6
|
require "relaton_ecma/version"
|
6
|
-
require "relaton_ecma/
|
7
|
+
require "relaton_ecma/bibliographic_item"
|
8
|
+
require "relaton_ecma/xml_parser"
|
9
|
+
require "relaton_ecma/hash_converter"
|
7
10
|
require "relaton_ecma/ecma_bibliography"
|
11
|
+
require "relaton_ecma/data_fetcher"
|
12
|
+
require "relaton_ecma/data_parser"
|
8
13
|
|
9
14
|
module RelatonEcma
|
10
15
|
# Returns hash of XML reammar
|
data/relaton_ecma.gemspec
CHANGED
@@ -27,15 +27,10 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
# spec.add_development_dependency "debase"
|
31
30
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
32
|
-
spec.add_development_dependency "pry-byebug"
|
33
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
|
-
# spec.add_development_dependency "ruby-debug-ide"
|
35
|
-
spec.add_development_dependency "ruby-jing"
|
36
|
-
spec.add_development_dependency "simplecov"
|
37
|
-
spec.add_development_dependency "vcr"
|
38
|
-
spec.add_development_dependency "webmock"
|
39
32
|
|
40
|
-
spec.add_dependency "
|
33
|
+
spec.add_dependency "mechanize", "~> 2.7"
|
34
|
+
spec.add_dependency "relaton-bib", "~> 1.14.0"
|
35
|
+
spec.add_dependency "relaton-index", "~> 0.1.6"
|
41
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ecma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.6'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pry-byebug
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,75 +39,47 @@ dependencies:
|
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '10.0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
42
|
+
name: mechanize
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - "
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: simplecov
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: vcr
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
45
|
+
- - "~>"
|
88
46
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
90
|
-
type: :
|
47
|
+
version: '2.7'
|
48
|
+
type: :runtime
|
91
49
|
prerelease: false
|
92
50
|
version_requirements: !ruby/object:Gem::Requirement
|
93
51
|
requirements:
|
94
|
-
- - "
|
52
|
+
- - "~>"
|
95
53
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
54
|
+
version: '2.7'
|
97
55
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
56
|
+
name: relaton-bib
|
99
57
|
requirement: !ruby/object:Gem::Requirement
|
100
58
|
requirements:
|
101
|
-
- - "
|
59
|
+
- - "~>"
|
102
60
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
-
type: :
|
61
|
+
version: 1.14.0
|
62
|
+
type: :runtime
|
105
63
|
prerelease: false
|
106
64
|
version_requirements: !ruby/object:Gem::Requirement
|
107
65
|
requirements:
|
108
|
-
- - "
|
66
|
+
- - "~>"
|
109
67
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
68
|
+
version: 1.14.0
|
111
69
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: relaton-
|
70
|
+
name: relaton-index
|
113
71
|
requirement: !ruby/object:Gem::Requirement
|
114
72
|
requirements:
|
115
73
|
- - "~>"
|
116
74
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
75
|
+
version: 0.1.6
|
118
76
|
type: :runtime
|
119
77
|
prerelease: false
|
120
78
|
version_requirements: !ruby/object:Gem::Requirement
|
121
79
|
requirements:
|
122
80
|
- - "~>"
|
123
81
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
82
|
+
version: 0.1.6
|
125
83
|
description: "RelatonEcma: retrieve ECMA Standards for bibliographic use \nusing the
|
126
84
|
BibliographicItem model.\n"
|
127
85
|
email:
|
@@ -131,6 +89,7 @@ extensions: []
|
|
131
89
|
extra_rdoc_files: []
|
132
90
|
files:
|
133
91
|
- ".github/workflows/rake.yml"
|
92
|
+
- ".github/workflows/release.yml"
|
134
93
|
- ".gitignore"
|
135
94
|
- ".rspec"
|
136
95
|
- ".rubocop.yml"
|
@@ -141,14 +100,19 @@ files:
|
|
141
100
|
- bin/rspec
|
142
101
|
- bin/setup
|
143
102
|
- grammars/basicdoc.rng
|
103
|
+
- grammars/biblio-standoc.rng
|
144
104
|
- grammars/biblio.rng
|
145
|
-
- grammars/
|
146
|
-
- grammars/
|
105
|
+
- grammars/relaton-ecma-compile.rng
|
106
|
+
- grammars/relaton-ecma.rng
|
147
107
|
- lib/relaton_ecma.rb
|
108
|
+
- lib/relaton_ecma/bibliographic_item.rb
|
109
|
+
- lib/relaton_ecma/data_fetcher.rb
|
110
|
+
- lib/relaton_ecma/data_parser.rb
|
148
111
|
- lib/relaton_ecma/ecma_bibliography.rb
|
112
|
+
- lib/relaton_ecma/hash_converter.rb
|
149
113
|
- lib/relaton_ecma/processor.rb
|
150
|
-
- lib/relaton_ecma/scrapper.rb
|
151
114
|
- lib/relaton_ecma/version.rb
|
115
|
+
- lib/relaton_ecma/xml_parser.rb
|
152
116
|
- relaton_ecma.gemspec
|
153
117
|
homepage: https://github.com/metanorma/relaton-ecma
|
154
118
|
licenses:
|
@@ -170,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
134
|
- !ruby/object:Gem::Version
|
171
135
|
version: '0'
|
172
136
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
137
|
+
rubygems_version: 3.4.9
|
174
138
|
signing_key:
|
175
139
|
specification_version: 4
|
176
140
|
summary: 'RelatonIetf: retrieve ECMA Standards for bibliographic use using the BibliographicItem
|