relaton-bipm 1.14.11 → 1.16.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/release.yml +2 -1
- data/grammars/biblio.rng +1 -1
- data/lib/relaton_bipm/bipm_bibliographic_item.rb +4 -4
- data/lib/relaton_bipm/bipm_bibliography.rb +3 -3
- data/lib/relaton_bipm/committee.rb +2 -2
- data/lib/relaton_bipm/config.rb +10 -0
- data/lib/relaton_bipm/id_parser.rb +1 -1
- data/lib/relaton_bipm/util.rb +9 -0
- data/lib/relaton_bipm/version.rb +1 -1
- data/lib/relaton_bipm.rb +6 -4
- data/relaton_bipm.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24d544bd3daad314cd7af5b723c53765c4dfaedc5fe1cd56bfd4352dd9901a72
|
4
|
+
data.tar.gz: '0309c87fe248963a2fec6d1a9fd1eadfc99158a55e8e6a8e9fdf7cc00f3e6add'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a125b70df0a8cfaafb3acb4adc7fbf8dc429c05208def6658927302e9880009bc6a9d471c24ca7c0cf5257484297c75ad020d282eafa99cad1230e9048957eba
|
7
|
+
data.tar.gz: b7041bf466e72998494a9ebeeec12b7d26ca504a47125e2b47e4903a996a4756c6f04926fc5818f9cffb61601be2ef2e91b6e8a25b20b2c294cd7e45996cc6ff
|
@@ -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
@@ -27,13 +27,13 @@ module RelatonBipm
|
|
27
27
|
# @param structuredidentifier [RelatonBipm::StructuredIdentifier]
|
28
28
|
def initialize(**args) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
29
29
|
if args[:docstatus] && !STATUSES.include?(args[:docstatus].stage.value)
|
30
|
-
warn "
|
31
|
-
|
30
|
+
Util.warn "Warning: invalid docstatus: `#{args[:docstatus].stage.value}`. " \
|
31
|
+
"It should be one of: `#{STATUSES.join('`, `')}`"
|
32
32
|
end
|
33
33
|
|
34
34
|
if args[:si_aspect] && !SI_ASPECTS.include?(args[:si_aspect])
|
35
|
-
warn "
|
36
|
-
|
35
|
+
Util.warn "Warning: invalid si_aspect: `#{args[:si_aspect]}``. " \
|
36
|
+
"It should be one of: `#{SI_ASPECTS.join('`, `')}`"
|
37
37
|
end
|
38
38
|
|
39
39
|
@comment_period = args.delete :comment_period
|
@@ -9,15 +9,15 @@ module RelatonBipm
|
|
9
9
|
# @param text [String]
|
10
10
|
# @return [RelatonBipm::BipmBibliographicItem]
|
11
11
|
def search(text, _year = nil, _opts = {}) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
12
|
-
warn "
|
12
|
+
Util.warn "(#{text}) fetching..."
|
13
13
|
ref = text.sub(/^BIPM\s/, "")
|
14
14
|
item = get_bipm(ref, magent)
|
15
15
|
unless item
|
16
|
-
warn "
|
16
|
+
Util.warn "(#{text}) not found."
|
17
17
|
return
|
18
18
|
end
|
19
19
|
|
20
|
-
warn("
|
20
|
+
Util.warn("(#{text}) found `#{item.docidentifier[0].id}`")
|
21
21
|
item
|
22
22
|
rescue Mechanize::ResponseCodeError => e
|
23
23
|
raise RelatonBib::RequestError, e.message unless e.response_code == "404"
|
@@ -11,8 +11,8 @@ module RelatonBipm
|
|
11
11
|
def initialize(acronym:, content: nil)
|
12
12
|
acronyms = YAML.load_file File.join(__dir__, "acronyms.yaml")
|
13
13
|
unless acronyms[acronym]
|
14
|
-
warn "
|
15
|
-
|
14
|
+
Util.warn "WARNING: invalid acronym: `#{acronym}`. Allowed " \
|
15
|
+
"values: `#{acronyms.map { |k, _v| k }.join '`, `'}`"
|
16
16
|
end
|
17
17
|
|
18
18
|
@acronym = acronym
|
@@ -76,7 +76,7 @@ module RelatonBipm
|
|
76
76
|
def initialize(id)
|
77
77
|
@id = Parser.new.parse(id)
|
78
78
|
rescue Parslet::ParseFailed => e
|
79
|
-
warn "
|
79
|
+
Util.warn "Incorrect reference: `#{id}`"
|
80
80
|
# warn "[relaton-bipm] #{e.parse_failure_cause.ascii_tree}"
|
81
81
|
raise RelatonBib::RequestError, e
|
82
82
|
end
|
data/lib/relaton_bipm/version.rb
CHANGED
data/lib/relaton_bipm.rb
CHANGED
@@ -3,6 +3,8 @@ require "fileutils"
|
|
3
3
|
require "parslet"
|
4
4
|
require "relaton_bib"
|
5
5
|
require "relaton/index"
|
6
|
+
require "relaton_bipm/config"
|
7
|
+
require "relaton_bipm/util"
|
6
8
|
require "relaton_bipm/id_parser"
|
7
9
|
require "relaton_bipm/version"
|
8
10
|
require "relaton_bipm/editorial_group"
|
@@ -28,10 +30,10 @@ module RelatonBipm
|
|
28
30
|
# Returns hash of XML reammar
|
29
31
|
# @return [String]
|
30
32
|
def grammar_hash
|
31
|
-
gem_path = File.expand_path "..", __dir__
|
32
|
-
grammars_path = File.join gem_path, "grammars", "*"
|
33
|
-
grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
34
|
-
Digest::MD5.hexdigest grammars
|
33
|
+
# gem_path = File.expand_path "..", __dir__
|
34
|
+
# grammars_path = File.join gem_path, "grammars", "*"
|
35
|
+
# grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
36
|
+
Digest::MD5.hexdigest RelatonBipm::VERSION + RelatonBib::VERSION # grammars
|
35
37
|
end
|
36
38
|
|
37
39
|
extend self
|
data/relaton_bipm.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
35
35
|
spec.add_dependency "faraday", "~> 2.7.0"
|
36
36
|
spec.add_dependency "mechanize", "~> 2.8.0"
|
37
37
|
spec.add_dependency "parslet", "~> 2.0.0"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
38
|
+
spec.add_dependency "relaton-bib", "~> 1.16.0"
|
39
39
|
spec.add_dependency "relaton-index", "~> 0.2.2"
|
40
40
|
spec.add_dependency "rubyzip", "~> 2.3.0"
|
41
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bipm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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-
|
11
|
+
date: 2023-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.16.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.16.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: relaton-index
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- lib/relaton_bipm/bipm_si_brochure_parser.rb
|
128
128
|
- lib/relaton_bipm/comment_periond.rb
|
129
129
|
- lib/relaton_bipm/committee.rb
|
130
|
+
- lib/relaton_bipm/config.rb
|
130
131
|
- lib/relaton_bipm/data_fetcher.rb
|
131
132
|
- lib/relaton_bipm/data_outcomes_parser.rb
|
132
133
|
- lib/relaton_bipm/document_relation.rb
|
@@ -137,6 +138,7 @@ files:
|
|
137
138
|
- lib/relaton_bipm/rawdata_bipm_metrologia/article_parser.rb
|
138
139
|
- lib/relaton_bipm/rawdata_bipm_metrologia/fetcher.rb
|
139
140
|
- lib/relaton_bipm/structured_identifier.rb
|
141
|
+
- lib/relaton_bipm/util.rb
|
140
142
|
- lib/relaton_bipm/version.rb
|
141
143
|
- lib/relaton_bipm/workgroup.rb
|
142
144
|
- lib/relaton_bipm/xml_parser.rb
|