glossarist 0.2.0 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +15 -0
  3. data/.github/workflows/release.yml +24 -0
  4. data/.gitignore +2 -0
  5. data/.hound.yml +3 -1
  6. data/.rubocop.yml +4 -29
  7. data/README.adoc +23 -0
  8. data/config.yml +83 -0
  9. data/exe/glossarist +50 -0
  10. data/glossarist.gemspec +4 -1
  11. data/lib/glossarist/asset.rb +22 -0
  12. data/lib/glossarist/citation.rb +89 -0
  13. data/lib/glossarist/collections/asset_collection.rb +11 -0
  14. data/lib/glossarist/collections/bibliography_collection.rb +25 -0
  15. data/lib/glossarist/collections.rb +2 -0
  16. data/lib/glossarist/concept.rb +96 -31
  17. data/lib/glossarist/concept_date.rb +20 -0
  18. data/lib/glossarist/concept_manager.rb +44 -0
  19. data/lib/glossarist/concept_set.rb +80 -0
  20. data/lib/glossarist/concept_source.rb +62 -0
  21. data/lib/glossarist/config.rb +54 -0
  22. data/lib/glossarist/designation/abbreviation.rb +23 -0
  23. data/lib/glossarist/designation/base.rb +37 -0
  24. data/lib/glossarist/designation/expression.rb +50 -0
  25. data/lib/glossarist/designation/grammar_info.rb +58 -0
  26. data/lib/glossarist/designation/graphical_symbol.rb +17 -0
  27. data/lib/glossarist/designation/letter_symbol.rb +19 -0
  28. data/lib/glossarist/designation/symbol.rb +21 -0
  29. data/lib/glossarist/designation.rb +27 -0
  30. data/lib/glossarist/detailed_definition.rb +31 -0
  31. data/lib/glossarist/glossary_definition.rb +29 -0
  32. data/lib/glossarist/localized_concept.rb +10 -59
  33. data/lib/glossarist/managed_concept.rb +116 -0
  34. data/lib/glossarist/managed_concept_collection.rb +79 -0
  35. data/lib/glossarist/model.rb +12 -2
  36. data/lib/glossarist/non_verb_rep.rb +18 -0
  37. data/lib/glossarist/related_concept.rb +31 -0
  38. data/lib/glossarist/utilities/boolean_attributes.rb +35 -0
  39. data/lib/glossarist/utilities/common_functions.rb +29 -0
  40. data/lib/glossarist/utilities/enum/class_methods.rb +99 -0
  41. data/lib/glossarist/utilities/enum/enum_collection.rb +45 -0
  42. data/lib/glossarist/utilities/enum/instance_methods.rb +55 -0
  43. data/lib/glossarist/utilities/enum.rb +21 -0
  44. data/lib/glossarist/utilities.rb +5 -0
  45. data/lib/glossarist/version.rb +1 -1
  46. data/lib/glossarist.rb +27 -2
  47. metadata +69 -7
  48. data/.github/workflows/test.yml +0 -34
  49. data/lib/glossarist/designations.rb +0 -82
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glossarist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-02 00:00:00.000000000 Z
11
+ date: 2023-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: relaton
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.13.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.13.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: pry
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -55,12 +83,14 @@ dependencies:
55
83
  description:
56
84
  email:
57
85
  - open.source@ribose.com
58
- executables: []
86
+ executables:
87
+ - glossarist
59
88
  extensions: []
60
89
  extra_rdoc_files: []
61
90
  files:
62
91
  - ".editorconfig"
63
- - ".github/workflows/test.yml"
92
+ - ".github/workflows/rake.yml"
93
+ - ".github/workflows/release.yml"
64
94
  - ".gitignore"
65
95
  - ".hound.yml"
66
96
  - ".rspec"
@@ -69,13 +99,45 @@ files:
69
99
  - LICENSE.txt
70
100
  - README.adoc
71
101
  - Rakefile
102
+ - config.yml
103
+ - exe/glossarist
72
104
  - glossarist.gemspec
73
105
  - lib/glossarist.rb
106
+ - lib/glossarist/asset.rb
107
+ - lib/glossarist/citation.rb
74
108
  - lib/glossarist/collection.rb
109
+ - lib/glossarist/collections.rb
110
+ - lib/glossarist/collections/asset_collection.rb
111
+ - lib/glossarist/collections/bibliography_collection.rb
75
112
  - lib/glossarist/concept.rb
76
- - lib/glossarist/designations.rb
113
+ - lib/glossarist/concept_date.rb
114
+ - lib/glossarist/concept_manager.rb
115
+ - lib/glossarist/concept_set.rb
116
+ - lib/glossarist/concept_source.rb
117
+ - lib/glossarist/config.rb
118
+ - lib/glossarist/designation.rb
119
+ - lib/glossarist/designation/abbreviation.rb
120
+ - lib/glossarist/designation/base.rb
121
+ - lib/glossarist/designation/expression.rb
122
+ - lib/glossarist/designation/grammar_info.rb
123
+ - lib/glossarist/designation/graphical_symbol.rb
124
+ - lib/glossarist/designation/letter_symbol.rb
125
+ - lib/glossarist/designation/symbol.rb
126
+ - lib/glossarist/detailed_definition.rb
127
+ - lib/glossarist/glossary_definition.rb
77
128
  - lib/glossarist/localized_concept.rb
129
+ - lib/glossarist/managed_concept.rb
130
+ - lib/glossarist/managed_concept_collection.rb
78
131
  - lib/glossarist/model.rb
132
+ - lib/glossarist/non_verb_rep.rb
133
+ - lib/glossarist/related_concept.rb
134
+ - lib/glossarist/utilities.rb
135
+ - lib/glossarist/utilities/boolean_attributes.rb
136
+ - lib/glossarist/utilities/common_functions.rb
137
+ - lib/glossarist/utilities/enum.rb
138
+ - lib/glossarist/utilities/enum/class_methods.rb
139
+ - lib/glossarist/utilities/enum/enum_collection.rb
140
+ - lib/glossarist/utilities/enum/instance_methods.rb
79
141
  - lib/glossarist/version.rb
80
142
  homepage: https://github.com/glossarist/glossarist-ruby
81
143
  licenses:
@@ -92,14 +154,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
154
  requirements:
93
155
  - - ">="
94
156
  - !ruby/object:Gem::Version
95
- version: 2.4.0
157
+ version: 2.6.0
96
158
  required_rubygems_version: !ruby/object:Gem::Requirement
97
159
  requirements:
98
160
  - - ">="
99
161
  - !ruby/object:Gem::Version
100
162
  version: '0'
101
163
  requirements: []
102
- rubygems_version: 3.1.4
164
+ rubygems_version: 3.3.26
103
165
  signing_key:
104
166
  specification_version: 4
105
167
  summary: Concept models for terminology glossaries conforming ISO 10241-1.
@@ -1,34 +0,0 @@
1
- name: Test
2
-
3
- on:
4
- - push
5
- - pull_request
6
- - workflow_dispatch
7
-
8
- jobs:
9
- build:
10
- name: Ruby ${{ matrix.ruby }}
11
- runs-on: ubuntu-latest
12
-
13
- strategy:
14
- fail-fast: false
15
- matrix:
16
- ruby:
17
- - "3.0"
18
- - "2.7"
19
- - "2.6"
20
- - "2.5"
21
- - "2.4"
22
-
23
- steps:
24
- - name: Fetch source code
25
- uses: actions/checkout@v2
26
-
27
- - name: Set up Ruby
28
- uses: ruby/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- bundler-cache: true
32
-
33
- - name: Run tests
34
- run: bundle exec rspec
@@ -1,82 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # (c) Copyright 2021 Ribose Inc.
4
- #
5
-
6
- module Glossarist
7
- module Designations
8
- class Base < Model
9
- # @note This is not entirely aligned with agreed schema and may be
10
- # changed.
11
- attr_accessor :designation
12
-
13
- attr_accessor :normative_status
14
- attr_accessor :geographical_area
15
-
16
- def self.from_h(hash)
17
- type = hash["type"]
18
-
19
- if type.nil? || /\w/ !~ type
20
- raise ArgumentError, "designation type is missing"
21
- end
22
-
23
- designation_subclass = SERIALIZED_TYPES[type]
24
-
25
- if self == Base
26
- # called on Base class, delegate it to proper subclass
27
- SERIALIZED_TYPES[type].from_h(hash)
28
- else
29
- # called on subclass, instantiate object
30
- unless SERIALIZED_TYPES[self] == type
31
- raise ArgumentError, "unexpected designation type: #{type}"
32
- end
33
- super(hash.reject { |k, _| k == "type" })
34
- end
35
- end
36
- end
37
-
38
- class Expression < Base
39
- attr_accessor :gender
40
- attr_accessor :part_of_speech
41
- attr_accessor :plurality
42
- attr_accessor :prefix
43
- attr_accessor :usage_info
44
-
45
- def to_h
46
- {
47
- "type" => "expression",
48
- "prefix" => prefix,
49
- "normative_status" => normative_status,
50
- "usage_info" => usage_info,
51
- "designation" => designation,
52
- "part_of_speech" => part_of_speech,
53
- "geographical_area" => geographical_area,
54
- "gender" => gender,
55
- "plurality" => plurality,
56
- }.compact
57
- end
58
- end
59
-
60
- class Symbol < Base
61
- attr_accessor :international
62
-
63
- def to_h
64
- {
65
- "type" => "symbol",
66
- "normative_status" => normative_status,
67
- "geographical_area" => geographical_area,
68
- "designation" => designation,
69
- "international" => international,
70
- }.compact
71
- end
72
- end
73
-
74
- # Bi-directional class-to-string mapping for STI-like serialization.
75
- SERIALIZED_TYPES = {
76
- Expression => "expression",
77
- Symbol => "symbol",
78
- }
79
- .tap { |h| h.merge!(h.invert) }
80
- .freeze
81
- end
82
- end