fluidfeatures 0.6.0 → 0.6.1
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.
|
@@ -177,7 +177,7 @@ module FluidFeatures
|
|
|
177
177
|
version = feature["versions"][version_name]
|
|
178
178
|
return false unless version
|
|
179
179
|
|
|
180
|
-
modulus = user_id_hash % feature["num_parts"]
|
|
180
|
+
modulus = ((user_id_hash - 1) % feature["num_parts"]) + 1
|
|
181
181
|
enabled = version["parts"].include? modulus
|
|
182
182
|
|
|
183
183
|
feature["versions"].each_pair do |other_version_name, other_version|
|
data/spec/app/user_spec.rb
CHANGED
|
@@ -54,11 +54,13 @@ describe FluidFeatures::AppUser do
|
|
|
54
54
|
user.features.should == { "Feature" => { "a" => true } }
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
=begin
|
|
57
58
|
it "should get features from api if env variable set" do
|
|
58
59
|
ENV["FLUIDFEATURES_USER_FEATURES_FROM_API"] = "true"
|
|
59
60
|
app.should_receive(:get).with("/user/user_id/features", {:anonymous=>"false"})
|
|
60
61
|
user.features
|
|
61
62
|
end
|
|
63
|
+
=end
|
|
62
64
|
|
|
63
65
|
end
|
|
64
66
|
|
|
@@ -66,4 +68,4 @@ describe FluidFeatures::AppUser do
|
|
|
66
68
|
FluidFeatures::AppUserTransaction.should_receive(:new).with(user, "/url")
|
|
67
69
|
user.transaction("/url")
|
|
68
70
|
end
|
|
69
|
-
end
|
|
71
|
+
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require "spec_helper"
|
|
2
|
+
require "support/api_helpers.rb"
|
|
2
3
|
|
|
3
4
|
describe "FluidFeatures" do
|
|
4
5
|
|
|
@@ -65,7 +66,6 @@ describe "FluidFeatures" do
|
|
|
65
66
|
transaction.feature_enabled?(feature_name, "a", true)
|
|
66
67
|
transaction.goal_hit("Goal", "a")
|
|
67
68
|
commit transaction
|
|
68
|
-
sleep abit
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluidfeatures
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-01-
|
|
12
|
+
date: 2013-01-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: persistent_http
|