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.
@@ -30,7 +30,9 @@ module FluidFeatures
30
30
  @sending = false
31
31
  configure(app)
32
32
  at_exit do
33
- buckets_storage.append(@buckets)
33
+ if @buckets_storage and @buckets
34
+ @buckets_storage.append(@buckets)
35
+ end
34
36
  end
35
37
  end
36
38
 
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module FluidFeatures
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
@@ -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.0
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 00:00:00.000000000 Z
12
+ date: 2013-01-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: persistent_http