iev 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +4 -0
- data/.github/workflows/release.yml +4 -1
- data/.rubocop_todo.yml +12 -28
- data/Gemfile +10 -9
- data/bin/console +1 -1
- data/iev.gemspec +6 -9
- data/lib/iev/cli/ui.rb +1 -1
- data/lib/iev/cli.rb +4 -0
- data/lib/iev/converter.rb +2 -0
- data/lib/iev/data_conversions.rb +2 -0
- data/lib/iev/iso_639_code.rb +9 -7
- data/lib/iev/source_parser.rb +0 -1
- data/lib/iev/term_attrs_parser.rb +12 -4
- data/lib/iev/version.rb +1 -1
- data/lib/iev.rb +18 -8
- metadata +11 -26
- data/.hound.yml +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e35fa5a8cd6a260517986026015f363ac5114c548e44885a41a160d46e069a21
|
|
4
|
+
data.tar.gz: e412000b685994129c1fec6426e2e4795883d5dabccd6ffb67afc258b397ddd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84f480fd9eaccfa0ee7e457f19b55af593680f9f858a838599a97c09de56d33b1b3afcf16b9a3a4359932beca6eca56eab0b69183bc95e75b5e3b8cff1efecab
|
|
7
|
+
data.tar.gz: 2345069a32ad7ab2b08d80d1508c9b6cead36dcc2a549e2744bc7f37ccec857a63e6d672d8d8d1c4fb019c406e05ff8abb1a3827455857553ffe2462654cc574
|
data/.github/workflows/rake.yml
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
name: release
|
|
2
2
|
|
|
3
|
+
permissions:
|
|
4
|
+
contents: write
|
|
5
|
+
|
|
3
6
|
on:
|
|
4
7
|
workflow_dispatch:
|
|
5
8
|
inputs:
|
|
@@ -19,4 +22,4 @@ jobs:
|
|
|
19
22
|
next_version: ${{ github.event.inputs.next_version }}
|
|
20
23
|
secrets:
|
|
21
24
|
rubygems-api-key: ${{ secrets.GLOSSARIST_CI_RUBYGEMS_API_KEY }}
|
|
22
|
-
|
|
25
|
+
pat_token: ${{ secrets.GITHUB_TOKEN }}
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2025-
|
|
3
|
+
# on 2025-11-14 11:14:05 UTC using RuboCop version 1.81.7.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
10
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
|
|
12
|
-
# SupportedStyles: case, end
|
|
13
|
-
Layout/CaseIndentation:
|
|
14
|
-
Exclude:
|
|
15
|
-
- 'lib/iev/iso_639_code.rb'
|
|
16
|
-
|
|
17
|
-
# Offense count: 1
|
|
18
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
19
|
-
# Configuration parameters: EnforcedStyleAlignWith, Severity.
|
|
20
|
-
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
|
21
|
-
Layout/EndAlignment:
|
|
22
|
-
Exclude:
|
|
23
|
-
- 'lib/iev/iso_639_code.rb'
|
|
24
|
-
|
|
25
|
-
# Offense count: 45
|
|
9
|
+
# Offense count: 43
|
|
26
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
27
|
-
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
11
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
28
12
|
# URISchemes: http, https
|
|
29
13
|
Layout/LineLength:
|
|
30
14
|
Exclude:
|
|
15
|
+
- 'iev.gemspec'
|
|
31
16
|
- 'lib/iev/cli/command.rb'
|
|
32
17
|
- 'lib/iev/cli/command_helper.rb'
|
|
33
18
|
- 'lib/iev/db_cache.rb'
|
|
@@ -36,6 +21,13 @@ Layout/LineLength:
|
|
|
36
21
|
- 'spec/acceptance/xlsx2yaml_spec.rb'
|
|
37
22
|
- 'spec/iev_spec.rb'
|
|
38
23
|
|
|
24
|
+
# Offense count: 7
|
|
25
|
+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
|
|
26
|
+
Lint/DuplicateBranch:
|
|
27
|
+
Exclude:
|
|
28
|
+
- 'lib/iev/source_parser.rb'
|
|
29
|
+
- 'lib/iev/term_builder.rb'
|
|
30
|
+
|
|
39
31
|
# Offense count: 1
|
|
40
32
|
Lint/MixedRegexpCaptureTypes:
|
|
41
33
|
Exclude:
|
|
@@ -59,7 +51,7 @@ Metrics/CyclomaticComplexity:
|
|
|
59
51
|
- 'lib/iev/source_parser.rb'
|
|
60
52
|
- 'lib/iev/term_builder.rb'
|
|
61
53
|
|
|
62
|
-
# Offense count:
|
|
54
|
+
# Offense count: 20
|
|
63
55
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
64
56
|
Metrics/MethodLength:
|
|
65
57
|
Max: 74
|
|
@@ -71,11 +63,3 @@ Metrics/PerceivedComplexity:
|
|
|
71
63
|
- 'lib/iev.rb'
|
|
72
64
|
- 'lib/iev/converter/mathml_to_asciimath.rb'
|
|
73
65
|
- 'lib/iev/term_builder.rb'
|
|
74
|
-
|
|
75
|
-
# Offense count: 1
|
|
76
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
77
|
-
# Configuration parameters: EnforcedStyle.
|
|
78
|
-
# SupportedStyles: literals, strict
|
|
79
|
-
Style/MutableConstant:
|
|
80
|
-
Exclude:
|
|
81
|
-
- 'lib/iev/iso_639_code.rb'
|
data/Gemfile
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
source "https://rubygems.org"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
gem "
|
|
9
|
-
gem "
|
|
10
|
-
gem "rubocop"
|
|
11
|
-
gem "rubocop-
|
|
12
|
-
gem "rubocop-
|
|
13
|
-
gem "rubocop-rspec", require: false
|
|
5
|
+
gem "canon"
|
|
6
|
+
gem "openssl"
|
|
7
|
+
gem "rake"
|
|
8
|
+
gem "rspec"
|
|
9
|
+
gem "rubocop"
|
|
10
|
+
gem "rubocop-performance"
|
|
11
|
+
gem "rubocop-rake"
|
|
12
|
+
gem "rubocop-rspec"
|
|
14
13
|
gem "simplecov"
|
|
14
|
+
|
|
15
|
+
gemspec
|
data/bin/console
CHANGED
data/iev.gemspec
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
-
require "iev/version"
|
|
3
|
+
require_relative "lib/iev/version"
|
|
6
4
|
|
|
7
5
|
Gem::Specification.new do |spec|
|
|
8
6
|
spec.name = "iev"
|
|
@@ -10,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
|
10
8
|
spec.authors = ["Ribose Inc."]
|
|
11
9
|
spec.email = ["open.source@ribose.com"]
|
|
12
10
|
|
|
13
|
-
spec.summary = "
|
|
14
|
-
spec.description = "
|
|
15
|
-
spec.homepage = "https://github.com/
|
|
11
|
+
spec.summary = "Glossarist toolkit for working with IEV terms from Electropedia"
|
|
12
|
+
spec.description = "Glossarist toolkit for working with IEV terms from Electropedia"
|
|
13
|
+
spec.homepage = "https://github.com/glossarist/iev"
|
|
16
14
|
spec.license = "BSD-2-Clause"
|
|
17
15
|
|
|
18
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
@@ -23,14 +21,13 @@ Gem::Specification.new do |spec|
|
|
|
23
21
|
spec.require_paths = ["lib"]
|
|
24
22
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
|
25
23
|
|
|
26
|
-
spec.add_dependency "creek", "~> 2.
|
|
24
|
+
spec.add_dependency "creek", "~> 2.6"
|
|
27
25
|
spec.add_dependency "glossarist", ">= 2.3.0"
|
|
28
|
-
spec.add_dependency "nokogiri", "
|
|
26
|
+
spec.add_dependency "nokogiri", "~> 1.17"
|
|
29
27
|
spec.add_dependency "plurimath"
|
|
30
28
|
spec.add_dependency "relaton", "~> 1.18"
|
|
31
29
|
spec.add_dependency "sequel", "~> 5.40"
|
|
32
30
|
spec.add_dependency "sqlite3", "~> 1.7.0"
|
|
33
31
|
spec.add_dependency "thor", "~> 1.0"
|
|
34
32
|
spec.add_dependency "unitsml"
|
|
35
|
-
spec.add_dependency "zeitwerk", "~> 2.4"
|
|
36
33
|
end
|
data/lib/iev/cli/ui.rb
CHANGED
data/lib/iev/cli.rb
CHANGED
data/lib/iev/converter.rb
CHANGED
data/lib/iev/data_conversions.rb
CHANGED
data/lib/iev/iso_639_code.rb
CHANGED
|
@@ -7,16 +7,18 @@ module Iev
|
|
|
7
7
|
# @todo This needs to be rewritten.
|
|
8
8
|
class Iso639Code
|
|
9
9
|
COUNTRY_CODES = YAML.load(IO.read(File.join(__dir__, "iso_639_2.yaml")))
|
|
10
|
-
|
|
10
|
+
# rubocop:disable Style/MutableConstant
|
|
11
|
+
THREE_CHAR_MEMO = {} # Memoization cache, must be mutable
|
|
12
|
+
# rubocop:enable Style/MutableConstant
|
|
11
13
|
|
|
12
14
|
def initialize(two_char_code)
|
|
13
15
|
@code = case two_char_code.length
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
when 2
|
|
17
|
+
two_char_code
|
|
18
|
+
else
|
|
19
|
+
# This is to handle code "nl BE" in the Iev sheet
|
|
20
|
+
two_char_code.split.first
|
|
21
|
+
end
|
|
20
22
|
end
|
|
21
23
|
|
|
22
24
|
def find(code_type)
|
data/lib/iev/source_parser.rb
CHANGED
|
@@ -65,14 +65,22 @@ module Iev
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
def extract_gender(str)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
# Match gender either:
|
|
69
|
+
# 1. Inside brackets/parentheses: (m), [f], (n)
|
|
70
|
+
# 2. As standalone word with boundaries: m, f, n
|
|
71
|
+
gender_rx = /(?:\(|\[)[mfn](?:\)|\])|\b[mfn]\b/
|
|
72
|
+
|
|
73
|
+
match = remove_from_string(str, gender_rx)
|
|
74
|
+
# Extract just the letter from the match (remove brackets if present)
|
|
75
|
+
@gender = match&.gsub(/[\[\]()]/, "")
|
|
71
76
|
end
|
|
72
77
|
|
|
73
78
|
# Must happen after #extract_gender
|
|
74
79
|
def extract_plurality(str)
|
|
75
|
-
|
|
80
|
+
# Match plurality either:
|
|
81
|
+
# 1. Inside brackets/parentheses: (pl), [pl]
|
|
82
|
+
# 2. As standalone word with boundaries: pl
|
|
83
|
+
plural_rx = /(?:\(|\[)pl(?:\)|\])|\bpl\b/
|
|
76
84
|
|
|
77
85
|
if remove_from_string(str, plural_rx)
|
|
78
86
|
@plurality = "plural"
|
data/lib/iev/version.rb
CHANGED
data/lib/iev.rb
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require "iev/db"
|
|
3
|
+
require_relative "iev/version"
|
|
5
4
|
require "open-uri"
|
|
6
5
|
require "nokogiri"
|
|
7
6
|
|
|
@@ -15,17 +14,28 @@ require "relaton_bib"
|
|
|
15
14
|
require "sequel"
|
|
16
15
|
require "thor"
|
|
17
16
|
require "yaml"
|
|
18
|
-
require "zeitwerk"
|
|
19
|
-
|
|
20
|
-
loader = Zeitwerk::Loader.for_gem
|
|
21
|
-
loader.setup
|
|
22
17
|
|
|
23
18
|
module Iev
|
|
19
|
+
autoload :Cli, "iev/cli"
|
|
20
|
+
autoload :Converter, "iev/converter"
|
|
21
|
+
autoload :DataConversions, "iev/data_conversions"
|
|
22
|
+
autoload :Db, "iev/db"
|
|
23
|
+
autoload :DbCache, "iev/db_cache"
|
|
24
|
+
autoload :DbWriter, "iev/db_writer"
|
|
25
|
+
autoload :Iso639Code, "iev/iso_639_code"
|
|
26
|
+
autoload :Profiler, "iev/profiler"
|
|
27
|
+
autoload :RelatonDb, "iev/relaton_db"
|
|
28
|
+
autoload :SourceParser, "iev/source_parser"
|
|
29
|
+
autoload :SupersessionParser, "iev/supersession_parser"
|
|
30
|
+
autoload :TermAttrsParser, "iev/term_attrs_parser"
|
|
31
|
+
autoload :TermBuilder, "iev/term_builder"
|
|
32
|
+
autoload :Utilities, "iev/utilities"
|
|
33
|
+
|
|
24
34
|
#
|
|
25
35
|
# Scrape Electropedia for term.
|
|
26
36
|
#
|
|
27
37
|
# @param [String] code for example "103-01-02"
|
|
28
|
-
# @param [String] lang language code, for
|
|
38
|
+
# @param [String] lang language code, for example "en"
|
|
29
39
|
#
|
|
30
40
|
# @return [String, nil] if found than term,
|
|
31
41
|
# if code not found then empty string,
|
|
@@ -44,4 +54,4 @@ module Iev
|
|
|
44
54
|
end
|
|
45
55
|
end
|
|
46
56
|
|
|
47
|
-
|
|
57
|
+
require_relative "iev/cli"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: iev
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: creek
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.
|
|
19
|
+
version: '2.6'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '2.
|
|
26
|
+
version: '2.6'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: glossarist
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -42,16 +42,16 @@ dependencies:
|
|
|
42
42
|
name: nokogiri
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 1.
|
|
47
|
+
version: '1.17'
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 1.
|
|
54
|
+
version: '1.17'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: plurimath
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -136,21 +136,7 @@ dependencies:
|
|
|
136
136
|
- - ">="
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
138
|
version: '0'
|
|
139
|
-
|
|
140
|
-
name: zeitwerk
|
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
|
142
|
-
requirements:
|
|
143
|
-
- - "~>"
|
|
144
|
-
- !ruby/object:Gem::Version
|
|
145
|
-
version: '2.4'
|
|
146
|
-
type: :runtime
|
|
147
|
-
prerelease: false
|
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
-
requirements:
|
|
150
|
-
- - "~>"
|
|
151
|
-
- !ruby/object:Gem::Version
|
|
152
|
-
version: '2.4'
|
|
153
|
-
description: 'Iev: Fetch and encode Iev term from Electropedia'
|
|
139
|
+
description: Glossarist toolkit for working with IEV terms from Electropedia
|
|
154
140
|
email:
|
|
155
141
|
- open.source@ribose.com
|
|
156
142
|
executables:
|
|
@@ -161,7 +147,6 @@ files:
|
|
|
161
147
|
- ".github/workflows/rake.yml"
|
|
162
148
|
- ".github/workflows/release.yml"
|
|
163
149
|
- ".gitignore"
|
|
164
|
-
- ".hound.yml"
|
|
165
150
|
- ".rspec"
|
|
166
151
|
- ".rubocop.yml"
|
|
167
152
|
- ".rubocop_todo.yml"
|
|
@@ -194,7 +179,7 @@ files:
|
|
|
194
179
|
- lib/iev/term_builder.rb
|
|
195
180
|
- lib/iev/utilities.rb
|
|
196
181
|
- lib/iev/version.rb
|
|
197
|
-
homepage: https://github.com/
|
|
182
|
+
homepage: https://github.com/glossarist/iev
|
|
198
183
|
licenses:
|
|
199
184
|
- BSD-2-Clause
|
|
200
185
|
metadata: {}
|
|
@@ -216,5 +201,5 @@ requirements: []
|
|
|
216
201
|
rubygems_version: 3.5.22
|
|
217
202
|
signing_key:
|
|
218
203
|
specification_version: 4
|
|
219
|
-
summary:
|
|
204
|
+
summary: Glossarist toolkit for working with IEV terms from Electropedia
|
|
220
205
|
test_files: []
|