abstract_feature_branch 1.2.2 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +15 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +74 -43
  5. data/VERSION +1 -1
  6. data/abstract_feature_branch.gemspec +31 -56
  7. data/lib/abstract_feature_branch/configuration.rb +22 -7
  8. data/lib/abstract_feature_branch/redis/connection_pool_to_redis_adapter.rb +34 -0
  9. data/lib/abstract_feature_branch.rb +75 -7
  10. data/lib/ext/feature_branch.rb +4 -3
  11. data/lib/generators/templates/config/initializers/abstract_feature_branch.rb +7 -5
  12. metadata +76 -55
  13. data/.coveralls.yml +0 -1
  14. data/.travis.yml +0 -40
  15. data/RELEASE_NOTES.md +0 -55
  16. data/config/features/admin.local.yml +0 -15
  17. data/config/features/admin.yml +0 -17
  18. data/config/features/internal/wiki.local.yml +0 -15
  19. data/config/features/internal/wiki.yml +0 -17
  20. data/config/features/public.local.yml +0 -15
  21. data/config/features/public.yml +0 -17
  22. data/ruby187.Gemfile +0 -12
  23. data/ruby187.Gemfile.lock +0 -63
  24. data/spec/abstract_feature_branch/file_beautifier_spec.rb +0 -384
  25. data/spec/ext/feature_branch__feature_branch_per_user_spec.rb +0 -113
  26. data/spec/ext/feature_branch__feature_branch_spec.rb +0 -125
  27. data/spec/ext/feature_branch__feature_enabled_spec.rb +0 -260
  28. data/spec/fixtures/application_development_config/config/features.reference.yml +0 -21
  29. data/spec/fixtures/application_no_config/no_config +0 -1
  30. data/spec/fixtures/application_rails_config/config/features.local.yml +0 -16
  31. data/spec/fixtures/application_rails_config/config/features.yml +0 -20
  32. data/spec/fixtures/application_ugly_config_reference/config/another_application_configuration.yml +0 -31
  33. data/spec/fixtures/application_ugly_config_reference/config/database.yml +0 -17
  34. data/spec/fixtures/application_ugly_config_reference/config/features/admin.local.yml +0 -44
  35. data/spec/fixtures/application_ugly_config_reference/config/features/admin.yml +0 -44
  36. data/spec/fixtures/application_ugly_config_reference/config/features/empty.local.yml +0 -0
  37. data/spec/fixtures/application_ugly_config_reference/config/features/feature_empty_config.local.yml +0 -13
  38. data/spec/fixtures/application_ugly_config_reference/config/features/including_comments.local.yml +0 -52
  39. data/spec/fixtures/application_ugly_config_reference/config/features/internal/wiki.local.yml +0 -44
  40. data/spec/fixtures/application_ugly_config_reference/config/features/internal/wiki.yml +0 -44
  41. data/spec/fixtures/application_ugly_config_reference/config/features/public.local.yml +0 -44
  42. data/spec/fixtures/application_ugly_config_reference/config/features/public.yml +0 -44
  43. data/spec/fixtures/application_ugly_config_reference/config/features.local.yml +0 -44
  44. data/spec/fixtures/application_ugly_config_reference/config/features.yml +0 -49
@@ -1,9 +1,11 @@
1
- require 'redis'
1
+ # Storage system for features (other than YAML/Env-Vars). Right now, only Redis and ConnectionPool are supported.
2
+ # AbstractFeatureBranch.feature_store = Redis.new
3
+
4
+ # Storage can be a Redis ConnectionPool instance
5
+ # AbstractFeatureBranch.feature_store = ConnectionPool.new { Redis.new }
2
6
 
3
- # Storage for user features, customizable over here. Right now, only a Redis client is supported.
4
7
  # The following example line works with Heroku Redis To Go while still operating on local Redis for local development
5
- # AbstractFeatureBranch.user_features_storage = Redis.new(:url => ENV['REDISTOGO_URL'])
6
- AbstractFeatureBranch.user_features_storage = Redis.new
8
+ # AbstractFeatureBranch.feature_store = Redis.new(:url => ENV['REDISTOGO_URL'])
7
9
 
8
10
  # Application root where config/features.yml or config/features/ is found
9
11
  AbstractFeatureBranch.application_root = Rails.root
@@ -24,4 +26,4 @@ AbstractFeatureBranch.cacheable = {
24
26
  }
25
27
 
26
28
  # Pre-load application features to improve performance of first web-page hit
27
- AbstractFeatureBranch.load_application_features unless Rails.env.development?
29
+ AbstractFeatureBranch.load_application_features unless Rails.env.development?
metadata CHANGED
@@ -1,63 +1,104 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstract_feature_branch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Annas "Andy" Maleh
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-23 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.0.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
26
  version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: redis
28
+ name: jeweler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.0.0
34
- type: :runtime
33
+ version: 2.3.9
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.0.0
40
+ version: 2.3.9
41
41
  - !ruby/object:Gem::Dependency
42
- name: jeweler
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.1.4
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.1.4
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.14.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.14.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 5.1.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 5.1.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: psych
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
87
  - - '='
46
88
  - !ruby/object:Gem::Version
47
- version: 1.8.8
89
+ version: 3.3.4
48
90
  type: :development
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
94
  - - '='
53
95
  - !ruby/object:Gem::Version
54
- version: 1.8.8
96
+ version: 3.3.4
55
97
  description: |
56
98
  abstract_feature_branch is a Rails gem that enables developers to easily branch by abstraction as per this pattern:
57
99
  http://paulhammant.com/blog/branch_by_abstraction.html
58
100
 
59
- It is a productivity and fault tolerance enhancing team practice that has been utilized by professional software development
60
- teams at large corporations, such as Sears and Groupon.
101
+ It is a productivity and fault tolerance enhancing team practice.
61
102
 
62
103
  It provides the ability to wrap blocks of code with an abstract feature branch name, and then
63
104
  specify in a configuration file which features to be switched on or off.
@@ -73,29 +114,23 @@ description: |
73
114
  abstract_feature_branch additionally supports DDD's pattern of
74
115
  Bounded Contexts by allowing developers to configure
75
116
  context-specific feature files if needed.
76
- email:
117
+ email:
77
118
  executables: []
78
119
  extensions: []
79
120
  extra_rdoc_files:
121
+ - CHANGELOG.md
80
122
  - LICENSE.txt
81
123
  - README.md
82
124
  files:
83
- - .coveralls.yml
84
- - .travis.yml
125
+ - CHANGELOG.md
85
126
  - LICENSE.txt
86
127
  - README.md
87
- - RELEASE_NOTES.md
88
128
  - VERSION
89
129
  - abstract_feature_branch.gemspec
90
- - config/features/admin.local.yml
91
- - config/features/admin.yml
92
- - config/features/internal/wiki.local.yml
93
- - config/features/internal/wiki.yml
94
- - config/features/public.local.yml
95
- - config/features/public.yml
96
130
  - lib/abstract_feature_branch.rb
97
131
  - lib/abstract_feature_branch/configuration.rb
98
132
  - lib/abstract_feature_branch/file_beautifier.rb
133
+ - lib/abstract_feature_branch/redis/connection_pool_to_redis_adapter.rb
99
134
  - lib/ext/feature_branch.rb
100
135
  - lib/generators/abstract_feature_branch/context_generator.rb
101
136
  - lib/generators/abstract_feature_branch/install_generator.rb
@@ -104,51 +139,37 @@ files:
104
139
  - lib/generators/templates/config/features.yml
105
140
  - lib/generators/templates/config/initializers/abstract_feature_branch.rb
106
141
  - lib/generators/templates/lib/tasks/abstract_feature_branch.rake
107
- - ruby187.Gemfile
108
- - ruby187.Gemfile.lock
109
- - spec/abstract_feature_branch/file_beautifier_spec.rb
110
- - spec/ext/feature_branch__feature_branch_per_user_spec.rb
111
- - spec/ext/feature_branch__feature_branch_spec.rb
112
- - spec/ext/feature_branch__feature_enabled_spec.rb
113
- - spec/fixtures/application_development_config/config/features.reference.yml
114
- - spec/fixtures/application_no_config/no_config
115
- - spec/fixtures/application_rails_config/config/features.local.yml
116
- - spec/fixtures/application_rails_config/config/features.yml
117
- - spec/fixtures/application_ugly_config_reference/config/another_application_configuration.yml
118
- - spec/fixtures/application_ugly_config_reference/config/database.yml
119
- - spec/fixtures/application_ugly_config_reference/config/features.local.yml
120
- - spec/fixtures/application_ugly_config_reference/config/features.yml
121
- - spec/fixtures/application_ugly_config_reference/config/features/admin.local.yml
122
- - spec/fixtures/application_ugly_config_reference/config/features/admin.yml
123
- - spec/fixtures/application_ugly_config_reference/config/features/empty.local.yml
124
- - spec/fixtures/application_ugly_config_reference/config/features/feature_empty_config.local.yml
125
- - spec/fixtures/application_ugly_config_reference/config/features/including_comments.local.yml
126
- - spec/fixtures/application_ugly_config_reference/config/features/internal/wiki.local.yml
127
- - spec/fixtures/application_ugly_config_reference/config/features/internal/wiki.yml
128
- - spec/fixtures/application_ugly_config_reference/config/features/public.local.yml
129
- - spec/fixtures/application_ugly_config_reference/config/features/public.yml
130
142
  homepage: http://github.com/AndyObtiva/abstract_feature_branch
131
143
  licenses:
132
144
  - MIT
133
145
  metadata: {}
134
- post_install_message:
146
+ post_install_message: "\nRails-only post-install instructions:\n\n1) Run the following
147
+ command to generate the Rails initializer and basic feature files:\n\nrails g abstract_feature_branch:install\n\n2)
148
+ Optionally, you may run this command to generate feature files per context:\n\nrails
149
+ g abstract_feature_branch:context context_path\n \n3) Optionally, install Redis
150
+ server with [Homebrew](https://brew.sh/) by running:\n\nbrew install redis\n\n4)
151
+ Optionally, install redis client gem (required with Redis server) by adding the
152
+ following line to Gemfile above abstract_feature_branch:\n\ngem 'redis', '~> 5.0.5'\n\nAfterwards,
153
+ run:\n\nbundle\n\n5) Optionally, customize configuration in config/initializers/abstract_feature_branch.rb\n\n(can
154
+ be useful for changing location of feature files in Rails application,\nconfiguring
155
+ Redis with a Redis or ConnectionPool instance to use for overrides and per-user
156
+ feature enablement,\nand/or troubleshooting specific Rails environment feature configurations)\n\n"
135
157
  rdoc_options: []
136
158
  require_paths:
137
159
  - lib
138
160
  required_ruby_version: !ruby/object:Gem::Requirement
139
161
  requirements:
140
- - - '>='
162
+ - - ">="
141
163
  - !ruby/object:Gem::Version
142
164
  version: '0'
143
165
  required_rubygems_version: !ruby/object:Gem::Requirement
144
166
  requirements:
145
- - - '>='
167
+ - - ">="
146
168
  - !ruby/object:Gem::Version
147
169
  version: '0'
148
170
  requirements: []
149
- rubyforge_project:
150
- rubygems_version: 2.0.6
151
- signing_key:
171
+ rubygems_version: 3.3.6
172
+ signing_key:
152
173
  specification_version: 4
153
174
  summary: 'abstract_feature_branch is a Rails gem that enables developers to easily
154
175
  branch by abstraction as per this pattern: http://paulhammant.com/blog/branch_by_abstraction.html'
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- repo_token: ylr6gphUkEVGf9nvY5Hfz48RHZnOf0Jjv
data/.travis.yml DELETED
@@ -1,40 +0,0 @@
1
- language: ruby
2
- services:
3
- - redis-server
4
- rvm:
5
- - 2.0.0
6
- - 1.9.3
7
- - 1.8.7
8
- - ree
9
- - jruby-18mode
10
- - jruby-19mode
11
- - rbx-2.1.1
12
- gemfile:
13
- - Gemfile
14
- - ruby187.Gemfile
15
- matrix:
16
- exclude:
17
- - rvm: 2.0.0
18
- gemfile: ruby187.Gemfile
19
- - rvm: 1.9.3
20
- gemfile: ruby187.Gemfile
21
- - rvm: 1.8.7
22
- gemfile: Gemfile
23
- - rvm: 1.8.7
24
- gemfile: ruby187.Gemfile
25
- - rvm: ree
26
- gemfile: Gemfile
27
- - rvm: ree
28
- gemfile: ruby187.Gemfile
29
- - rvm: jruby-18mode
30
- gemfile: Gemfile
31
- - rvm: jruby-18mode
32
- gemfile: ruby187.Gemfile
33
- - rvm: jruby-19mode
34
- gemfile: ruby187.Gemfile
35
- - rvm: jruby-19mode
36
- gemfile: Gemfile
37
- - rvm: rbx-2.1.1
38
- gemfile: Gemfile
39
- - rvm: rbx-2.1.1
40
- gemfile: ruby187.Gemfile
data/RELEASE_NOTES.md DELETED
@@ -1,55 +0,0 @@
1
- Release Notes
2
- -------------
3
-
4
- Version 1.0.0:
5
- - Added configuration support for feature cacheability. Completed documentation, adding more details.
6
-
7
- Version 0.9.0:
8
- - Added support for runtime read of feature files in development to ease local testing (trading off performance)
9
-
10
- Version 0.8.0:
11
- - Added rake task for beautifying feature files, sorting feature names within environment sections and eliminating extra empty lines. Added support for externalized logger.
12
-
13
- Version 0.7.1:
14
- - Fixed undefined method issue with using <code>AbstractFeatureBranch.load_application_features</code> to improve first use performance
15
-
16
- Version 0.7.0:
17
- - Added support for general Ruby use (without Rails) by externalizing AbstractFeatureBranch.application_root and AbstractFeatureBranch.application_environment. Added initializer to optionally configure them. Supported case-insensitive feature names.
18
-
19
- Version 0.6.1 - 0.6.4:
20
- - Fixed issues including making feature configuration files optional (in case one wants to get rid of <code>features.local.yml</code> or even <code>features.yml</code>)
21
-
22
- Version 0.6.0:
23
- - Added a context generator and support for reading feature configuration from context files <code>config/features/**/*.yml</code> and <code>config/features/**/*.local.yml</code>
24
-
25
- Version 0.5.0:
26
- - Added support for local configuration feature ignored by git + some performance optimizations via configuration caching and better algorithms.
27
-
28
- Version 0.4.0:
29
- - Added support for overwriting feature configuration with environment variable overrides. Very useful on Heroku to quickly enable/disable features without a redeploy.
30
-
31
- Version 0.3.6:
32
- - Fixed feature_branch issue with invalid feature name, preventing block execution and returning nil instead
33
-
34
- Version 0.3.5:
35
- - Fixed issue with generator not allowing consuming client app to start Rails server successfully
36
-
37
- Version 0.3.4:
38
- - Added <code>abstract_feature_branch:install</code> generator to easily get started with a sample <code>config/features.yml</code>
39
-
40
- Version 0.3.3:
41
- - Removed version from README title
42
-
43
- Version 0.3.2:
44
- - Added <code>AbstractFeatureBranch.features</code> to delay YAML load until <code>Rails.root</code> has been established
45
-
46
- Version 0.3.1:
47
- - Removed dependency on the rails_config gem
48
-
49
- Version 0.3.0:
50
- - Simplified <code>features.yml</code> requirement to have a features header under each environment
51
- - Moved feature storage from Settings object to <code>AbstractFeatureBranch::FEATURES</code>
52
-
53
- Version 0.2.0:
54
- - Support an "else" block to execute when a feature is off (via <code>:true</code> and <code>:false</code> lambda arguments)
55
- - Support ability to check if a feature is enabled or not (via <code>feature_enabled?</code>)
@@ -1,15 +0,0 @@
1
- defaults: &defaults
2
- admin_feature3: true
3
-
4
- development:
5
- <<: *defaults
6
-
7
- test:
8
- <<: *defaults
9
-
10
- staging:
11
- <<: *defaults
12
-
13
- production:
14
- <<: *defaults
15
-
@@ -1,17 +0,0 @@
1
- defaults: &defaults
2
- admin_feature1: true
3
- admin_feature2: false
4
- admin_feature3: false
5
-
6
- development:
7
- <<: *defaults
8
-
9
- test:
10
- <<: *defaults
11
-
12
- staging:
13
- <<: *defaults
14
-
15
- production:
16
- <<: *defaults
17
-
@@ -1,15 +0,0 @@
1
- defaults: &defaults
2
- wiki_feature3: true
3
-
4
- development:
5
- <<: *defaults
6
-
7
- test:
8
- <<: *defaults
9
-
10
- staging:
11
- <<: *defaults
12
-
13
- production:
14
- <<: *defaults
15
-
@@ -1,17 +0,0 @@
1
- defaults: &defaults
2
- wiki_feature1: true
3
- wiki_feature2: false
4
- wiki_feature3: false
5
-
6
- development:
7
- <<: *defaults
8
-
9
- test:
10
- <<: *defaults
11
-
12
- staging:
13
- <<: *defaults
14
-
15
- production:
16
- <<: *defaults
17
-
@@ -1,15 +0,0 @@
1
- defaults: &defaults
2
- public_feature3: true
3
-
4
- development:
5
- <<: *defaults
6
-
7
- test:
8
- <<: *defaults
9
-
10
- staging:
11
- <<: *defaults
12
-
13
- production:
14
- <<: *defaults
15
-
@@ -1,17 +0,0 @@
1
- defaults: &defaults
2
- public_feature1: true
3
- public_feature2: false
4
- public_feature3: false
5
-
6
- development:
7
- <<: *defaults
8
-
9
- test:
10
- <<: *defaults
11
-
12
- staging:
13
- <<: *defaults
14
-
15
- production:
16
- <<: *defaults
17
-
data/ruby187.Gemfile DELETED
@@ -1,12 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'deep_merge', '1.0.0', :require => false #avoid loading into memory to use deep_merge only if Rails is unavailable
4
- gem 'redis', '~> 3.0.0', :require => false
5
-
6
- group :development do
7
- gem 'jeweler', '1.8.8'
8
- end
9
-
10
- group :test do
11
- gem 'rspec', '2.14.1'
12
- end
data/ruby187.Gemfile.lock DELETED
@@ -1,63 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- addressable (2.3.5)
5
- builder (3.2.2)
6
- deep_merge (1.0.0)
7
- diff-lcs (1.2.5)
8
- faraday (0.8.9)
9
- multipart-post (~> 1.2.0)
10
- git (1.2.6)
11
- github_api (0.10.1)
12
- addressable
13
- faraday (~> 0.8.1)
14
- hashie (>= 1.2)
15
- multi_json (~> 1.4)
16
- nokogiri (~> 1.5.2)
17
- oauth2
18
- hashie (2.0.5)
19
- highline (1.6.20)
20
- httpauth (0.2.0)
21
- jeweler (1.8.8)
22
- builder
23
- bundler (~> 1.0)
24
- git (>= 1.2.5)
25
- github_api (= 0.10.1)
26
- highline (>= 1.6.15)
27
- nokogiri (= 1.5.10)
28
- rake
29
- rdoc
30
- json (1.8.1)
31
- jwt (0.1.10)
32
- multi_json (>= 1.5)
33
- multi_json (1.8.4)
34
- multi_xml (0.5.5)
35
- multipart-post (1.2.0)
36
- nokogiri (1.5.10)
37
- oauth2 (0.9.2)
38
- faraday (~> 0.8)
39
- httpauth (~> 0.2)
40
- jwt (~> 0.1.4)
41
- multi_json (~> 1.0)
42
- multi_xml (~> 0.5)
43
- rack (~> 1.2)
44
- rack (1.5.2)
45
- rake (10.1.1)
46
- rdoc (4.1.1)
47
- json (~> 1.4)
48
- rspec (2.14.1)
49
- rspec-core (~> 2.14.0)
50
- rspec-expectations (~> 2.14.0)
51
- rspec-mocks (~> 2.14.0)
52
- rspec-core (2.14.7)
53
- rspec-expectations (2.14.4)
54
- diff-lcs (>= 1.1.3, < 2.0)
55
- rspec-mocks (2.14.4)
56
-
57
- PLATFORMS
58
- ruby
59
-
60
- DEPENDENCIES
61
- deep_merge (= 1.0.0)
62
- jeweler (= 1.8.8)
63
- rspec (= 2.14.1)