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.
@@ -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 [RelatonBib::BibliographicItem]
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 [RelatonBib::BibliographicItem]
34
+ # @return [RelatonEcma::BibliographicItem]
22
35
  def from_xml(xml)
23
- ::RelatonBib::XMLParser.from_xml xml
36
+ ::RelatonEcma::XMLParser.from_xml xml
24
37
  end
25
38
 
26
39
  # @param hash [Hash]
27
- # @return [RelatonBib::BibliographicItem]
40
+ # @return [RelatonEcma::BibliographicItem]
28
41
  def hash_to_bib(hash)
29
- ::RelatonBib::BibliographicItem.new hash
42
+ ::RelatonEcma::BibliographicItem.new hash
30
43
  end
31
44
 
32
45
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonEcma
2
- VERSION = "1.13.0".freeze
2
+ VERSION = "1.14.1".freeze
3
3
  end
@@ -0,0 +1,13 @@
1
+ module RelatonEcma
2
+ class XMLParser < RelatonBib::XMLParser
3
+ class << self
4
+ private
5
+
6
+ # @param item_hash [Hash]
7
+ # @return [RelatonEcma::BibliographicItem]
8
+ def bib_item(item_hash)
9
+ BibliographicItem.new(**item_hash)
10
+ end
11
+ end
12
+ end
13
+ end
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/scrapper"
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 "relaton-bib", "~> 1.13.0"
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.13.0
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: 2022-08-21 00:00:00.000000000 Z
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: ruby-jing
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: '0'
90
- type: :development
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: '0'
54
+ version: '2.7'
97
55
  - !ruby/object:Gem::Dependency
98
- name: webmock
56
+ name: relaton-bib
99
57
  requirement: !ruby/object:Gem::Requirement
100
58
  requirements:
101
- - - ">="
59
+ - - "~>"
102
60
  - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
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: '0'
68
+ version: 1.14.0
111
69
  - !ruby/object:Gem::Dependency
112
- name: relaton-bib
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.13.0
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.13.0
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/isodoc.rng
146
- - grammars/reqt.rng
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.2.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