release_feature 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3f584442dbbe642c52ec2998c942b2b895f248075b87b9f85a61e308eb324d69
4
+ data.tar.gz: c1d767c3f2808930d91a660d544620f523562e2ae9879cf888903bc000ce0081
5
+ SHA512:
6
+ metadata.gz: 1c386ee5b9e0d8b3a6f3e37f10a7a9c945044a9ac7b44ad436703fe9bec5f05ba07d55581768a3e7b7a5dfbc66db5c24bdb8d2a84c02095692fb6b5dc90eab09
7
+ data.tar.gz: 70a92e2d2fe0f5b43f9ce2c3b7841a6f36b51e4cad23371ea3eecae2e132e1dc69eeb68516189f58f260662825bb7eeeb93cb4a19e4c40c726063aed6b86a233
@@ -0,0 +1,23 @@
1
+ name: Rubocop Rspec
2
+
3
+ on: [ push, pull_request ]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ fail-fast: false
9
+ matrix:
10
+ os: [ ubuntu-latest ]
11
+ ruby: [ 2.7, 3.0, 3.1 ]
12
+ runs-on: ${{ matrix.os }}
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ bundler-cache: true
20
+ - name: Run the default task
21
+ run: |
22
+ bundle install
23
+ bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .gem_rbs_collection
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7.4
3
+ NewCops: enable
4
+ Exclude:
5
+ - 'vendor/**/*'
6
+ - '.gem_rbs_collection/**/*'
7
+
8
+ Style/Documentation:
9
+ Enabled: false
10
+
11
+ Layout/LineLength:
12
+ Max: 120
13
+
14
+ require:
15
+ - rubocop-performance
16
+ - rubocop-rspec
17
+ - rubocop-rake
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-2-20
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at jung5araki@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in release_feature.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+
10
+ gem 'awesome_print'
11
+ gem 'codecov', require: false, group: 'test'
12
+ gem 'rbs'
13
+ gem 'simplecov', require: false, group: :test
14
+ gem 'steep'
15
+ gem 'typeprof'
data/Gemfile.lock ADDED
@@ -0,0 +1,151 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ release_feature (0.1.0)
5
+ time
6
+ yaml
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activemodel (7.0.2.2)
12
+ activesupport (= 7.0.2.2)
13
+ activerecord (7.0.2.2)
14
+ activemodel (= 7.0.2.2)
15
+ activesupport (= 7.0.2.2)
16
+ activesupport (7.0.2.2)
17
+ concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ i18n (>= 1.6, < 2)
19
+ minitest (>= 5.1)
20
+ tzinfo (~> 2.0)
21
+ ast (2.4.2)
22
+ awesome_print (1.9.2)
23
+ binding_ninja (0.2.3)
24
+ codecov (0.6.0)
25
+ simplecov (>= 0.15, < 0.22)
26
+ coderay (1.1.3)
27
+ concurrent-ruby (1.1.9)
28
+ date (3.2.2)
29
+ diff-lcs (1.5.0)
30
+ docile (1.4.0)
31
+ factory_bot (6.2.0)
32
+ activesupport (>= 5.0.0)
33
+ ffi (1.15.5)
34
+ i18n (1.10.0)
35
+ concurrent-ruby (~> 1.0)
36
+ language_server-protocol (3.16.0.3)
37
+ listen (3.7.1)
38
+ rb-fsevent (~> 0.10, >= 0.10.3)
39
+ rb-inotify (~> 0.9, >= 0.9.10)
40
+ minitest (5.15.0)
41
+ parallel (1.21.0)
42
+ parser (3.1.0.0)
43
+ ast (~> 2.4.1)
44
+ proc_to_ast (0.1.0)
45
+ coderay
46
+ parser
47
+ unparser
48
+ rainbow (3.1.1)
49
+ rake (13.0.6)
50
+ rb-fsevent (0.11.1)
51
+ rb-inotify (0.10.1)
52
+ ffi (~> 1.0)
53
+ rbs (2.1.0)
54
+ regexp_parser (2.2.1)
55
+ rexml (3.2.5)
56
+ rspec (3.11.0)
57
+ rspec-core (~> 3.11.0)
58
+ rspec-expectations (~> 3.11.0)
59
+ rspec-mocks (~> 3.11.0)
60
+ rspec-core (3.11.0)
61
+ rspec-support (~> 3.11.0)
62
+ rspec-expectations (3.11.0)
63
+ diff-lcs (>= 1.2.0, < 2.0)
64
+ rspec-support (~> 3.11.0)
65
+ rspec-mocks (3.11.0)
66
+ diff-lcs (>= 1.2.0, < 2.0)
67
+ rspec-support (~> 3.11.0)
68
+ rspec-parameterized (0.5.1)
69
+ binding_ninja (>= 0.2.3)
70
+ parser
71
+ proc_to_ast
72
+ rspec (>= 2.13, < 4)
73
+ unparser
74
+ rspec-support (3.11.0)
75
+ rubocop (1.25.1)
76
+ parallel (~> 1.10)
77
+ parser (>= 3.1.0.0)
78
+ rainbow (>= 2.2.2, < 4.0)
79
+ regexp_parser (>= 1.8, < 3.0)
80
+ rexml
81
+ rubocop-ast (>= 1.15.1, < 2.0)
82
+ ruby-progressbar (~> 1.7)
83
+ unicode-display_width (>= 1.4.0, < 3.0)
84
+ rubocop-ast (1.15.2)
85
+ parser (>= 3.0.1.1)
86
+ rubocop-performance (1.13.2)
87
+ rubocop (>= 1.7.0, < 2.0)
88
+ rubocop-ast (>= 0.4.0)
89
+ rubocop-rake (0.6.0)
90
+ rubocop (~> 1.0)
91
+ rubocop-rspec (2.8.0)
92
+ rubocop (~> 1.19)
93
+ ruby-progressbar (1.11.0)
94
+ simplecov (0.21.2)
95
+ docile (~> 1.1)
96
+ simplecov-html (~> 0.11)
97
+ simplecov_json_formatter (~> 0.1)
98
+ simplecov-html (0.12.3)
99
+ simplecov_json_formatter (0.1.4)
100
+ sqlite3 (1.4.2)
101
+ steep (0.46.0)
102
+ activesupport (>= 5.1)
103
+ language_server-protocol (>= 3.15, < 4.0)
104
+ listen (~> 3.0)
105
+ parallel (>= 1.0.0)
106
+ parser (>= 3.0)
107
+ rainbow (>= 2.2.2, < 4.0)
108
+ rbs (>= 1.2.0)
109
+ terminal-table (>= 2, < 4)
110
+ terminal-table (3.0.2)
111
+ unicode-display_width (>= 1.1.1, < 3)
112
+ time (0.2.0)
113
+ date
114
+ timecop (0.9.4)
115
+ typeprof (0.21.2)
116
+ rbs (>= 1.8.1)
117
+ tzinfo (2.0.4)
118
+ concurrent-ruby (~> 1.0)
119
+ unicode-display_width (2.1.0)
120
+ unparser (0.6.4)
121
+ diff-lcs (~> 1.3)
122
+ parser (>= 3.1.0)
123
+ yaml (0.2.0)
124
+
125
+ PLATFORMS
126
+ ruby
127
+ x86_64-darwin-20
128
+ x86_64-linux
129
+
130
+ DEPENDENCIES
131
+ activerecord
132
+ awesome_print
133
+ codecov
134
+ factory_bot
135
+ rake (~> 13.0)
136
+ rbs
137
+ release_feature!
138
+ rspec
139
+ rspec-parameterized
140
+ rubocop
141
+ rubocop-performance
142
+ rubocop-rake
143
+ rubocop-rspec
144
+ simplecov
145
+ sqlite3
146
+ steep
147
+ timecop
148
+ typeprof
149
+
150
+ BUNDLED WITH
151
+ 2.2.33
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 junara
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,264 @@
1
+ [![codecov](https://codecov.io/gh/junara/release_feature/branch/main/graph/badge.svg?token=2EM2TNEVN6)](https://codecov.io/gh/junara/release_feature)
2
+
3
+ # ReleaseFeature
4
+
5
+ ReleaseFeature is feature toggle.
6
+
7
+ ## Installation
8
+
9
+ Using bundler, please add following line to your Gemfile.
10
+
11
+ ```ruby
12
+ gem 'release_feature'
13
+ ```
14
+
15
+ Using gem
16
+
17
+ ```shell
18
+ gem install release_feature
19
+ ```
20
+
21
+ If you want to use latest main branch, please add following line to Gemfile.
22
+
23
+ ```ruby
24
+ gem 'release_feature', git: 'https://github.com/junara/release_feature.git', branch: 'main'
25
+ ```
26
+
27
+ And then execute:
28
+
29
+ $ bundle install
30
+
31
+ ## Usage
32
+
33
+ Prepare client by configuring repository and initialize client.
34
+
35
+ You can select 4 repository types. From yaml (YamlRepository), hash (HashRepository) or ActiveRecord (
36
+ ActiveRecordRepository).
37
+
38
+ Client can have maximum 2 repositories (called to `base_repository` and `extra_repository`). extra_repository is
39
+ optional.
40
+
41
+ If `extra_repository` is set, `base_repository` is merged by `extra_repository`. `extra_repository` setting has priority
42
+
43
+ ### Using hash repository
44
+
45
+ ```ruby
46
+ config = { features: { hogehoge_function: { development: { open_at: Time.now, close_at: Time.now + 60 * 60 * 24 * 30 } } } }
47
+ hash_repo = ReleaseFeature::Repository::HashRepository.new(hash: config)
48
+ client = ReleaseFeature::Client.new(environment: :development, base_repository: hash_repo)
49
+ client.permitted?(:hogehoge_function) #=> true
50
+ client.permitted?(:hogehoge_function, time: Time.now + 60) #=> true
51
+ client.permitted?(:hogehoge_function, time: Time.now - 60 * 60 * 24) #=> false
52
+
53
+ ```
54
+
55
+ ### Using yaml repository
56
+
57
+ Create yaml in 'release_feature_config.yml'. Write following.
58
+
59
+ ```yaml
60
+ timezone: +09:00
61
+ features:
62
+ hoge_feature:
63
+ development:
64
+ open_at: 2000-01-01 00:00
65
+ close_at: 2999-12-31 23:59
66
+ staging:
67
+ open_at: 2030-11-01 10:00
68
+ close_at: 2999-12-31 23:59
69
+ production:
70
+ open_at: 2040-12-01 10:00
71
+ close_at: 2999-12-31 23:59
72
+ puyo_feature:
73
+ development:
74
+ open_at: 2000-01-01 00:00
75
+ close_at: 2999-12-31 23:59
76
+ production:
77
+ open_at: 2022-12-01 10:00
78
+ close_at: 2999-12-31 23:59
79
+
80
+ ```
81
+
82
+ Set `zone` to `timezone` . `zone` is defined in https://docs.ruby-lang.org/en/3.1/Time.html
83
+
84
+ > zone: a timezone, which may be:
85
+ > A string offset from UTC.
86
+ > A single letter offset from UTC, in the range 'A'..'Z', 'J' (the so-called military timezone) excluded.
87
+ > An integer number of seconds.
88
+ > A timezone object; see Timezone Argument for details.
89
+
90
+ ```ruby
91
+ path = 'release_feature_config.yml'
92
+ yaml_repo = ReleaseFeature::Repository::YamlRepository.new(path: path)
93
+ development_client = ReleaseFeature::Client.new(environment: :development, base_repository: yaml_repo)
94
+ development_client.permitted?(:hoge_feature) #=> true
95
+
96
+ staging_client = ReleaseFeature::Client.new(environment: :staging, base_repository: yaml_repo)
97
+ staging_client.permitted?(:hoge_feature) #=> false
98
+
99
+ ```
100
+
101
+ ### Using ActiveRecord repository
102
+
103
+ Model have four attributes (name (:string), environment (:string), open_at (:datetime), close_at (:datetime)
104
+
105
+ You cac migrate model by command line.
106
+
107
+ ```shell
108
+ rails g model ReleaseFeatureItem name:string environment:string open_at:datetime close_at:datetime
109
+ ```
110
+
111
+ Above command create following migration file.
112
+
113
+ ```ruby
114
+
115
+ class CreateReleaseFeatureItems < ActiveRecord::Migration[7.0]
116
+ def change
117
+ create_table :release_feature_items do |t|
118
+ t.string :name
119
+ t.string :environment
120
+ t.datetime :open_at
121
+ t.datetime :close_at
122
+
123
+ t.timestamps
124
+ end
125
+ end
126
+ end
127
+
128
+ ```
129
+
130
+ And run migrate.
131
+
132
+ ```shell
133
+ rails db:migrate
134
+
135
+ ```
136
+
137
+ Using created ActiveRecord for `base_repository` like this.
138
+
139
+ ```ruby
140
+ model = ReleaseFeatureItem # migrated by active_record
141
+ ReleaseFeatureItem.create!(name: 'hoge_feature', environment: 'development', open_at: '2000-01-01 00:00 +09:00', close_at: '2002-01-01 00:00 +09:00')
142
+ ar_repo = ReleaseFeature::Repository::ActiveRecordRepository.new(model: model)
143
+ client = ReleaseFeature::Client.new(environment: :development, base_repository: ar_repo)
144
+ client.permitted?(:hoge_feature) #=> false
145
+
146
+ ```
147
+
148
+ ### Using "extra_repository"
149
+
150
+ Document under Construction
151
+
152
+ `extra_repository` overrides `base_repository`.
153
+
154
+ ex)
155
+
156
+ `base_repository` is yaml repository. `extra_repository` is ActiveRecord repository.
157
+
158
+ ```ruby
159
+ path = 'release_feature_config.yml'
160
+ yaml_repo = ReleaseFeature::Repository::YamlRepository.new(path: path)
161
+
162
+ model = ReleaseFeatureItem # migrated by active_record
163
+
164
+ ReleaseFeatureItem.create!(name: 'hoge_feature', environment: 'development', open_at: '2000-01-01 00:00 +09:00', close_at: '2002-01-01 00:00 +09:00')
165
+ ar_repo = ReleaseFeature::Repository::ActiveRecordRepository.new(model: model)
166
+
167
+ client = ReleaseFeature::Client.new(environment: :development, base_repository: yaml_repo, extra_repository: ar_repo)
168
+
169
+ # activerecord_repository override yaml_repository hoge_feature.
170
+ client.permitted?(:hoge_feature) #=> false
171
+
172
+ release_feature_item = ReleaseFeatureItem.find_by(name: 'hoge_feature', environment: 'development')
173
+ release_feature_item.update(close_at: '2099-01-01 00:00 +09:00')
174
+
175
+ # Default caching time (10 min) later
176
+
177
+ client.permitted?(:hoge_feature) #=> true
178
+
179
+ ```
180
+
181
+ ### Caching
182
+
183
+ In default, repository data is cached 10 min (600sec). Caching time is changed by `refresh_interval_sec` parameter.
184
+
185
+ Following exmple, refresh interval is 1 hour (60 * 60 = 3600 sec ).
186
+
187
+ ```ruby
188
+ config = { features: { hogehoge_function: { development: { open_at: Time.now, close_at: Time.now + 60 * 60 * 24 * 30 } } } }
189
+ hash_repo = ReleaseFeature::Repository::HashRepository.new(hash: config)
190
+ client = ReleaseFeature::Client.new(environment: :development, refresh_interval_sec: 60 * 60, base_repository: hash_repo)
191
+
192
+ client.permitted?(:hoge_feature) #=> true
193
+ # Repository data is cached and is not loaded for 1 hour (60 * 60 sec).
194
+
195
+ ```
196
+
197
+ ### With Rails app
198
+
199
+ In Ruby on Rails app, Bt Yaml repository, you can use like this.
200
+
201
+ ```ruby
202
+
203
+ class YourAppFlag
204
+ include Singleton
205
+
206
+ def initialize(environment = nil, path:)
207
+ environment ||= Rails.env
208
+ yaml_repo = ReleaseFeature::Repository::YamlRepository.new(path: path)
209
+ @client = ReleaseFeature::Client.new(environment: environment.to_sym, base_repository: yaml_repo)
210
+ end
211
+
212
+ def permitted?(feature)
213
+ @client.permitted?(feature.to_sym)
214
+ end
215
+
216
+ def run_if_permitted
217
+ return unless permitted?
218
+ yield
219
+ end
220
+ end
221
+
222
+ # Before use, please prepare 'release_feature_config.yml'. See above.
223
+ flag = YourAppFlag.instance.new(path: 'release_feature_config.yml')
224
+
225
+ # Using simple boolean flag.
226
+ if flag.permitted?(:hoge_feature)
227
+ put 'run if permitted.'
228
+ end
229
+
230
+ # Using block
231
+ flag.run_if_permitted do
232
+ put 'run if permitted.'
233
+ end
234
+
235
+ ```
236
+
237
+ ## Development
238
+
239
+ After checking out the repo, run `bin/setup` to install dependencies.
240
+
241
+ Then, run `rake spec` to run the tests.
242
+
243
+ Then, run `steep check` to run rbs check.
244
+
245
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
246
+
247
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
248
+ version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
249
+ push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
250
+
251
+ ## Contributing
252
+
253
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/release_feature. This project is
254
+ intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
255
+ the [code of conduct](https://github.com/junara/release_feature/blob/master/CODE_OF_CONDUCT.md).
256
+
257
+ ## License
258
+
259
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
260
+
261
+ ## Code of Conduct
262
+
263
+ Everyone interacting in the ReleaseFeature project's codebases, issue trackers, chat rooms and mailing lists is expected
264
+ to follow the [code of conduct](https://github.com/[USERNAME]/release_feature/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/Steepfile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ target :lib do
4
+ check 'lib'
5
+ signature 'sig'
6
+ repo_path '.gem_rbs_collection' # https://dev.to/pocke/rbs-collection-was-released-4nmm
7
+ library 'time'
8
+ library 'activerecord'
9
+ end
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'release_feature'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ rbs collection install
9
+ # Do any other automated setup that you need to do here