verdict 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1f491060e7463a0121982c8a73c55c164e7a5b1
4
- data.tar.gz: 86ec4f4226aae28170ab89a1f9e3b6f4ef7150e3
3
+ metadata.gz: 2e529fa9948f7f7176df69a622210e40594d3c91
4
+ data.tar.gz: e576284cd0a3eed14ebb597acf31bbf87b86a681
5
5
  SHA512:
6
- metadata.gz: a139d649a3990f8d2336dbb24ed980edfc344b03c621fee969137b8bd2e063ac0dbfc36801dcda2d044e0a484094da82380dc0e3332e12c9684120e49e7b0e79
7
- data.tar.gz: d3c25106668841a418b3e5ee9e95dd929964da20f8b82ed5d85345b9e1d29dd22483f2581d622539bcaef9f1d01b5634d078cc821735c5dae5387247dc0341b0
6
+ metadata.gz: 8347a5f689329717098cb9d9d42c3c78731a55863e5f1fe8c6debf6db3f8155ffd65fb22b4d7af50d05a05e1980af41d42e5a72bef81ce84cd43371b045bf0e9
7
+ data.tar.gz: 3a27b4ff3dd5db6705be1f715cfd1e8860a5df9c1b54344f5e3693ea6bf426d8c40f6b3d2a1e6f2007f0a7c94057325fb18c2dabe9e1ed5f1dc287e5c1db7a8e
@@ -3,9 +3,9 @@ script: bundle exec rake
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
- - 2.1.0
6
+ - 2.1.1
7
7
  - ruby-head
8
- - rbx-2.2.6
8
+ - rbx-2
9
9
  - jruby-19mode
10
10
  matrix:
11
11
  allow_failures:
@@ -76,6 +76,8 @@ class Verdict::Experiment
76
76
 
77
77
  def started_at
78
78
  @started_at ||= @storage.retrieve_start_timestamp(self)
79
+ rescue Verdict::StorageError => e
80
+ nil
79
81
  end
80
82
 
81
83
  def started?
@@ -264,5 +266,7 @@ class Verdict::Experiment
264
266
 
265
267
  def ensure_experiment_has_started
266
268
  @started_at ||= @storage.retrieve_start_timestamp(self) || set_start_timestamp
269
+ rescue Verdict::StorageError
270
+ @started_at ||= Time.now.utc
267
271
  end
268
272
  end
@@ -30,19 +30,24 @@ module Verdict
30
30
 
31
31
  def remove_assignment(experiment, subject_identifier)
32
32
  redis.hdel(generate_experiment_key(experiment), subject_identifier)
33
+ rescue ::Redis::BaseError => e
34
+ raise Verdict::StorageError, "Redis error: #{e.message}"
33
35
  end
34
36
 
35
37
  def retrieve_start_timestamp(experiment)
36
38
  if started_at = redis.get(generate_experiment_start_timestamp_key(experiment))
37
39
  DateTime.parse(started_at).to_time
38
40
  end
41
+ rescue ::Redis::BaseError => e
42
+ raise Verdict::StorageError, "Redis error: #{e.message}"
39
43
  end
40
44
 
41
45
  def store_start_timestamp(experiment, timestamp)
42
46
  redis.setnx(generate_experiment_start_timestamp_key(experiment), timestamp.to_s)
47
+ rescue ::Redis::BaseError => e
48
+ raise Verdict::StorageError, "Redis error: #{e.message}"
43
49
  end
44
50
 
45
-
46
51
  private
47
52
 
48
53
  def generate_experiment_key(experiment)
@@ -1,3 +1,3 @@
1
1
  module Verdict
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verdict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-16 00:00:00.000000000 Z
11
+ date: 2014-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest