relaton-ecma 1.14.6 → 1.16.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: 489543e098342587dcd53b5488ab3704ab432761a553c28da88d20a76f110d15
4
- data.tar.gz: 7f246f2b5751621a791fa3d452754f7a46c50e958e737b6a9a8130f59cef1302
3
+ metadata.gz: 79a0e5c939fec089e35a4f10ea7c62bdbc9ca1cea332dbbdb61cee01fc255b30
4
+ data.tar.gz: 5c9c499101971798f03ff2953bf5d4a7693a9edbac031bf7793ce568df97582c
5
5
  SHA512:
6
- metadata.gz: 7f75631aa0d342ab952534ad8829b0ce64682c16f49962228495da1dd5b0b286787d9d790c85d00e49cae7d4304c77a218d3236f9b383673c8c53fb8667a165a
7
- data.tar.gz: bec4dcaf4aa873f13e7eba1846212ee1df248b478ef0949e81782ae975c3ce517ed8bf909fa118bbf6c90d8eb5b17369b75cd490b93b7afe2ee700a1fdea2a99
6
+ metadata.gz: 40bca3bd29a6fbd8c668ba2dca1ed9fedfeb03bc248162b5f5b702d1fd80bd32fc56c33e83e3c0a35e82eb9e4699dd84396c6f24e9bfa8cc9203639c6cee2ca4
7
+ data.tar.gz: 7eccd989b4bf12be08f519b8f7564aab8bdd823929e0c3206a903f5f0679460458e54ea89eb2ca7b2d75dd20b4845268b821d8fc4c5766ed1e27496e41c247b8
@@ -7,7 +7,8 @@ on:
7
7
  inputs:
8
8
  next_version:
9
9
  description: |
10
- Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
10
+ Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
11
+ Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
11
12
  required: true
12
13
  default: 'skip'
13
14
  repository_dispatch:
data/grammars/biblio.rng CHANGED
@@ -1283,7 +1283,7 @@
1283
1283
  <value>mergedInto</value>
1284
1284
  <value>splits</value>
1285
1285
  <value>splitInto</value>
1286
- <value>instance</value>
1286
+ <value>instanceOf</value>
1287
1287
  <value>hasInstance</value>
1288
1288
  <value>exemplarOf</value>
1289
1289
  <value>hasExemplar</value>
@@ -0,0 +1,10 @@
1
+ module RelatonEcma
2
+ module Config
3
+ include RelatonBib::Config
4
+ end
5
+ extend Config
6
+
7
+ class Configuration < RelatonBib::Configuration
8
+ PROGNAME = "relaton-ecma".freeze
9
+ end
10
+ end
@@ -147,7 +147,7 @@ module RelatonEcma
147
147
  # @return [Array<RelatonBib::FormattedString>]
148
148
  def fetch_abstract
149
149
  content = @doc.xpath('//div[@class="ecma-item-content"]/p').map do |a|
150
- a.text.strip.squeeze(" ").gsub(/\r\n/, "")
150
+ a.text.strip.squeeze(" ").gsub("\r\n", "")
151
151
  end.join "\n"
152
152
  return [] if content.empty?
153
153
 
@@ -164,7 +164,7 @@ module RelatonEcma
164
164
 
165
165
  # @return [Array<Hash>]
166
166
  def fetch_relation # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity
167
- @doc.xpath("//ul[@class='ecma-item-archives']/li").map do |rel|
167
+ @doc.xpath("//ul[@class='ecma-item-archives']/li").filter_map do |rel|
168
168
  ref, ed, date, vol = edition_id_parts rel.at("span").text
169
169
  next if ed.nil? || ed.empty?
170
170
 
@@ -178,7 +178,7 @@ module RelatonEcma
178
178
  link: link, extent: extent
179
179
  )
180
180
  { type: "updates", bibitem: bibitem }
181
- end.compact
181
+ end
182
182
  end
183
183
 
184
184
  #
@@ -40,14 +40,14 @@ module RelatonEcma
40
40
  # @param opts [Hash] not used
41
41
  # @return [RelatonEcma::BibliographicItem] Relaton of reference
42
42
  def get(code, _year = nil, _opts = {})
43
- warn "[relaton-ecma] (\"#{code}\") fetching..."
43
+ Util.warn "(#{code}) fetching..."
44
44
  result = fetch_doc(code)
45
45
  if result
46
- warn "[relaton-ecma] (\"#{code}\") found #{result.docidentifier.first.id}"
46
+ Util.warn "(#{code}) found `#{result.docidentifier.first.id}`"
47
47
  # item
48
48
  else
49
- warn "[relaton-ecma] WARNING no match found online for #{code}. " \
50
- "The code must be exactly like it is on the standards website."
49
+ Util.warn "(#{code}) WARNING no match found online for `#{code}`. " \
50
+ "The code must be exactly like it is on the standards website."
51
51
  end
52
52
  result
53
53
  end
@@ -0,0 +1,9 @@
1
+ module RelatonEcma
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonEcma.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonEcma
2
- VERSION = "1.14.6".freeze
2
+ VERSION = "1.16.1".freeze
3
3
  end
data/lib/relaton_ecma.rb CHANGED
@@ -4,6 +4,8 @@ require "yaml"
4
4
  require "relaton/index"
5
5
  require "relaton_bib"
6
6
  require "relaton_ecma/version"
7
+ require "relaton_ecma/config"
8
+ require "relaton_ecma/util"
7
9
  require "relaton_ecma/bibliographic_item"
8
10
  require "relaton_ecma/xml_parser"
9
11
  require "relaton_ecma/hash_converter"
@@ -15,9 +17,9 @@ module RelatonEcma
15
17
  # Returns hash of XML reammar
16
18
  # @return [String]
17
19
  def self.grammar_hash
18
- gem_path = File.expand_path "..", __dir__
19
- grammars_path = File.join gem_path, "grammars", "*"
20
- grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
21
- Digest::MD5.hexdigest grammars
20
+ # gem_path = File.expand_path "..", __dir__
21
+ # grammars_path = File.join gem_path, "grammars", "*"
22
+ # grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
23
+ Digest::MD5.hexdigest RelatonEcma::VERSION + RelatonBib::VERSION # grammars
22
24
  end
23
25
  end
data/relaton_ecma.gemspec CHANGED
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_dependency "mechanize", "~> 2.8.0"
31
- spec.add_dependency "relaton-bib", "~> 1.14.0"
31
+ spec.add_dependency "relaton-bib", "~> 1.16.0"
32
32
  spec.add_dependency "relaton-index", "~> 0.2.4"
33
33
  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.14.6
4
+ version: 1.16.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: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.14.0
33
+ version: 1.16.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.14.0
40
+ version: 1.16.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-index
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -79,11 +79,13 @@ files:
79
79
  - grammars/relaton-ecma.rng
80
80
  - lib/relaton_ecma.rb
81
81
  - lib/relaton_ecma/bibliographic_item.rb
82
+ - lib/relaton_ecma/config.rb
82
83
  - lib/relaton_ecma/data_fetcher.rb
83
84
  - lib/relaton_ecma/data_parser.rb
84
85
  - lib/relaton_ecma/ecma_bibliography.rb
85
86
  - lib/relaton_ecma/hash_converter.rb
86
87
  - lib/relaton_ecma/processor.rb
88
+ - lib/relaton_ecma/util.rb
87
89
  - lib/relaton_ecma/version.rb
88
90
  - lib/relaton_ecma/xml_parser.rb
89
91
  - relaton_ecma.gemspec