find_cache 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/CHANGE-LOG +8 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +80 -0
  4. data/Rakefile +38 -0
  5. data/lib/find_cache.rb +5 -0
  6. data/lib/find_cache/cacheable.rb +88 -0
  7. data/lib/find_cache/init.rb +1 -0
  8. data/lib/find_cache/key_gen.rb +27 -0
  9. data/lib/find_cache/version.rb +3 -0
  10. data/lib/tasks/find_cache_tasks.rake +4 -0
  11. data/test/dummy/README.rdoc +261 -0
  12. data/test/dummy/Rakefile +7 -0
  13. data/test/dummy/app/assets/javascripts/application.js +15 -0
  14. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  15. data/test/dummy/app/controllers/application_controller.rb +3 -0
  16. data/test/dummy/app/helpers/application_helper.rb +2 -0
  17. data/test/dummy/app/models/comment.rb +6 -0
  18. data/test/dummy/app/models/post.rb +7 -0
  19. data/test/dummy/app/models/user.rb +13 -0
  20. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  21. data/test/dummy/config.ru +4 -0
  22. data/test/dummy/config/application.rb +59 -0
  23. data/test/dummy/config/boot.rb +10 -0
  24. data/test/dummy/config/database.yml +25 -0
  25. data/test/dummy/config/environment.rb +5 -0
  26. data/test/dummy/config/environments/development.rb +39 -0
  27. data/test/dummy/config/environments/production.rb +67 -0
  28. data/test/dummy/config/environments/test.rb +37 -0
  29. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  30. data/test/dummy/config/initializers/counter_cache_patch.rb +19 -0
  31. data/test/dummy/config/initializers/inflections.rb +15 -0
  32. data/test/dummy/config/initializers/mime_types.rb +5 -0
  33. data/test/dummy/config/initializers/secret_token.rb +7 -0
  34. data/test/dummy/config/initializers/session_store.rb +8 -0
  35. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  36. data/test/dummy/config/locales/en.yml +5 -0
  37. data/test/dummy/config/routes.rb +58 -0
  38. data/test/dummy/db/development.sqlite3 +0 -0
  39. data/test/dummy/db/migrate/20120824210455_create_users.rb +10 -0
  40. data/test/dummy/db/migrate/20120824210731_create_comments.rb +11 -0
  41. data/test/dummy/db/migrate/20120824210927_create_posts.rb +13 -0
  42. data/test/dummy/db/schema.rb +43 -0
  43. data/test/dummy/db/test.sqlite3 +0 -0
  44. data/test/dummy/log/development.log +498 -0
  45. data/test/dummy/log/test.log +224 -0
  46. data/test/dummy/public/404.html +26 -0
  47. data/test/dummy/public/422.html +26 -0
  48. data/test/dummy/public/500.html +25 -0
  49. data/test/dummy/public/favicon.ico +0 -0
  50. data/test/dummy/script/rails +6 -0
  51. data/test/dummy/test/fixtures/comments.yml +9 -0
  52. data/test/dummy/test/fixtures/posts.yml +13 -0
  53. data/test/dummy/test/fixtures/users.yml +9 -0
  54. data/test/dummy/test/unit/comment_test.rb +7 -0
  55. data/test/dummy/test/unit/post_test.rb +7 -0
  56. data/test/dummy/test/unit/user_test.rb +7 -0
  57. data/test/dummy/tmp/cache/26E/540/User%2F1 +0 -0
  58. data/test/dummy/tmp/cache/26F/550/User%2F2 +0 -0
  59. data/test/dummy/tmp/cache/270/560/User%2F3 +0 -0
  60. data/test/dummy/tmp/cache/271/570/User%2F4 +0 -0
  61. data/test/dummy/tmp/cache/272/580/User%2F5 +0 -0
  62. data/test/dummy/tmp/cache/273/590/User%2F6 +0 -0
  63. data/test/dummy/tmp/cache/275/6E0/Post%2F1 +0 -0
  64. data/test/dummy/tmp/cache/276/6F0/Post%2F2 +0 -0
  65. data/test/dummy/tmp/cache/277/700/Post%2F3 +0 -0
  66. data/test/dummy/tmp/cache/3A8/070/Comment%2F7 +0 -0
  67. data/test/dummy/tmp/cache/3A9/080/Comment%2F8 +0 -0
  68. data/test/dummy/tmp/cache/3AA/090/Comment%2F9 +0 -0
  69. data/test/dummy/tmp/cache/3D2/D30/Comment%2F10 +0 -0
  70. data/test/dummy/tmp/cache/3D4/D50/Comment%2F12 +0 -0
  71. data/test/dummy/tmp/cache/3D5/D60/Comment%2F13 +0 -0
  72. data/test/dummy/tmp/cache/3D6/D70/Comment%2F14 +0 -0
  73. data/test/dummy/tmp/cache/3D7/D80/Comment%2F15 +0 -0
  74. data/test/dummy/tmp/cache/58D/B70/Post%2Fuser_id-1 +1 -0
  75. data/test/find_cache_test.rb +51 -0
  76. data/test/test_helper.rb +15 -0
  77. metadata +261 -0
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
metadata ADDED
@@ -0,0 +1,261 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: find_cache
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mustafa Turan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.1.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: simple_uuid
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: dalli
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: sqlite3
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: ! 'Makes ActiveRecord ''find_by_id, find_by_(attr)'' methods and ''has_one,
79
+ belongs_to relations'' cacheable by id or any referenced columns using Rails.cache
80
+ methods. It also supports fetching multiple records using ids with find_all_cache
81
+ method(if cache store supports multiple reads [hint: memcache_store, dalli_store
82
+ supports.]).'
83
+ email:
84
+ - mustafaturan.net@gmail.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - lib/find_cache/cacheable.rb
90
+ - lib/find_cache/init.rb
91
+ - lib/find_cache/key_gen.rb
92
+ - lib/find_cache/version.rb
93
+ - lib/find_cache.rb
94
+ - lib/tasks/find_cache_tasks.rake
95
+ - CHANGE-LOG
96
+ - MIT-LICENSE
97
+ - Rakefile
98
+ - README.rdoc
99
+ - test/dummy/app/assets/javascripts/application.js
100
+ - test/dummy/app/assets/stylesheets/application.css
101
+ - test/dummy/app/controllers/application_controller.rb
102
+ - test/dummy/app/helpers/application_helper.rb
103
+ - test/dummy/app/models/comment.rb
104
+ - test/dummy/app/models/post.rb
105
+ - test/dummy/app/models/user.rb
106
+ - test/dummy/app/views/layouts/application.html.erb
107
+ - test/dummy/config/application.rb
108
+ - test/dummy/config/boot.rb
109
+ - test/dummy/config/database.yml
110
+ - test/dummy/config/environment.rb
111
+ - test/dummy/config/environments/development.rb
112
+ - test/dummy/config/environments/production.rb
113
+ - test/dummy/config/environments/test.rb
114
+ - test/dummy/config/initializers/backtrace_silencers.rb
115
+ - test/dummy/config/initializers/counter_cache_patch.rb
116
+ - test/dummy/config/initializers/inflections.rb
117
+ - test/dummy/config/initializers/mime_types.rb
118
+ - test/dummy/config/initializers/secret_token.rb
119
+ - test/dummy/config/initializers/session_store.rb
120
+ - test/dummy/config/initializers/wrap_parameters.rb
121
+ - test/dummy/config/locales/en.yml
122
+ - test/dummy/config/routes.rb
123
+ - test/dummy/config.ru
124
+ - test/dummy/db/development.sqlite3
125
+ - test/dummy/db/migrate/20120824210455_create_users.rb
126
+ - test/dummy/db/migrate/20120824210731_create_comments.rb
127
+ - test/dummy/db/migrate/20120824210927_create_posts.rb
128
+ - test/dummy/db/schema.rb
129
+ - test/dummy/db/test.sqlite3
130
+ - test/dummy/log/development.log
131
+ - test/dummy/log/test.log
132
+ - test/dummy/public/404.html
133
+ - test/dummy/public/422.html
134
+ - test/dummy/public/500.html
135
+ - test/dummy/public/favicon.ico
136
+ - test/dummy/Rakefile
137
+ - test/dummy/README.rdoc
138
+ - test/dummy/script/rails
139
+ - test/dummy/test/fixtures/comments.yml
140
+ - test/dummy/test/fixtures/posts.yml
141
+ - test/dummy/test/fixtures/users.yml
142
+ - test/dummy/test/unit/comment_test.rb
143
+ - test/dummy/test/unit/post_test.rb
144
+ - test/dummy/test/unit/user_test.rb
145
+ - test/dummy/tmp/cache/26E/540/User%2F1
146
+ - test/dummy/tmp/cache/26F/550/User%2F2
147
+ - test/dummy/tmp/cache/270/560/User%2F3
148
+ - test/dummy/tmp/cache/271/570/User%2F4
149
+ - test/dummy/tmp/cache/272/580/User%2F5
150
+ - test/dummy/tmp/cache/273/590/User%2F6
151
+ - test/dummy/tmp/cache/275/6E0/Post%2F1
152
+ - test/dummy/tmp/cache/276/6F0/Post%2F2
153
+ - test/dummy/tmp/cache/277/700/Post%2F3
154
+ - test/dummy/tmp/cache/3A8/070/Comment%2F7
155
+ - test/dummy/tmp/cache/3A9/080/Comment%2F8
156
+ - test/dummy/tmp/cache/3AA/090/Comment%2F9
157
+ - test/dummy/tmp/cache/3D2/D30/Comment%2F10
158
+ - test/dummy/tmp/cache/3D4/D50/Comment%2F12
159
+ - test/dummy/tmp/cache/3D5/D60/Comment%2F13
160
+ - test/dummy/tmp/cache/3D6/D70/Comment%2F14
161
+ - test/dummy/tmp/cache/3D7/D80/Comment%2F15
162
+ - test/dummy/tmp/cache/58D/B70/Post%2Fuser_id-1
163
+ - test/find_cache_test.rb
164
+ - test/test_helper.rb
165
+ homepage: https://github.com/mustafaturan/findcache
166
+ licenses: []
167
+ post_install_message:
168
+ rdoc_options: []
169
+ require_paths:
170
+ - lib
171
+ required_ruby_version: !ruby/object:Gem::Requirement
172
+ none: false
173
+ requirements:
174
+ - - ! '>='
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ segments:
178
+ - 0
179
+ hash: -1945955979138925529
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ none: false
182
+ requirements:
183
+ - - ! '>='
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ segments:
187
+ - 0
188
+ hash: -1945955979138925529
189
+ requirements: []
190
+ rubyforge_project:
191
+ rubygems_version: 1.8.24
192
+ signing_key:
193
+ specification_version: 3
194
+ summary: Cache for ActiveRecord find_by_id and find_by_(attr) methods.
195
+ test_files:
196
+ - test/dummy/app/assets/javascripts/application.js
197
+ - test/dummy/app/assets/stylesheets/application.css
198
+ - test/dummy/app/controllers/application_controller.rb
199
+ - test/dummy/app/helpers/application_helper.rb
200
+ - test/dummy/app/models/comment.rb
201
+ - test/dummy/app/models/post.rb
202
+ - test/dummy/app/models/user.rb
203
+ - test/dummy/app/views/layouts/application.html.erb
204
+ - test/dummy/config/application.rb
205
+ - test/dummy/config/boot.rb
206
+ - test/dummy/config/database.yml
207
+ - test/dummy/config/environment.rb
208
+ - test/dummy/config/environments/development.rb
209
+ - test/dummy/config/environments/production.rb
210
+ - test/dummy/config/environments/test.rb
211
+ - test/dummy/config/initializers/backtrace_silencers.rb
212
+ - test/dummy/config/initializers/counter_cache_patch.rb
213
+ - test/dummy/config/initializers/inflections.rb
214
+ - test/dummy/config/initializers/mime_types.rb
215
+ - test/dummy/config/initializers/secret_token.rb
216
+ - test/dummy/config/initializers/session_store.rb
217
+ - test/dummy/config/initializers/wrap_parameters.rb
218
+ - test/dummy/config/locales/en.yml
219
+ - test/dummy/config/routes.rb
220
+ - test/dummy/config.ru
221
+ - test/dummy/db/development.sqlite3
222
+ - test/dummy/db/migrate/20120824210455_create_users.rb
223
+ - test/dummy/db/migrate/20120824210731_create_comments.rb
224
+ - test/dummy/db/migrate/20120824210927_create_posts.rb
225
+ - test/dummy/db/schema.rb
226
+ - test/dummy/db/test.sqlite3
227
+ - test/dummy/log/development.log
228
+ - test/dummy/log/test.log
229
+ - test/dummy/public/404.html
230
+ - test/dummy/public/422.html
231
+ - test/dummy/public/500.html
232
+ - test/dummy/public/favicon.ico
233
+ - test/dummy/Rakefile
234
+ - test/dummy/README.rdoc
235
+ - test/dummy/script/rails
236
+ - test/dummy/test/fixtures/comments.yml
237
+ - test/dummy/test/fixtures/posts.yml
238
+ - test/dummy/test/fixtures/users.yml
239
+ - test/dummy/test/unit/comment_test.rb
240
+ - test/dummy/test/unit/post_test.rb
241
+ - test/dummy/test/unit/user_test.rb
242
+ - test/dummy/tmp/cache/26E/540/User%2F1
243
+ - test/dummy/tmp/cache/26F/550/User%2F2
244
+ - test/dummy/tmp/cache/270/560/User%2F3
245
+ - test/dummy/tmp/cache/271/570/User%2F4
246
+ - test/dummy/tmp/cache/272/580/User%2F5
247
+ - test/dummy/tmp/cache/273/590/User%2F6
248
+ - test/dummy/tmp/cache/275/6E0/Post%2F1
249
+ - test/dummy/tmp/cache/276/6F0/Post%2F2
250
+ - test/dummy/tmp/cache/277/700/Post%2F3
251
+ - test/dummy/tmp/cache/3A8/070/Comment%2F7
252
+ - test/dummy/tmp/cache/3A9/080/Comment%2F8
253
+ - test/dummy/tmp/cache/3AA/090/Comment%2F9
254
+ - test/dummy/tmp/cache/3D2/D30/Comment%2F10
255
+ - test/dummy/tmp/cache/3D4/D50/Comment%2F12
256
+ - test/dummy/tmp/cache/3D5/D60/Comment%2F13
257
+ - test/dummy/tmp/cache/3D6/D70/Comment%2F14
258
+ - test/dummy/tmp/cache/3D7/D80/Comment%2F15
259
+ - test/dummy/tmp/cache/58D/B70/Post%2Fuser_id-1
260
+ - test/find_cache_test.rb
261
+ - test/test_helper.rb