beta_feature 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +59 -4
  4. data/Rakefile +7 -2
  5. data/app/controllers/beta_feature/application_controller.rb +4 -0
  6. data/app/controllers/beta_feature/configurations_controller.rb +9 -0
  7. data/app/controllers/beta_feature/settings_controller.rb +59 -0
  8. data/app/models/beta_feature/application_record.rb +5 -0
  9. data/{lib → app/models}/beta_feature/setting.rb +4 -8
  10. data/app/views/layouts/beta_feature/application.html.erb +15 -0
  11. data/config/routes.rb +10 -0
  12. data/db/migrate/20210102124824_create_beta_feature_settings.rb +18 -0
  13. data/lib/beta_feature.rb +3 -9
  14. data/lib/beta_feature/engine.rb +25 -0
  15. data/lib/beta_feature/flagger.rb +10 -6
  16. data/lib/beta_feature/version.rb +1 -1
  17. data/lib/generators/beta_feature/install_generator.rb +1 -12
  18. data/lib/generators/beta_feature/templates/beta_features.yml +1 -2
  19. data/lib/tasks/beta_feature_tasks.rake +4 -0
  20. metadata +27 -109
  21. data/.gitignore +0 -18
  22. data/.rspec +0 -3
  23. data/.rubycop.yml +0 -24
  24. data/.travis.yml +0 -57
  25. data/Appraisals +0 -18
  26. data/CHANGELOG.md +0 -0
  27. data/CODE_OF_CONDUCT.md +0 -74
  28. data/Gemfile +0 -6
  29. data/LICENSE.txt +0 -21
  30. data/beta_feature.gemspec +0 -52
  31. data/bin/console +0 -14
  32. data/bin/setup +0 -8
  33. data/gemfiles/rails50.gemfile +0 -7
  34. data/gemfiles/rails50.gemfile.lock +0 -175
  35. data/gemfiles/rails51.gemfile +0 -7
  36. data/gemfiles/rails51.gemfile.lock +0 -175
  37. data/gemfiles/rails52.gemfile +0 -7
  38. data/gemfiles/rails52.gemfile.lock +0 -183
  39. data/gemfiles/rails60.gemfile +0 -7
  40. data/gemfiles/rails60.gemfile.lock +0 -199
  41. data/lib/generators/beta_feature/migration.rb +0 -15
  42. data/lib/generators/beta_feature/migration_helper.rb +0 -13
  43. data/lib/generators/beta_feature/templates/install.rb +0 -16
data/.gitignore DELETED
@@ -1,18 +0,0 @@
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
13
- *.swp
14
- .bundle
15
- .DS_Store
16
- .rvmrc
17
- /coverage
18
- Gemfile.lock
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,24 +0,0 @@
1
- AllCops:
2
- DisplayCopNames: true
3
- TargetRubyVersion: 2.3
4
- Exclude:
5
- - vendor/bundle/**/*
6
- - gemfiles/vendor/bundle/**/*
7
-
8
- Bundler/OrderedGems:
9
- Enabled: false
10
-
11
- Gemspec/OrderedDependencies:
12
- Enabled: false
13
-
14
- Layout:
15
- Enabled: false
16
-
17
- Metrics:
18
- Enabled: false
19
-
20
- Naming:
21
- Enabled: false
22
-
23
- Style:
24
- Enabled: false
@@ -1,57 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- # - 2.3.7
5
- # - 2.4.4
6
- - 2.5.3
7
- - 2.6.3
8
- env:
9
- - DB=POSTGRES
10
- # - DB=MYSQL
11
- addons:
12
- postgresql: "9.4"
13
- services:
14
- - mysql
15
- - postgresql
16
- before_install:
17
- - bundle install --jobs=3 --retry=3
18
- # - mysql -e 'CREATE DATABASE beta_feature_test;'
19
- # - psql -c 'create database beta_feature_test;' -U postgres
20
- # https://github.com/travis-ci/travis-ci/issues/8978
21
- # - "travis_retry gem update --system"
22
- # # Rails 4.2 has a bundler 1.x requirement
23
- # - if [ $BUNDLE_GEMFILE = $PWD/gemfiles/rails42.gemfile ]; then
24
- # rvm @global do gem uninstall bundler -a -x;
25
- # travis_retry gem install -v '< 2.0.0' bundler;
26
- # else
27
- # travis_retry gem install bundler;
28
- # fi
29
-
30
- gemfile:
31
- - gemfiles/rails50.gemfile
32
- - gemfiles/rails51.gemfile
33
- - gemfiles/rails52.gemfile
34
- - gemfiles/rails60.gemfile
35
- matrix:
36
- # include:
37
- # - rvm: 2.6.3
38
- # script: bundle exec rubocop --parallel
39
- # env: DB=rubocop # make travis build display nicer
40
- exclude:
41
- # - rvm: 2.3.7
42
- # gemfile: gemfiles/rails60.gemfile
43
- # - rvm: 2.4.4
44
- # gemfile: gemfiles/rails60.gemfile
45
- - rvm: 2.6.3
46
- gemfile: gemfiles/rails42.gemfile
47
- - rvm: ruby-head
48
- gemfile: gemfiles/rails42.gemfile
49
- allow_failures:
50
- - rvm: ruby-head
51
- fast_finish: true
52
- branches:
53
- only:
54
- - master
55
-
56
- script:
57
- - rake
data/Appraisals DELETED
@@ -1,18 +0,0 @@
1
- # Include DB adapters matching the version requirements in
2
- # rails/activerecord/lib/active_record/connection_adapters/*adapter.rb
3
-
4
- appraise 'rails50' do
5
- gem 'rails', '~> 5.0.0'
6
- end
7
-
8
- appraise 'rails51' do
9
- gem 'rails', '~> 5.1.4'
10
- end
11
-
12
- appraise 'rails52' do
13
- gem 'rails', '>= 5.2.0', '< 5.3'
14
- end
15
-
16
- appraise 'rails60' do
17
- gem 'rails', '>= 6.0.0.rc1', '< 6.1'
18
- end
File without changes
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at xiaorong.ruby@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in beta_feature.gemspec
6
- gemspec
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 Ryan Lv
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.
@@ -1,52 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "beta_feature/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "beta_feature"
8
- spec.version = BetaFeature::VERSION
9
- spec.authors = ["Ryan Lv", "Windy Liu"]
10
- spec.email = ["tech@workstream.is"]
11
-
12
- spec.summary = %q{Rails feature toggle for trunk based development.}
13
- spec.description = spec.summary
14
- spec.homepage = "https://github.com/helloworld1812/beta_feature"
15
- spec.license = "MIT"
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21
-
22
- spec.metadata["homepage_uri"] = spec.homepage
23
- spec.metadata["source_code_uri"] = "https://github.com/helloworld1812/beta_feature"
24
- spec.metadata["changelog_uri"] = "https://github.com/helloworld1812/beta_feature/blob/master/CHANGELOG.md"
25
- else
26
- raise "RubyGems 2.0 or newer is required to protect against " \
27
- "public gem pushes."
28
- end
29
-
30
- # Specify which files should be added to the gem when it is released.
31
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
33
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34
- end
35
- spec.bindir = "exe"
36
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
- spec.require_paths = ["lib"]
38
- spec.required_ruby_version = '>= 2.3.0'
39
-
40
- # spec.add_runtime_dependency 'activerecord', '>= 4.2', '< 6.1'
41
- # spec.add_runtime_dependency 'activesupport', '>= 4.2', '< 6.1'
42
- spec.add_runtime_dependency 'rails', '>= 4.2', '< 6.1'
43
-
44
- spec.add_development_dependency 'appraisal'
45
- spec.add_development_dependency "rspec", ">= 3.0"
46
- spec.add_development_dependency 'rspec-rails', '>= 3.5'
47
- spec.add_development_dependency 'pry'
48
- spec.add_development_dependency "rake", ">= 12.3.3"
49
- spec.add_development_dependency 'rubocop', '>= 0.54.0'
50
- spec.add_development_dependency 'mysql2', '>= 0.3.20'
51
- spec.add_development_dependency 'pg', '>= 0.18', '< 2.0'
52
- end
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "beta_feature"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.0.0"
6
-
7
- gemspec path: "../"
@@ -1,175 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- beta_feature (0.1.0)
5
- rails (>= 4.2, < 6.1)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actioncable (5.0.7.2)
11
- actionpack (= 5.0.7.2)
12
- nio4r (>= 1.2, < 3.0)
13
- websocket-driver (~> 0.6.1)
14
- actionmailer (5.0.7.2)
15
- actionpack (= 5.0.7.2)
16
- actionview (= 5.0.7.2)
17
- activejob (= 5.0.7.2)
18
- mail (~> 2.5, >= 2.5.4)
19
- rails-dom-testing (~> 2.0)
20
- actionpack (5.0.7.2)
21
- actionview (= 5.0.7.2)
22
- activesupport (= 5.0.7.2)
23
- rack (~> 2.0)
24
- rack-test (~> 0.6.3)
25
- rails-dom-testing (~> 2.0)
26
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.0.7.2)
28
- activesupport (= 5.0.7.2)
29
- builder (~> 3.1)
30
- erubis (~> 2.7.0)
31
- rails-dom-testing (~> 2.0)
32
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.0.7.2)
34
- activesupport (= 5.0.7.2)
35
- globalid (>= 0.3.6)
36
- activemodel (5.0.7.2)
37
- activesupport (= 5.0.7.2)
38
- activerecord (5.0.7.2)
39
- activemodel (= 5.0.7.2)
40
- activesupport (= 5.0.7.2)
41
- arel (~> 7.0)
42
- activesupport (5.0.7.2)
43
- concurrent-ruby (~> 1.0, >= 1.0.2)
44
- i18n (>= 0.7, < 2)
45
- minitest (~> 5.1)
46
- tzinfo (~> 1.1)
47
- appraisal (2.2.0)
48
- bundler
49
- rake
50
- thor (>= 0.14.0)
51
- arel (7.1.4)
52
- ast (2.4.0)
53
- builder (3.2.4)
54
- coderay (1.1.2)
55
- concurrent-ruby (1.1.6)
56
- crass (1.0.6)
57
- diff-lcs (1.3)
58
- erubis (2.7.0)
59
- globalid (0.4.2)
60
- activesupport (>= 4.2.0)
61
- i18n (1.8.2)
62
- concurrent-ruby (~> 1.0)
63
- jaro_winkler (1.5.4)
64
- loofah (2.5.0)
65
- crass (~> 1.0.2)
66
- nokogiri (>= 1.5.9)
67
- mail (2.7.1)
68
- mini_mime (>= 0.1.1)
69
- method_source (1.0.0)
70
- mini_mime (1.0.2)
71
- mini_portile2 (2.4.0)
72
- minitest (5.14.0)
73
- mysql2 (0.5.3)
74
- nio4r (2.5.2)
75
- nokogiri (1.10.9)
76
- mini_portile2 (~> 2.4.0)
77
- parallel (1.19.1)
78
- parser (2.7.1.1)
79
- ast (~> 2.4.0)
80
- pg (1.2.3)
81
- pry (0.13.1)
82
- coderay (~> 1.1)
83
- method_source (~> 1.0)
84
- rack (2.2.2)
85
- rack-test (0.6.3)
86
- rack (>= 1.0)
87
- rails (5.0.7.2)
88
- actioncable (= 5.0.7.2)
89
- actionmailer (= 5.0.7.2)
90
- actionpack (= 5.0.7.2)
91
- actionview (= 5.0.7.2)
92
- activejob (= 5.0.7.2)
93
- activemodel (= 5.0.7.2)
94
- activerecord (= 5.0.7.2)
95
- activesupport (= 5.0.7.2)
96
- bundler (>= 1.3.0)
97
- railties (= 5.0.7.2)
98
- sprockets-rails (>= 2.0.0)
99
- rails-dom-testing (2.0.3)
100
- activesupport (>= 4.2.0)
101
- nokogiri (>= 1.6)
102
- rails-html-sanitizer (1.3.0)
103
- loofah (~> 2.3)
104
- railties (5.0.7.2)
105
- actionpack (= 5.0.7.2)
106
- activesupport (= 5.0.7.2)
107
- method_source
108
- rake (>= 0.8.7)
109
- thor (>= 0.18.1, < 2.0)
110
- rainbow (3.0.0)
111
- rake (13.0.1)
112
- rexml (3.2.4)
113
- rspec (3.9.0)
114
- rspec-core (~> 3.9.0)
115
- rspec-expectations (~> 3.9.0)
116
- rspec-mocks (~> 3.9.0)
117
- rspec-core (3.9.1)
118
- rspec-support (~> 3.9.1)
119
- rspec-expectations (3.9.1)
120
- diff-lcs (>= 1.2.0, < 2.0)
121
- rspec-support (~> 3.9.0)
122
- rspec-mocks (3.9.1)
123
- diff-lcs (>= 1.2.0, < 2.0)
124
- rspec-support (~> 3.9.0)
125
- rspec-rails (3.9.0)
126
- actionpack (>= 3.0)
127
- activesupport (>= 3.0)
128
- railties (>= 3.0)
129
- rspec-core (~> 3.9.0)
130
- rspec-expectations (~> 3.9.0)
131
- rspec-mocks (~> 3.9.0)
132
- rspec-support (~> 3.9.0)
133
- rspec-support (3.9.2)
134
- rubocop (0.82.0)
135
- jaro_winkler (~> 1.5.1)
136
- parallel (~> 1.10)
137
- parser (>= 2.7.0.1)
138
- rainbow (>= 2.2.2, < 4.0)
139
- rexml
140
- ruby-progressbar (~> 1.7)
141
- unicode-display_width (>= 1.4.0, < 2.0)
142
- ruby-progressbar (1.10.1)
143
- sprockets (4.0.0)
144
- concurrent-ruby (~> 1.0)
145
- rack (> 1, < 3)
146
- sprockets-rails (3.2.1)
147
- actionpack (>= 4.0)
148
- activesupport (>= 4.0)
149
- sprockets (>= 3.0.0)
150
- thor (1.0.1)
151
- thread_safe (0.3.6)
152
- tzinfo (1.2.7)
153
- thread_safe (~> 0.1)
154
- unicode-display_width (1.7.0)
155
- websocket-driver (0.6.5)
156
- websocket-extensions (>= 0.1.0)
157
- websocket-extensions (0.1.4)
158
-
159
- PLATFORMS
160
- ruby
161
-
162
- DEPENDENCIES
163
- appraisal
164
- beta_feature!
165
- mysql2 (>= 0.3.20)
166
- pg (>= 0.18, < 2.0)
167
- pry
168
- rails (~> 5.0.0)
169
- rake (>= 12.3.3)
170
- rspec (>= 3.0)
171
- rspec-rails (>= 3.5)
172
- rubocop (>= 0.54.0)
173
-
174
- BUNDLED WITH
175
- 1.17.3