relaton-iana 1.13.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ module RelatonIana
15
15
  #
16
16
  # @param [Nokogiri::XML::Element] xml
17
17
  #
18
- # @return [RelatonBib:BibliographicItem, nil] bibliographic item
18
+ # @return [RelatonIana::IanaBibliographicItem, nil] bibliographic item
19
19
  #
20
20
  def self.parse(xml, rootdoc = nil)
21
21
  new(xml, rootdoc).parse
@@ -24,14 +24,13 @@ module RelatonIana
24
24
  #
25
25
  # Parse document
26
26
  #
27
- # @return [RelatonBib:BibliographicItem, nil] bibliographic item
27
+ # @return [RelatonIana::IanaBibliographicItem, nil] bibliographic item
28
28
  #
29
29
  def parse # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
30
30
  return unless @xml
31
31
 
32
- RelatonBib::BibliographicItem.new(
32
+ RelatonIana::IanaBibliographicItem.new(
33
33
  type: "standard",
34
- fetched: Date.today.to_s,
35
34
  language: ["en"],
36
35
  script: ["Latn"],
37
36
  title: parse_title,
@@ -15,7 +15,7 @@ module RelatonIana
15
15
  # @param code [String]
16
16
  # @param date [String, NilClass] year
17
17
  # @param opts [Hash]
18
- # @return [RelatonBib::BibliographicItem]
18
+ # @return [RelatonIana::IanaBibliographicItem]
19
19
  def get(code, date, opts)
20
20
  ::RelatonIana::IanaBibliography.get(code, date, opts)
21
21
  end
@@ -33,16 +33,16 @@ module RelatonIana
33
33
  end
34
34
 
35
35
  # @param xml [String]
36
- # @return [RelatonBib::BibliographicItem]
36
+ # @return [RelatonIana::IanaBibliographicItem]
37
37
  def from_xml(xml)
38
- ::RelatonBib::XMLParser.from_xml xml
38
+ ::RelatonIana::XMLParser.from_xml xml
39
39
  end
40
40
 
41
41
  # @param hash [Hash]
42
- # @return [RelatonIana::BibliographicItem]
42
+ # @return [RelatonIana::IanaBibliographicItem]
43
43
  def hash_to_bib(hash)
44
- item_hash = ::RelatonBib::HashConverter.hash_to_bib(hash)
45
- ::RelatonWBib::BibliographicItem.new(**item_hash)
44
+ item_hash = ::RelatonIana::HashConverter.hash_to_bib(hash)
45
+ ::RelatonIana::IanaBibliographicItem.new(**item_hash)
46
46
  end
47
47
 
48
48
  # Returns hash of XML grammar
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIana
4
- VERSION = "1.13.0"
4
+ VERSION = "1.14.0"
5
5
  end
@@ -0,0 +1,9 @@
1
+ module RelatonIana
2
+ class XMLParser < RelatonBib::XMLParser
3
+ # @param item_hash [Hash]
4
+ # @return [RelatonIana::IanaBibliographicItem]
5
+ def self.bib_item(item_hash)
6
+ IanaBibliographicItem.new(**item_hash)
7
+ end
8
+ end
9
+ end
data/lib/relaton_iana.rb CHANGED
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "faraday"
4
+ require "jing"
4
5
  require "relaton_bib"
5
6
  require_relative "relaton_iana/version"
7
+ require_relative "relaton_iana/iana_bibliographic_item"
8
+ require_relative "relaton_iana/xml_parser"
9
+ require_relative "relaton_iana/hash_converter"
6
10
  require_relative "relaton_iana/iana_bibliography"
7
11
  require_relative "relaton_iana/parser"
8
12
  require_relative "relaton_iana/data_fetcher"
data/relaton_iana.gemspec CHANGED
@@ -39,7 +39,8 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "webmock"
40
40
 
41
41
  spec.add_dependency "faraday", "~> 1.0"
42
- spec.add_dependency "relaton-bib", "~> 1.13.0"
42
+ spec.add_dependency "relaton-bib", "~> 1.14.0"
43
+ spec.add_dependency "ruby-jing"
43
44
 
44
45
  # Uncomment to register a new dependency of your gem
45
46
  # spec.add_dependency "example-gem", "~> 1.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-21 00:00:00.000000000 Z
11
+ date: 2022-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -142,14 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.13.0
145
+ version: 1.14.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.13.0
152
+ version: 1.14.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: ruby-jing
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  description: 'RelatonIana: Ruby XMLDOC impementation.'
154
168
  email:
155
169
  - open.source@ribose.com
@@ -158,6 +172,7 @@ extensions: []
158
172
  extra_rdoc_files: []
159
173
  files:
160
174
  - ".github/workflows/rake.yml"
175
+ - ".github/workflows/release.yml"
161
176
  - ".gitignore"
162
177
  - ".rspec"
163
178
  - ".rubocop.yml"
@@ -169,23 +184,26 @@ files:
169
184
  - bin/rspec
170
185
  - bin/setup
171
186
  - grammars/basicdoc.rng
187
+ - grammars/biblio-standoc.rng
172
188
  - grammars/biblio.rng
173
- - grammars/isodoc.rng
174
- - grammars/reqt.rng
189
+ - grammars/relaton-iana-compile.rng
190
+ - grammars/relaton-iana.rng
175
191
  - lib/relaton_iana.rb
176
192
  - lib/relaton_iana/data_fetcher.rb
193
+ - lib/relaton_iana/hash_converter.rb
177
194
  - lib/relaton_iana/iana_bibliographic_item.rb
178
195
  - lib/relaton_iana/iana_bibliography.rb
179
196
  - lib/relaton_iana/parser.rb
180
197
  - lib/relaton_iana/processor.rb
181
198
  - lib/relaton_iana/version.rb
199
+ - lib/relaton_iana/xml_parser.rb
182
200
  - relaton_iana.gemspec
183
201
  homepage: https://github.com/relaton/relaton-iana
184
202
  licenses:
185
203
  - BSD-2-Clause
186
204
  metadata:
187
205
  homepage_uri: https://github.com/relaton/relaton-iana
188
- post_install_message:
206
+ post_install_message:
189
207
  rdoc_options: []
190
208
  require_paths:
191
209
  - lib
@@ -200,8 +218,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
218
  - !ruby/object:Gem::Version
201
219
  version: '0'
202
220
  requirements: []
203
- rubygems_version: 3.2.3
204
- signing_key:
221
+ rubygems_version: 3.1.6
222
+ signing_key:
205
223
  specification_version: 4
206
224
  summary: 'RelatonIana: Ruby XMLDOC impementation.'
207
225
  test_files: []