glossarist 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/README.adoc +1 -1
- data/glossarist.gemspec +1 -1
- data/lib/glossarist/designation/abbreviation.rb +7 -3
- data/lib/glossarist/localized_concept.rb +1 -0
- data/lib/glossarist/managed_concept.rb +12 -0
- data/lib/glossarist/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79d43dceae558b747d74a01b42f0ca9b5092501cdc6a529ca8d90580e7772625
|
4
|
+
data.tar.gz: 8bf3da4bee3131caf9782a6e20cb4da5976f7c8cbbc0032fef9ef7b5fcc8f377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aafe34229df42657d84f8514db455e6e475da9474b7e8bd22582ce156a1ffc874726c453c7af489bfecfa363af834a09ffe57afb8ae8b21c56f541ac139f6ee
|
7
|
+
data.tar.gz: dbe30c1a6d75d28a1064b6b4d6864f9592d96817c4345eb016720f51f299de5a46df6382c98178dffaec74aac808f00dcec9e9b4dc710808816a54f04f1a5901
|
data/.github/workflows/rake.yml
CHANGED
data/README.adoc
CHANGED
data/glossarist.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
|
-
spec.add_dependency "relaton", "~>1.
|
33
|
+
spec.add_dependency "relaton", "~>1.14.0"
|
34
34
|
spec.add_dependency "thor"
|
35
35
|
|
36
36
|
spec.add_development_dependency "pry", "~> 0.14.0"
|
@@ -13,10 +13,14 @@ module Glossarist
|
|
13
13
|
attr_accessor :international
|
14
14
|
|
15
15
|
def to_h
|
16
|
-
|
17
|
-
"type" =>
|
16
|
+
type_hash = {
|
17
|
+
"type" => "abbreviation",
|
18
18
|
"international" => international,
|
19
|
-
}
|
19
|
+
}
|
20
|
+
|
21
|
+
type_hash[type.to_s] = true if type
|
22
|
+
|
23
|
+
super().merge(type_hash).compact
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
@@ -37,6 +37,7 @@ module Glossarist
|
|
37
37
|
def to_h # rubocop:disable Metrics/MethodLength
|
38
38
|
super.merge({
|
39
39
|
"language_code" => language_code,
|
40
|
+
"domain" => domain,
|
40
41
|
"entry_status" => entry_status,
|
41
42
|
"sources" => sources.empty? ? nil : sources&.map(&:to_h),
|
42
43
|
"classification" => classification,
|
@@ -21,6 +21,10 @@ module Glossarist
|
|
21
21
|
# return [Array<LocalizedConcept>]
|
22
22
|
attr_reader :localized_concepts
|
23
23
|
|
24
|
+
# Concept group
|
25
|
+
# @return [Array<String>]
|
26
|
+
attr_reader :groups
|
27
|
+
|
24
28
|
# All localizations for this concept.
|
25
29
|
#
|
26
30
|
# Keys are language codes and values are instances of {LocalizedConcept}.
|
@@ -53,6 +57,12 @@ module Glossarist
|
|
53
57
|
@dates = dates&.map { |d| ConceptDate.new(d) }
|
54
58
|
end
|
55
59
|
|
60
|
+
def groups=(groups)
|
61
|
+
return unless groups
|
62
|
+
|
63
|
+
@groups = groups.is_a?(Array) ? groups : [groups]
|
64
|
+
end
|
65
|
+
|
56
66
|
# Adds concept localization.
|
57
67
|
# @param localized_concept [LocalizedConcept]
|
58
68
|
def add_localization(localized_concept)
|
@@ -77,6 +87,7 @@ module Glossarist
|
|
77
87
|
"term" => default_designation,
|
78
88
|
"related" => related&.map(&:to_h),
|
79
89
|
"dates" => dates&.empty? ? nil : dates&.map(&:to_h),
|
90
|
+
"groups" => groups,
|
80
91
|
}.merge(localizations.transform_values(&:to_h)).compact
|
81
92
|
end
|
82
93
|
|
@@ -102,6 +113,7 @@ module Glossarist
|
|
102
113
|
status
|
103
114
|
dates
|
104
115
|
localized_concepts
|
116
|
+
groups
|
105
117
|
].compact
|
106
118
|
end
|
107
119
|
|
data/lib/glossarist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glossarist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.14.0
|
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: 1.
|
26
|
+
version: 1.14.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|