find_cache 0.1.0 → 0.1.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.
data/lib/find_cache.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  require "active_support"
2
3
  require "active_record"
3
4
  require "find_cache/init"
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module FindCache
2
3
  module Cacheable
3
4
  extend ActiveSupport::Concern
@@ -1 +1,2 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  $find_cache_store = {}
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module FindCache
2
3
  class KeyGen
3
4
  require "simple_uuid"
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module FindCache
2
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
3
4
  end
Binary file
@@ -222,3 +222,54 @@ Connecting to database specified by database.yml
222
222
  User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
223
223
  User Load (0.1ms) SELECT "users".* FROM "users" LIMIT 1
224
224
  Post Load (0.3ms) SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
225
+ Connecting to database specified by database.yml
226
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" LIMIT 1
227
+  (0.1ms) begin transaction
228
+ SQL (42.0ms) INSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?) [["content", "test content for comment"], ["created_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00]]
229
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
230
+ SQL (0.3ms) UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1
231
+  (1.9ms) commit transaction
232
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
233
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
234
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" LIMIT 1
235
+  (0.0ms) begin transaction
236
+ SQL (0.4ms) INSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?) [["content", "test 1 content for comment"], ["created_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00]]
237
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
238
+ SQL (0.1ms) UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1
239
+  (2.3ms) commit transaction
240
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" LIMIT 1
241
+  (0.0ms) begin transaction
242
+ SQL (0.4ms) INSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?) [["content", "test 2 content for comment"], ["created_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00]]
243
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
244
+ SQL (0.1ms) UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1
245
+  (1.7ms) commit transaction
246
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" LIMIT 1
247
+  (0.0ms) begin transaction
248
+ SQL (0.3ms) INSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?) [["content", "test 3 content for comment"], ["created_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00]]
249
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
250
+ SQL (0.1ms) UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1
251
+  (1.8ms) commit transaction
252
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" LIMIT 1
253
+  (0.0ms) begin transaction
254
+ SQL (0.3ms) INSERT INTO "comments" ("content", "created_at", "post_id", "updated_at") VALUES (?, ?, ?, ?) [["content", "test 4 content for comment"], ["created_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["post_id", 1], ["updated_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00]]
255
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
256
+ SQL (0.1ms) UPDATE "posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "posts"."id" = 1
257
+  (1.4ms) commit transaction
258
+ Comment Load (0.4ms) SELECT "comments".* FROM "comments" WHERE "comments"."id" IN (17, 18, 19, 20) ORDER BY id ASC
259
+ Comment Load (0.2ms) SELECT "comments".* FROM "comments" WHERE "comments"."id" IN (17, 18, 19, 20) ORDER BY id ASC
260
+ Post Load (0.3ms) SELECT "posts".* FROM "posts" LIMIT 1
261
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
262
+  (0.1ms) begin transaction
263
+  (0.1ms) commit transaction
264
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
265
+ Post Load (0.3ms) SELECT "posts".* FROM "posts" LIMIT 1
266
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
267
+  (0.1ms) begin transaction
268
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "password", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["email", "test@videofork.com"], ["password", "test1234"], ["updated_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00]]
269
+ SQL (0.4ms) INSERT INTO "posts" ("body", "comments_count", "created_at", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["comments_count", nil], ["created_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["title", nil], ["updated_at", Fri, 24 Aug 2012 22:31:19 UTC +00:00], ["user_id", 7]]
270
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 7 LIMIT 1
271
+  (2.3ms) commit transaction
272
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 7 LIMIT 1
273
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 7 LIMIT 1
274
+ User Load (0.2ms) SELECT "users".* FROM "users" LIMIT 1
275
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 LIMIT 1
Binary file
@@ -48,4 +48,4 @@ class FindCacheTest < Test::Unit::TestCase
48
48
  assert_equal Comment.order("id ASC").find_all_by_id(ids), Comment.find_all_cache(ids, "id ASC")
49
49
  end
50
50
 
51
- end
51
+ end
data/test/test_helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  # Configure Rails Environment
2
3
  ENV["RAILS_ENV"] = "test"
3
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: find_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.1.0
21
+ version: 3.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 3.1.0
29
+ version: 3.2.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: simple_uuid
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -148,6 +148,7 @@ files:
148
148
  - test/dummy/tmp/cache/271/570/User%2F4
149
149
  - test/dummy/tmp/cache/272/580/User%2F5
150
150
  - test/dummy/tmp/cache/273/590/User%2F6
151
+ - test/dummy/tmp/cache/274/5A0/User%2F7
151
152
  - test/dummy/tmp/cache/275/6E0/Post%2F1
152
153
  - test/dummy/tmp/cache/276/6F0/Post%2F2
153
154
  - test/dummy/tmp/cache/277/700/Post%2F3
@@ -155,10 +156,14 @@ files:
155
156
  - test/dummy/tmp/cache/3A9/080/Comment%2F8
156
157
  - test/dummy/tmp/cache/3AA/090/Comment%2F9
157
158
  - test/dummy/tmp/cache/3D2/D30/Comment%2F10
159
+ - test/dummy/tmp/cache/3D3/D50/Comment%2F20
158
160
  - test/dummy/tmp/cache/3D4/D50/Comment%2F12
159
161
  - test/dummy/tmp/cache/3D5/D60/Comment%2F13
160
162
  - test/dummy/tmp/cache/3D6/D70/Comment%2F14
161
163
  - test/dummy/tmp/cache/3D7/D80/Comment%2F15
164
+ - test/dummy/tmp/cache/3D9/DA0/Comment%2F17
165
+ - test/dummy/tmp/cache/3DA/DB0/Comment%2F18
166
+ - test/dummy/tmp/cache/3DB/DC0/Comment%2F19
162
167
  - test/dummy/tmp/cache/58D/B70/Post%2Fuser_id-1
163
168
  - test/find_cache_test.rb
164
169
  - test/test_helper.rb
@@ -174,18 +179,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
179
  - - ! '>='
175
180
  - !ruby/object:Gem::Version
176
181
  version: '0'
177
- segments:
178
- - 0
179
- hash: -1945955979138925529
180
182
  required_rubygems_version: !ruby/object:Gem::Requirement
181
183
  none: false
182
184
  requirements:
183
185
  - - ! '>='
184
186
  - !ruby/object:Gem::Version
185
187
  version: '0'
186
- segments:
187
- - 0
188
- hash: -1945955979138925529
189
188
  requirements: []
190
189
  rubyforge_project:
191
190
  rubygems_version: 1.8.24
@@ -245,6 +244,7 @@ test_files:
245
244
  - test/dummy/tmp/cache/271/570/User%2F4
246
245
  - test/dummy/tmp/cache/272/580/User%2F5
247
246
  - test/dummy/tmp/cache/273/590/User%2F6
247
+ - test/dummy/tmp/cache/274/5A0/User%2F7
248
248
  - test/dummy/tmp/cache/275/6E0/Post%2F1
249
249
  - test/dummy/tmp/cache/276/6F0/Post%2F2
250
250
  - test/dummy/tmp/cache/277/700/Post%2F3
@@ -252,10 +252,14 @@ test_files:
252
252
  - test/dummy/tmp/cache/3A9/080/Comment%2F8
253
253
  - test/dummy/tmp/cache/3AA/090/Comment%2F9
254
254
  - test/dummy/tmp/cache/3D2/D30/Comment%2F10
255
+ - test/dummy/tmp/cache/3D3/D50/Comment%2F20
255
256
  - test/dummy/tmp/cache/3D4/D50/Comment%2F12
256
257
  - test/dummy/tmp/cache/3D5/D60/Comment%2F13
257
258
  - test/dummy/tmp/cache/3D6/D70/Comment%2F14
258
259
  - test/dummy/tmp/cache/3D7/D80/Comment%2F15
260
+ - test/dummy/tmp/cache/3D9/DA0/Comment%2F17
261
+ - test/dummy/tmp/cache/3DA/DB0/Comment%2F18
262
+ - test/dummy/tmp/cache/3DB/DC0/Comment%2F19
259
263
  - test/dummy/tmp/cache/58D/B70/Post%2Fuser_id-1
260
264
  - test/find_cache_test.rb
261
265
  - test/test_helper.rb