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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ef95bd483f8056cb7238fba5a2c701879f1d51250627250a8c10dec04da9df0
4
- data.tar.gz: 9fe8e9bdc77e630c36edf6f8500b9b91d62a2c10395664798304719161860545
3
+ metadata.gz: 79d43dceae558b747d74a01b42f0ca9b5092501cdc6a529ca8d90580e7772625
4
+ data.tar.gz: 8bf3da4bee3131caf9782a6e20cb4da5976f7c8cbbc0032fef9ef7b5fcc8f377
5
5
  SHA512:
6
- metadata.gz: e224dd6e334eecf6bf9e8cdfbca206aabfbfc42967479625db0f677dddabe6b6dc3c7d9eb77f2462e140aac762c0707d35b8252884879f71f3de727b37443e55
7
- data.tar.gz: 0a17ff365ff523f83e553c376b4d53b58df84fd2916e00dbcb874a10a017eb5c78e9c3285bf1355de5f572faeb5bb5ae1aabc76611699e205368cfaf7bbf6a73
6
+ metadata.gz: 7aafe34229df42657d84f8514db455e6e475da9474b7e8bd22582ce156a1ffc874726c453c7af489bfecfa363af834a09ffe57afb8ae8b21c56f541ac139f6ee
7
+ data.tar.gz: dbe30c1a6d75d28a1064b6b4d6864f9592d96817c4345eb016720f51f299de5a46df6382c98178dffaec74aac808f00dcec9e9b4dc710808816a54f04f1a5901
@@ -12,4 +12,4 @@ jobs:
12
12
  rake:
13
13
  uses: metanorma/ci/.github/workflows/generic-rake.yml@main
14
14
  secrets:
15
- pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
15
+ pat_token: ${{ secrets.GLOSSARIST_CI_PAT_TOKEN }}
data/README.adoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == Commands
4
4
 
5
- generate_latex: Convert Concepts to Latex format
5
+ `generate_latex`: Convert Concepts to Latex format
6
6
 
7
7
  === Usage:
8
8
  glossarist generate_latex p, --concepts-path=CONCEPTS_PATH
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.13.0"
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
- super().merge({
17
- "type" => type.to_s,
16
+ type_hash = {
17
+ "type" => "abbreviation",
18
18
  "international" => international,
19
- }).compact
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
 
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "1.0.5"
7
+ VERSION = "1.0.6"
8
8
  end
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.5
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-03-21 00:00:00.000000000 Z
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.13.0
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.13.0
26
+ version: 1.14.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement