feature_creep-simple_strategy 0.0.1 → 0.0.2

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.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
@@ -0,0 +1,31 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "feature_creep/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "feature_creep-simple_strategy"
7
+ s.version = FeatureCreep::SimpleStrategy::VERSION
8
+ s.authors = ["Christian Trosclair"]
9
+ s.email = ["xn@hybridgroup.com"]
10
+ s.description = "simple strategy implementation for feature_creep"
11
+ s.summary = "simple strategy implementation for feature_creep"
12
+ s.homepage = "https://github.com/hybridgroup/feature_creep-simple_strategy"
13
+
14
+ s.require_paths = ["lib"]
15
+
16
+ s.rubyforge_project = "feature_creep-simple_strategy"
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+
23
+ # specify any dependencies here; for example:
24
+ s.add_development_dependency "rspec", "~> 2.10.0"
25
+ s.add_development_dependency "bundler", ">= 1.0.0"
26
+ s.add_development_dependency "jeweler", "~> 1.6.4"
27
+ s.add_development_dependency "bourne", "1.0"
28
+ s.add_development_dependency "mocha", "0.9.8"
29
+ s.add_development_dependency "pry", "0.9.10"
30
+
31
+ end
@@ -0,0 +1 @@
1
+ require "feature_creep/simple_strategy"
@@ -0,0 +1,36 @@
1
+ class FeatureCreep
2
+ class SimpleStrategy
3
+
4
+ def self.info
5
+ lambda { |creep,feature|
6
+ if feature
7
+ {
8
+ :percentage => (creep.active_percentage(feature) || 0).to_i,
9
+ :scopes => creep.active_scopes(feature).map { |g| g.to_sym },
10
+ :agent_ids => creep.active_agent_ids(feature),
11
+ :global => creep.active_global_features,
12
+ :available_features => creep.features
13
+ }
14
+ else
15
+ {
16
+ :global => creep.active_global_features,
17
+ :available_features => creep.features
18
+ }
19
+ end
20
+ }
21
+ end
22
+
23
+ def self.warden
24
+ lambda { |creep,feature,agent_id|
25
+ if agent_id
26
+ creep.active_globally?(feature) ||
27
+ creep.agent_id_in_active_scope?(feature, agent_id) ||
28
+ creep.agent_id_active?(feature, agent_id) ||
29
+ creep.agent_id_within_active_percentage?(feature, agent_id)
30
+ else
31
+ creep.active_globally?(feature)
32
+ end
33
+ }
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,5 @@
1
+ class FeatureCreep
2
+ class SimpleStrategy
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_creep-simple_strategy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,7 +115,12 @@ extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
117
  - .gitignore
118
+ - Gemfile
118
119
  - README.md
120
+ - feature_creep-simple_strategy.gemspec
121
+ - lib/feature_creep.rb
122
+ - lib/feature_creep/simple_strategy.rb
123
+ - lib/feature_creep/version.rb
119
124
  homepage: https://github.com/hybridgroup/feature_creep-simple_strategy
120
125
  licenses: []
121
126
  post_install_message:
@@ -139,5 +144,5 @@ rubyforge_project: feature_creep-simple_strategy
139
144
  rubygems_version: 1.8.24
140
145
  signing_key:
141
146
  specification_version: 3
142
- summary: simple strategy implementation for
147
+ summary: simple strategy implementation for feature_creep
143
148
  test_files: []