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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 664ac75d413b97705481a3d457f61e511f5e34a7261ea7b257ace3e37e28a0f2
4
- data.tar.gz: 4d288a818b8fb20e5c469ef79bbe0ea6e0a1e8a2ea4692c9f60e7f56931f5ca7
3
+ metadata.gz: 021f994bae1987a1d8dadd5b1c9425bdcb1aad9c69d62d3e4cb3d388d55bd6d7
4
+ data.tar.gz: c96491e47dcd93b9281bd1deed2c5e0d1f72984c0aea401966e919dc4634b7a9
5
5
  SHA512:
6
- metadata.gz: fd95f20ee76e03e06823024f4a45ae7f7a1ae9c0954fd6fd6e7aa97e0cb02550de2b6810cec29fe024bafb8966a6096f06f3b06b92b12292f69f1a0ea12f661f
7
- data.tar.gz: '08644bdc1500ae711d927a9db30a912f406d4a7fd36aeb0f7c6539ce12cebe70bc7a489fd607538965ec0d9dfaef82c6c6c755c6a7e5e38170e25c7abc8e898f'
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
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 2.7
11
11
  Rails:
12
12
  Enabled: false
data/Gemfile CHANGED
@@ -6,5 +6,11 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
-
10
9
  gem "rspec", "~> 3.0"
10
+
11
+ gem "equivalent-xml", "~> 0.6"
12
+ gem "pry-byebug"
13
+ gem "ruby-jing"
14
+ gem "simplecov"
15
+ gem "vcr"
16
+ gem "webmock"
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>
@@ -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 "[relaton-bsi] WARNING: invalid subdoctype: #{args[:subdoctype]}"
15
- warn "[relaton-bsi] Allowed subdoctypes are: #{SUBDOCTYPES.join(', ')}"
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 "[relaton-bsi] WARNING: no match found online for #{id}. "\
68
- "The code must be exactly like it is on the standards website."
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 "[relaton-bsi] (There was no match for #{year}, though there "\
71
- "were matches found for #{missed_years.join(', ')}.)"
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 "[relaton-bsi] (\"#{code}\") fetching..."
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 "[relaton-bsi] (\"#{code}\") found #{ret[:ret].docidentifier.first&.id}"
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])
@@ -0,0 +1,10 @@
1
+ module RelatonBsi
2
+ module Config
3
+ include RelatonBib::Config
4
+ end
5
+ extend Config
6
+
7
+ class Configuration < RelatonBib::Configuration
8
+ PROGNAME = "relaton-bsi".freeze
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module RelatonBsi
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonBsi.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonBsi
4
- VERSION = "1.14.6"
4
+ VERSION = "1.16.1"
5
5
  end
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 use "\
12
- "using the BibliographicItem model"
13
- spec.description = "RelatonBsi: retrieve BSI Standards for bibliographic use "\
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.5.0")
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
- # spec.add_dependency "mechanize", "~> 2.8.0"
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.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-05-15 00:00:00.000000000 Z
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.14.0
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.14.0
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.5.0
122
+ version: 2.7.0
205
123
  required_rubygems_version: !ruby/object:Gem::Requirement
206
124
  requirements:
207
125
  - - ">="