human_enum 0.1.3 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +4 -0
- data/.devcontainer/devcontainer.json +1 -0
- data/.github/dependabot.yml +15 -0
- data/.github/workflows/publish.yml +31 -0
- data/.github/workflows/test-results.yml +26 -0
- data/.github/workflows/tests.yml +65 -0
- data/.gitignore +50 -8
- data/.hound.yml +5 -0
- data/.rspec +0 -2
- data/.rubocop.yml +14 -3
- data/.ruby-version +1 -1
- data/.vscode/settings.json +5 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +43 -1
- data/Gemfile.lock +146 -75
- data/Gemfile.rails-6.1.lock +176 -0
- data/Gemfile.rails-7.0.lock +174 -0
- data/Gemfile.rails-7.1.lock +185 -0
- data/Guardfile +4 -12
- data/README.md +33 -12
- data/bin/rake +27 -0
- data/bin/rspec +27 -0
- data/bin/setup +0 -2
- data/human_enum.gemspec +7 -17
- data/lib/human_enum/version.rb +1 -1
- data/lib/human_enum.rb +65 -15
- metadata +29 -153
- data/.circleci/config.yml +0 -15
- data/.github/FUNDING.yml +0 -12
- data/.github/workflows/gempush.yml +0 -41
data/bin/rspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path('bundle', __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'rubygems'
|
25
|
+
require 'bundler/setup'
|
26
|
+
|
27
|
+
load Gem.bin_path('rspec-core', 'rspec')
|
data/bin/setup
CHANGED
data/human_enum.gemspec
CHANGED
@@ -8,7 +8,10 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'human_enum'
|
9
9
|
spec.version = HumanEnum::VERSION
|
10
10
|
spec.authors = ['Rafael Soares']
|
11
|
-
spec.email = ['
|
11
|
+
spec.email = ['893971+rafasoares@users.noreply.github.com']
|
12
|
+
|
13
|
+
# Should always be the lowest maintained version of Ruby
|
14
|
+
spec.required_ruby_version = '>= 3.1'
|
12
15
|
|
13
16
|
spec.summary = 'Adds simple and easy I18n support for Rails enums'
|
14
17
|
spec.description = 'This gem allows you to specify enum value translations
|
@@ -19,7 +22,8 @@ Gem::Specification.new do |spec|
|
|
19
22
|
|
20
23
|
spec.metadata['homepage_uri'] = spec.homepage
|
21
24
|
spec.metadata['source_code_uri'] = 'https://github.com/rafasoares/human_enum'
|
22
|
-
spec.metadata['changelog_uri'] = 'https://github.com/rafasoares/human_enum/blob/
|
25
|
+
spec.metadata['changelog_uri'] = 'https://github.com/rafasoares/human_enum/blob/main/CHANGELOG.md'
|
26
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
23
27
|
|
24
28
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
25
29
|
f.match(%r{^(test|spec|features)/})
|
@@ -28,19 +32,5 @@ Gem::Specification.new do |spec|
|
|
28
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
33
|
spec.require_paths = ['lib']
|
30
34
|
|
31
|
-
spec.
|
32
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
33
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
-
|
35
|
-
spec.add_development_dependency 'rubocop', '~> 0.72.0'
|
36
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.5'
|
37
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.36'
|
38
|
-
|
39
|
-
spec.add_development_dependency 'guard', '~> 2.15'
|
40
|
-
spec.add_development_dependency 'guard-rspec', '~> 4.7'
|
41
|
-
spec.add_development_dependency 'guard-rubocop', '~> 1.3'
|
42
|
-
|
43
|
-
spec.add_development_dependency 'sqlite3', '~> 1.4'
|
44
|
-
|
45
|
-
spec.add_dependency 'activerecord', '> 5.0.0'
|
35
|
+
spec.add_dependency 'activerecord', '>= 6.1', '< 8'
|
46
36
|
end
|
data/lib/human_enum/version.rb
CHANGED
data/lib/human_enum.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'human_enum/version'
|
4
|
+
require 'active_support'
|
4
5
|
require 'active_support/concern'
|
5
6
|
require 'active_support/core_ext/array'
|
7
|
+
require 'active_support/core_ext/module/deprecation'
|
6
8
|
require 'active_model/naming'
|
7
9
|
require 'active_model/translation'
|
8
10
|
require 'active_record/type'
|
@@ -18,25 +20,67 @@ module HumanEnum
|
|
18
20
|
|
19
21
|
extend ActiveSupport::Concern
|
20
22
|
|
23
|
+
class << self
|
24
|
+
def deprecator = @deprecator ||= ActiveSupport::Deprecation.new('2.0', 'HumanEnum')
|
25
|
+
end
|
26
|
+
|
21
27
|
included do
|
22
|
-
|
23
|
-
|
24
|
-
|
28
|
+
# DEPRECATED: This method is deprecated and will be removed in future versions.
|
29
|
+
#
|
30
|
+
# Returns the human-readable value of the specified enum.
|
31
|
+
#
|
32
|
+
# @param enum_name [Symbol] The name of the enum.
|
33
|
+
# @return [String] The human-readable value of the enum.
|
34
|
+
# @deprecated Use `human_<enum_name>` instead.
|
35
|
+
# :nocov:
|
36
|
+
def human_enum_value(enum_name, enum_value)
|
37
|
+
_translate_enum(enum_name, enum_value)
|
38
|
+
end
|
39
|
+
# :nocov:
|
40
|
+
|
41
|
+
deprecate(human_enum_value: 'use `human_<enum_name>` instead', deprecator: HumanEnum.deprecator)
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def _translate_enum(enum_name, enum_value = send(enum_name))
|
46
|
+
self.class.send(:_translate_enum, enum_name, enum_value)
|
25
47
|
end
|
26
48
|
end
|
27
49
|
|
28
|
-
class_methods do
|
29
|
-
def enum(
|
30
|
-
super
|
50
|
+
class_methods do # rubocop:disable Metrics/BlockLength
|
51
|
+
def enum(...)
|
52
|
+
super(...).tap { humanize_enums }
|
53
|
+
end
|
31
54
|
|
32
|
-
|
33
|
-
|
55
|
+
# DEPRECATED: This method is deprecated and will be removed in future versions.
|
56
|
+
#
|
57
|
+
# Translates the given enum value into a human-readable string.
|
58
|
+
#
|
59
|
+
# @param enum_name [Symbol] The name of the enum.
|
60
|
+
# @param enum_value [Symbol] The value of the enum.
|
61
|
+
# @return [String] The human-readable string representation of the enum value.
|
62
|
+
# @deprecated Use `human_<plural_enum_name>` instead.
|
63
|
+
# :nocov:
|
64
|
+
def human_enum_value(enum_name, enum_value)
|
65
|
+
_translate_enum(enum_name, enum_value)
|
66
|
+
end
|
67
|
+
# :nocov:
|
68
|
+
|
69
|
+
deprecate(human_enum_value: 'use `human_<plural_enum_name>` instead', deprecator: HumanEnum.deprecator)
|
70
|
+
|
71
|
+
# Goes through all enums defined in the model and creates the necessary methods, if they don't exist yet.
|
72
|
+
def humanize_enums
|
73
|
+
defined_enums.each do |enum_name, values|
|
74
|
+
_define_instance_method(enum_name)
|
75
|
+
_define_class_method(enum_name, values)
|
34
76
|
end
|
35
77
|
end
|
36
78
|
|
37
|
-
|
79
|
+
private
|
80
|
+
|
81
|
+
def _translate_enum(enum_name, enum_value)
|
38
82
|
attributes_scope = "#{i18n_scope}.attributes"
|
39
|
-
enum_key =
|
83
|
+
enum_key = [enum_name.to_s.pluralize, enum_value].compact.join('.')
|
40
84
|
|
41
85
|
defaults = lookup_ancestors.map do |klass|
|
42
86
|
:"#{attributes_scope}.#{klass.model_name.i18n_key}.#{enum_key}"
|
@@ -45,17 +89,23 @@ module HumanEnum
|
|
45
89
|
defaults << :"attributes.#{enum_key}"
|
46
90
|
defaults << enum_value.to_s.humanize
|
47
91
|
|
48
|
-
I18n.
|
92
|
+
I18n.t defaults.shift, default: defaults
|
49
93
|
end
|
50
94
|
|
51
|
-
def
|
52
|
-
|
53
|
-
|
95
|
+
def _define_instance_method(enum_name)
|
96
|
+
return if method_defined?(:"human_#{enum_name}")
|
97
|
+
|
98
|
+
define_method(:"human_#{enum_name}") do
|
99
|
+
_translate_enum(enum_name, send(enum_name))
|
54
100
|
end
|
101
|
+
end
|
55
102
|
|
103
|
+
def _define_class_method(enum_name, values)
|
56
104
|
collection_name = enum_name.to_s.pluralize
|
105
|
+
return if respond_to?(:"human_#{collection_name}")
|
106
|
+
|
57
107
|
self.class.send :define_method, "human_#{collection_name}" do
|
58
|
-
|
108
|
+
values.to_h { |key, _| [key.to_sym, _translate_enum(enum_name, key)] }
|
59
109
|
end
|
60
110
|
end
|
61
111
|
end
|
metadata
CHANGED
@@ -1,182 +1,51 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: human_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Soares
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.72.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.72.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop-performance
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1.5'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '1.5'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop-rspec
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.36'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.36'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: guard
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '2.15'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '2.15'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: guard-rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '4.7'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '4.7'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: guard-rubocop
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '1.3'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '1.3'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: sqlite3
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '1.4'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '1.4'
|
153
13
|
- !ruby/object:Gem::Dependency
|
154
14
|
name: activerecord
|
155
15
|
requirement: !ruby/object:Gem::Requirement
|
156
16
|
requirements:
|
157
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '6.1'
|
20
|
+
- - "<"
|
158
21
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
22
|
+
version: '8'
|
160
23
|
type: :runtime
|
161
24
|
prerelease: false
|
162
25
|
version_requirements: !ruby/object:Gem::Requirement
|
163
26
|
requirements:
|
164
|
-
- - "
|
27
|
+
- - ">="
|
165
28
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
29
|
+
version: '6.1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '8'
|
167
33
|
description: |-
|
168
34
|
This gem allows you to specify enum value translations
|
169
35
|
like any other ActiveRecord attribute and adds helper methods to get
|
170
36
|
humanized translations of enum values
|
171
37
|
email:
|
172
|
-
-
|
38
|
+
- 893971+rafasoares@users.noreply.github.com
|
173
39
|
executables: []
|
174
40
|
extensions: []
|
175
41
|
extra_rdoc_files: []
|
176
42
|
files:
|
177
|
-
- ".
|
178
|
-
- ".
|
179
|
-
- ".github/
|
43
|
+
- ".codeclimate.yml"
|
44
|
+
- ".devcontainer/devcontainer.json"
|
45
|
+
- ".github/dependabot.yml"
|
46
|
+
- ".github/workflows/publish.yml"
|
47
|
+
- ".github/workflows/test-results.yml"
|
48
|
+
- ".github/workflows/tests.yml"
|
180
49
|
- ".gitignore"
|
181
50
|
- ".hound.yml"
|
182
51
|
- ".rspec"
|
@@ -184,16 +53,22 @@ files:
|
|
184
53
|
- ".ruby-gemset"
|
185
54
|
- ".ruby-version"
|
186
55
|
- ".travis.yml"
|
56
|
+
- ".vscode/settings.json"
|
187
57
|
- CHANGELOG.md
|
188
58
|
- CODEOWNERS
|
189
59
|
- CODE_OF_CONDUCT.md
|
190
60
|
- Gemfile
|
191
61
|
- Gemfile.lock
|
62
|
+
- Gemfile.rails-6.1.lock
|
63
|
+
- Gemfile.rails-7.0.lock
|
64
|
+
- Gemfile.rails-7.1.lock
|
192
65
|
- Guardfile
|
193
66
|
- LICENSE.txt
|
194
67
|
- README.md
|
195
68
|
- Rakefile
|
196
69
|
- bin/console
|
70
|
+
- bin/rake
|
71
|
+
- bin/rspec
|
197
72
|
- bin/setup
|
198
73
|
- human_enum.gemspec
|
199
74
|
- lib/human_enum.rb
|
@@ -204,7 +79,8 @@ licenses:
|
|
204
79
|
metadata:
|
205
80
|
homepage_uri: https://github.com/rafasoares/human_enum
|
206
81
|
source_code_uri: https://github.com/rafasoares/human_enum
|
207
|
-
changelog_uri: https://github.com/rafasoares/human_enum/blob/
|
82
|
+
changelog_uri: https://github.com/rafasoares/human_enum/blob/main/CHANGELOG.md
|
83
|
+
rubygems_mfa_required: 'true'
|
208
84
|
post_install_message:
|
209
85
|
rdoc_options: []
|
210
86
|
require_paths:
|
@@ -213,14 +89,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
89
|
requirements:
|
214
90
|
- - ">="
|
215
91
|
- !ruby/object:Gem::Version
|
216
|
-
version: '
|
92
|
+
version: '3.1'
|
217
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
94
|
requirements:
|
219
95
|
- - ">="
|
220
96
|
- !ruby/object:Gem::Version
|
221
97
|
version: '0'
|
222
98
|
requirements: []
|
223
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.5.22
|
224
100
|
signing_key:
|
225
101
|
specification_version: 4
|
226
102
|
summary: Adds simple and easy I18n support for Rails enums
|
data/.circleci/config.yml
DELETED
data/.github/FUNDING.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# These are supported funding model platforms
|
2
|
-
|
3
|
-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
-
patreon: rafasoares
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
7
|
-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
-
liberapay: rafasoares
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
11
|
-
otechie: # Replace with a single Otechie username
|
12
|
-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
@@ -1,41 +0,0 @@
|
|
1
|
-
name: Ruby Gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches:
|
6
|
-
- master
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
build:
|
10
|
-
name: Build + Publish
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
|
13
|
-
steps:
|
14
|
-
- uses: actions/checkout@master
|
15
|
-
- name: Set up Ruby 2.6
|
16
|
-
uses: actions/setup-ruby@v1
|
17
|
-
with:
|
18
|
-
version: 2.6.x
|
19
|
-
|
20
|
-
- name: Publish to GPR
|
21
|
-
run: |
|
22
|
-
mkdir -p $HOME/.gem
|
23
|
-
touch $HOME/.gem/credentials
|
24
|
-
chmod 0600 $HOME/.gem/credentials
|
25
|
-
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
26
|
-
gem build *.gemspec
|
27
|
-
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
28
|
-
env:
|
29
|
-
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
|
30
|
-
OWNER: rafasoares
|
31
|
-
|
32
|
-
- name: Publish to RubyGems
|
33
|
-
run: |
|
34
|
-
mkdir -p $HOME/.gem
|
35
|
-
touch $HOME/.gem/credentials
|
36
|
-
chmod 0600 $HOME/.gem/credentials
|
37
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
38
|
-
gem build *.gemspec
|
39
|
-
gem push *.gem
|
40
|
-
env:
|
41
|
-
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|