relaton-bsi 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 +4 -4
- data/.github/workflows/release.yml +2 -1
- data/.rubocop.yml +1 -1
- data/Gemfile +7 -1
- data/grammars/biblio.rng +1 -1
- data/lib/relaton_bsi/bsi_bibliographic_item.rb +2 -2
- data/lib/relaton_bsi/bsi_bibliography.rb +6 -15
- data/lib/relaton_bsi/config.rb +10 -0
- data/lib/relaton_bsi/util.rb +9 -0
- data/lib/relaton_bsi/version.rb +1 -1
- data/lib/relaton_bsi.rb +13 -4
- data/relaton_bsi.gemspec +6 -14
- metadata +7 -89
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 021f994bae1987a1d8dadd5b1c9425bdcb1aad9c69d62d3e4cb3d388d55bd6d7
|
4
|
+
data.tar.gz: c96491e47dcd93b9281bd1deed2c5e0d1f72984c0aea401966e919dc4634b7a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6b400c1153a40ede7766a6fce3be936114806d600d620eeaceb90ef521c439cb125ae3b53ca27df1dd536ed94366a33fce85e5aedfe0374ab0ebc7231a744e1
|
7
|
+
data.tar.gz: 51bc43147ec74f564d0e37aa97c29622b46554e4d4adba720ef46f1271827e16efd4bd7c23a4c239151d9ff42c97cceee009d35c9a67c9358f967002549e960f
|
@@ -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/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/grammars/biblio.rng
CHANGED
@@ -11,8 +11,8 @@ module RelatonBsi
|
|
11
11
|
|
12
12
|
def initialize(**args) # rubocop:disable Metrics/AbcSize
|
13
13
|
if args[:subdoctype] && !SUBDOCTYPES.include?(args[:subdoctype])
|
14
|
-
warn "
|
15
|
-
warn "
|
14
|
+
Util.warn "WARNING: invalid subdoctype: `#{args[:subdoctype]}`"
|
15
|
+
Util.warn "Allowed subdoctypes are: `#{SUBDOCTYPES.join('`, `')}`"
|
16
16
|
end
|
17
17
|
super
|
18
18
|
end
|
@@ -1,14 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# require "mechanize"
|
4
|
-
require "relaton_iso_bib"
|
5
|
-
require "relaton_bsi/bsi_bibliographic_item"
|
6
|
-
require "relaton_bsi/scrapper"
|
7
|
-
require "relaton_bsi/hit_collection"
|
8
|
-
require "relaton_bsi/hit"
|
9
|
-
require "relaton_bsi/xml_parser"
|
10
|
-
require "relaton_bsi/hash_converter"
|
11
|
-
|
12
3
|
module RelatonBsi
|
13
4
|
# Class methods for search ISO standards.
|
14
5
|
class BsiBibliography
|
@@ -64,11 +55,11 @@ module RelatonBsi
|
|
64
55
|
def fetch_ref_err(code, year, missed_years) # rubocop:disable Metrics/MethodLength
|
65
56
|
y = code_parts(code)[:year]
|
66
57
|
id = year && !y ? "#{code}:#{year}" : code
|
67
|
-
warn "
|
68
|
-
|
58
|
+
Util.warn "WARNING: no match found online for `#{id}`. " \
|
59
|
+
"The code must be exactly like it is on the standards website."
|
69
60
|
unless missed_years.empty?
|
70
|
-
warn "
|
71
|
-
|
61
|
+
Util.warn "(There was no match for `#{year}`, though there " \
|
62
|
+
"were matches found for `#{missed_years.join('`, `')}`.)"
|
72
63
|
end
|
73
64
|
# if /\d-\d/.match? code
|
74
65
|
# warn "[relaton-bsi] The provided document part may not exist, or "\
|
@@ -91,7 +82,7 @@ module RelatonBsi
|
|
91
82
|
#
|
92
83
|
def search_filter(code)
|
93
84
|
cp = code_parts code
|
94
|
-
warn "
|
85
|
+
Util.warn "(#{code}) fetching..."
|
95
86
|
return [] unless cp
|
96
87
|
|
97
88
|
search(code).filter_hits!(cp)
|
@@ -121,7 +112,7 @@ module RelatonBsi
|
|
121
112
|
result = search_filter(code) || return
|
122
113
|
ret = results_filter(result, year)
|
123
114
|
if ret[:ret]
|
124
|
-
warn "
|
115
|
+
Util.warn "(#{code}) found `#{ret[:ret].docidentifier.first&.id}`"
|
125
116
|
ret[:ret]
|
126
117
|
else
|
127
118
|
fetch_ref_err(code, year, ret[:years])
|
data/lib/relaton_bsi/version.rb
CHANGED
data/lib/relaton_bsi.rb
CHANGED
@@ -1,15 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "relaton_iso_bib"
|
3
4
|
require_relative "relaton_bsi/version"
|
5
|
+
require "relaton_bsi/config"
|
6
|
+
require "relaton_bsi/util"
|
4
7
|
require "relaton_bsi/bsi_bibliography"
|
8
|
+
require "relaton_bsi/bsi_bibliographic_item"
|
9
|
+
require "relaton_bsi/scrapper"
|
10
|
+
require "relaton_bsi/hit_collection"
|
11
|
+
require "relaton_bsi/hit"
|
12
|
+
require "relaton_bsi/xml_parser"
|
13
|
+
require "relaton_bsi/hash_converter"
|
5
14
|
|
6
15
|
module RelatonBsi
|
7
16
|
# Returns hash of XML greammar
|
8
17
|
# @return [String]
|
9
18
|
def self.grammar_hash
|
10
|
-
gem_path = File.expand_path "..", __dir__
|
11
|
-
grammars_path = File.join gem_path, "grammars", "*"
|
12
|
-
grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
13
|
-
Digest::MD5.hexdigest grammars
|
19
|
+
# gem_path = File.expand_path "..", __dir__
|
20
|
+
# grammars_path = File.join gem_path, "grammars", "*"
|
21
|
+
# grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
22
|
+
Digest::MD5.hexdigest RelatonBsi::VERSION + RelatonIsoBib::VERSION + RelatonBib::VERSION # grammars
|
14
23
|
end
|
15
24
|
end
|
data/relaton_bsi.gemspec
CHANGED
@@ -8,13 +8,13 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Ribose Inc."]
|
9
9
|
spec.email = ["open.source@ribose.com"]
|
10
10
|
|
11
|
-
spec.summary = "RelatonBsi: retrieve BSI Standards for bibliographic
|
12
|
-
"using the BibliographicItem model"
|
13
|
-
spec.description = "RelatonBsi: retrieve BSI Standards for bibliographic
|
14
|
-
"using the BibliographicItem model"
|
11
|
+
spec.summary = "RelatonBsi: retrieve BSI Standards for bibliographic " \
|
12
|
+
"use using the BibliographicItem model"
|
13
|
+
spec.description = "RelatonBsi: retrieve BSI Standards for bibliographic " \
|
14
|
+
"use using the BibliographicItem model"
|
15
15
|
spec.homepage = "https://github.com/metanorma/relaton-bsi"
|
16
16
|
spec.license = "BSD-2-Clause"
|
17
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
18
18
|
|
19
19
|
spec.metadata["homepage_uri"] = spec.homepage
|
20
20
|
spec.metadata["source_code_uri"] = spec.homepage
|
@@ -29,16 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
33
|
-
spec.add_development_dependency "pry-byebug"
|
34
|
-
spec.add_development_dependency "ruby-jing"
|
35
|
-
spec.add_development_dependency "simplecov"
|
36
|
-
spec.add_development_dependency "vcr", "~> 5.0.0"
|
37
|
-
spec.add_development_dependency "webmock"
|
38
|
-
|
39
32
|
spec.add_dependency "algolia", "~> 2.3.0"
|
40
33
|
spec.add_dependency "graphql", "1.13.6"
|
41
34
|
spec.add_dependency "graphql-client", "~> 0.16.0"
|
42
|
-
|
43
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.14.0"
|
35
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.16.0"
|
44
36
|
end
|
metadata
CHANGED
@@ -1,99 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bsi
|
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
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: equivalent-xml
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.6'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
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
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: ruby-jing
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: simplecov
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
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: vcr
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 5.0.0
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 5.0.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: webmock
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
13
|
- !ruby/object:Gem::Dependency
|
98
14
|
name: algolia
|
99
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +58,14 @@ dependencies:
|
|
142
58
|
requirements:
|
143
59
|
- - "~>"
|
144
60
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
61
|
+
version: 1.16.0
|
146
62
|
type: :runtime
|
147
63
|
prerelease: false
|
148
64
|
version_requirements: !ruby/object:Gem::Requirement
|
149
65
|
requirements:
|
150
66
|
- - "~>"
|
151
67
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
68
|
+
version: 1.16.0
|
153
69
|
description: 'RelatonBsi: retrieve BSI Standards for bibliographic use using the BibliographicItem
|
154
70
|
model'
|
155
71
|
email:
|
@@ -178,12 +94,14 @@ files:
|
|
178
94
|
- lib/relaton_bsi.rb
|
179
95
|
- lib/relaton_bsi/bsi_bibliographic_item.rb
|
180
96
|
- lib/relaton_bsi/bsi_bibliography.rb
|
97
|
+
- lib/relaton_bsi/config.rb
|
181
98
|
- lib/relaton_bsi/hash_converter.rb
|
182
99
|
- lib/relaton_bsi/hit.rb
|
183
100
|
- lib/relaton_bsi/hit_collection.rb
|
184
101
|
- lib/relaton_bsi/processor.rb
|
185
102
|
- lib/relaton_bsi/schema.json
|
186
103
|
- lib/relaton_bsi/scrapper.rb
|
104
|
+
- lib/relaton_bsi/util.rb
|
187
105
|
- lib/relaton_bsi/version.rb
|
188
106
|
- lib/relaton_bsi/xml_parser.rb
|
189
107
|
- relaton_bsi.gemspec
|
@@ -201,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
119
|
requirements:
|
202
120
|
- - ">="
|
203
121
|
- !ruby/object:Gem::Version
|
204
|
-
version: 2.
|
122
|
+
version: 2.7.0
|
205
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
124
|
requirements:
|
207
125
|
- - ">="
|