hide_and_seek 0.0.3 → 0.0.4

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: 83800f7d5e43e81cd39524fc7550443e11888be6
4
- data.tar.gz: 04b10c2555aac4acd743f8b04dc8c692e34d95d0
3
+ metadata.gz: e6bf4e77c74f301d4926d042aa2c214737f8313d
4
+ data.tar.gz: 6a75a4359ffbeafc02e699082621fdee30b8b028
5
5
  SHA512:
6
- metadata.gz: c4931136212bb4a820e98aaebc155f67107fa3293d660b22c84a2d7c4c9775f2b9921942ed3a57e541c31fbd73655b14e1c1e801d75c498d2ab38c6555780f3c
7
- data.tar.gz: b874c628de163fd4069858f10d175737776ae2d6ff8dcdc74f4c80c7860ca8ddf5edfc6130a2b052b83e2cf895ad46f9c6df810c1add53b03d6687050898ac7a
6
+ metadata.gz: fee4d3701b107bc43e39cefa779c59c01453ed03d5605bb4cb06dbf1729919ce338bb16c37b85062ac145be39b1ba1e52b63e4c61735b487c5ff9966d31ed513
7
+ data.tar.gz: 6d66a72405dc445aec7fcd8be513d05d6b489d2c6a1d743d39274e0218955645e0eb03b34aab4d70a6d522383d890211ada45bb563ea2895c94273065c13c074
@@ -8,7 +8,7 @@ class HideAndSeek::Item
8
8
  def display?(item_name, user_identifier)
9
9
  @item_name = item_name
10
10
  @user_identifier = user_identifier
11
- return false if $redis.exists(key_name) == 1
11
+ return false if $redis.exists(key_name)
12
12
  return true
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module HideAndSeek
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -9,11 +9,11 @@ describe HideAndSeek::Item, :type => :model do
9
9
 
10
10
  describe "#display?" do
11
11
  it "should return false if key exists" do
12
- allow($redis).to receive(:exists).with("foo-1").and_return 1
12
+ allow($redis).to receive(:exists).with("foo-1").and_return true
13
13
  expect(subject.display?("foo", 1)).to be false
14
14
  end
15
15
  it "should return true if key doesn't exist" do
16
- allow($redis).to receive(:exists).with("foo-1").and_return 0
16
+ allow($redis).to receive(:exists).with("foo-1").and_return false
17
17
  expect(subject.display?("foo", 1)).to be true
18
18
  end
19
19
  end
@@ -1,6 +1,6 @@
1
1
  require 'redis'
2
2
  require 'redis-namespace'
3
3
 
4
- $redis = Redis.new
4
+ $redis = Redis.new(logger: Rails.logger)
5
5
  $ns = Redis::Namespace.new("hide-and-seek-#{Rails.env}", :redis => $redis)
6
6
  $hide_and_seek = HideAndSeek::Item.new($ns)
@@ -0,0 +1,16 @@
1
+ [Redis] command=EXISTS args="foo-1"
2
+ [Redis] call_time=0.57 ms
3
+ [Redis] command=SET args="foo-1" "2015-04-11 21:50:07 -0700"
4
+ [Redis] call_time=0.26 ms
5
+ [Redis] command=EXISTS args="foo-1"
6
+ [Redis] call_time=0.29 ms
7
+ [Redis] command=EXISTS args="foo-1"
8
+ [Redis] call_time=1.05 ms
9
+ @@@@@@@@@true
10
+ [Redis] command=EXISTS args="foo-1"
11
+ [Redis] call_time=1.10 ms
12
+ [Redis] command=EXISTS args="foo-2"
13
+ [Redis] call_time=0.26 ms
14
+ [Redis] command=SET args="foo-2" "2015-04-11 21:54:33 -0700"
15
+ [Redis] call_time=0.23 ms
16
+ ----OK
@@ -3136,3 +3136,110 @@ Processing by HideAndSeek::ItemsController#show as JSON
3136
3136
  Parameters: {"id"=>"foo"}
3137
3137
  Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
3138
3138
   (0.1ms) rollback transaction
3139
+  (2.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
3140
+  (0.1ms) select sqlite_version(*)
3141
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3142
+  (0.1ms) begin transaction
3143
+ Processing by HideAndSeek::ItemsController#update as JSON
3144
+ Parameters: {"id"=>"foo"}
3145
+ Completed 502 Bad Gateway in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3146
+  (0.1ms) rollback transaction
3147
+  (0.1ms) begin transaction
3148
+ Processing by HideAndSeek::ItemsController#update as JSON
3149
+ Parameters: {"user_id"=>9001, "id"=>"foo"}
3150
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3151
+  (0.1ms) rollback transaction
3152
+  (0.0ms) begin transaction
3153
+ Processing by HideAndSeek::ItemsController#update as JSON
3154
+ Parameters: {"id"=>"foo"}
3155
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3156
+  (0.1ms) rollback transaction
3157
+  (0.0ms) begin transaction
3158
+ Processing by HideAndSeek::ItemsController#update as JSON
3159
+ Parameters: {"id"=>"foo"}
3160
+ Completed 502 Bad Gateway in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3161
+  (0.0ms) rollback transaction
3162
+  (0.0ms) begin transaction
3163
+ Processing by HideAndSeek::ItemsController#show as JSON
3164
+ Parameters: {"id"=>"foo"}
3165
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3166
+  (0.1ms) rollback transaction
3167
+  (0.0ms) begin transaction
3168
+ Processing by HideAndSeek::ItemsController#show as JSON
3169
+ Parameters: {"user_id"=>9001, "id"=>"foo"}
3170
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3171
+  (0.1ms) rollback transaction
3172
+  (0.0ms) begin transaction
3173
+ Processing by HideAndSeek::ItemsController#show as JSON
3174
+ Parameters: {"id"=>"foo"}
3175
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3176
+  (0.1ms) rollback transaction
3177
+  (0.0ms) begin transaction
3178
+ Processing by HideAndSeek::ItemsController#show as JSON
3179
+ Parameters: {"id"=>"foo"}
3180
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3181
+  (0.0ms) rollback transaction
3182
+  (0.0ms) begin transaction
3183
+  (0.1ms) rollback transaction
3184
+  (0.0ms) begin transaction
3185
+  (0.0ms) rollback transaction
3186
+  (0.0ms) begin transaction
3187
+  (0.0ms) rollback transaction
3188
+  (0.0ms) begin transaction
3189
+  (0.0ms) rollback transaction
3190
+  (0.0ms) begin transaction
3191
+  (0.0ms) rollback transaction
3192
+  (0.0ms) begin transaction
3193
+  (0.0ms) rollback transaction
3194
+  (0.0ms) begin transaction
3195
+  (0.0ms) rollback transaction
3196
+  (0.0ms) begin transaction
3197
+  (0.0ms) rollback transaction
3198
+  (0.1ms) begin transaction
3199
+  (0.0ms) rollback transaction
3200
+  (0.0ms) begin transaction
3201
+  (0.0ms) rollback transaction
3202
+  (0.0ms) begin transaction
3203
+  (0.0ms) rollback transaction
3204
+  (0.0ms) begin transaction
3205
+  (0.0ms) rollback transaction
3206
+  (0.0ms) begin transaction
3207
+ Processing by HideAndSeek::ItemsController#update as JSON
3208
+ Parameters: {"id"=>"foo"}
3209
+ Completed 502 Bad Gateway in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3210
+  (0.1ms) rollback transaction
3211
+  (0.0ms) begin transaction
3212
+ Processing by HideAndSeek::ItemsController#update as JSON
3213
+ Parameters: {"user_id"=>9001, "id"=>"foo"}
3214
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3215
+  (0.0ms) rollback transaction
3216
+  (0.0ms) begin transaction
3217
+ Processing by HideAndSeek::ItemsController#update as JSON
3218
+ Parameters: {"id"=>"foo"}
3219
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3220
+  (0.1ms) rollback transaction
3221
+  (24.8ms) begin transaction
3222
+ Processing by HideAndSeek::ItemsController#update as JSON
3223
+ Parameters: {"id"=>"foo"}
3224
+ Completed 502 Bad Gateway in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
3225
+  (0.1ms) rollback transaction
3226
+  (0.0ms) begin transaction
3227
+ Processing by HideAndSeek::ItemsController#show as JSON
3228
+ Parameters: {"id"=>"foo"}
3229
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3230
+  (0.1ms) rollback transaction
3231
+  (0.0ms) begin transaction
3232
+ Processing by HideAndSeek::ItemsController#show as JSON
3233
+ Parameters: {"user_id"=>9001, "id"=>"foo"}
3234
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3235
+  (0.1ms) rollback transaction
3236
+  (0.0ms) begin transaction
3237
+ Processing by HideAndSeek::ItemsController#show as JSON
3238
+ Parameters: {"id"=>"foo"}
3239
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
3240
+  (0.1ms) rollback transaction
3241
+  (0.0ms) begin transaction
3242
+ Processing by HideAndSeek::ItemsController#show as JSON
3243
+ Parameters: {"id"=>"foo"}
3244
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
3245
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hide_and_seek
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - BJ Clark