abstract_feature_branch 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -111,17 +111,17 @@ for better maintenance as the need is not longer there for feature branching at
111
111
  Release Notes
112
112
  -------------
113
113
 
114
- Version 0.3.1:
114
+ Version 0.3.2:
115
+ - Added AbstractFeatureBranch.features to delay YAML load until Rails.root has been established
115
116
 
117
+ Version 0.3.1:
116
118
  - Removed dependency on the rails_config gem
117
119
 
118
120
  Version 0.3.0:
119
-
120
121
  - Simplified features.yml requirement to have a features header under each environment
121
122
  - Moved feature storage from Settings object to AbstractFeatureBranch::FEATURES
122
123
 
123
124
  Version 0.2.0:
124
-
125
125
  - Support an "else" block to execute when a feature is off (via :true and :false lambda arguments)
126
126
  - Support ability to check if a feature is enabled or not (via feature_enabled?)
127
127
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "abstract_feature_branch"
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Annas \"Andy\" Maleh"]
@@ -10,7 +10,9 @@ rescue Bundler::BundlerError => e
10
10
  end
11
11
 
12
12
  module AbstractFeatureBranch
13
- FEATURES = YAML.load_file(File.join(Rails.root, 'config', 'features.yml'))
13
+ def self.features
14
+ @features ||= YAML.load_file(File.join(Rails.root, 'config', 'features.yml'))
15
+ end
14
16
  end
15
17
 
16
18
  require File.join(File.dirname(__FILE__), 'ext', 'feature_branch')
@@ -3,13 +3,13 @@ class Object
3
3
  def self.feature_branch(feature_name, branches = {}, &feature_work)
4
4
  branches[:true] ||= feature_work
5
5
  branches[:false] ||= lambda {}
6
- feature_status = AbstractFeatureBranch::FEATURES[Rails.env.to_s][feature_name.to_s].to_s.to_sym
6
+ feature_status = AbstractFeatureBranch.features[Rails.env.to_s][feature_name.to_s].to_s.to_sym
7
7
  branches[feature_status].call
8
8
  end
9
9
 
10
10
  raise 'Abstract feature branch conflicts with another Ruby library' if respond_to?(:feature_enabled?)
11
11
  def self.feature_enabled?(feature_name)
12
- AbstractFeatureBranch::FEATURES[Rails.env.to_s][feature_name.to_s]
12
+ AbstractFeatureBranch.features[Rails.env.to_s][feature_name.to_s]
13
13
  end
14
14
 
15
15
  raise 'Abstract feature branch conflicts with another Ruby library' if Object.new.respond_to?(:feature_branch)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstract_feature_branch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  segments:
111
111
  - 0
112
- hash: 1407003154867590840
112
+ hash: -2408049150317696638
113
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  none: false
115
115
  requirements: