ferblape-query_memcached 2.2.2

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.
Files changed (166) hide show
  1. data/.gitignore +2 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.markdown +87 -0
  4. data/RUNNING_TESTS +18 -0
  5. data/Rakefile +37 -0
  6. data/TODO +6 -0
  7. data/init.rb +3 -0
  8. data/lib/extensions/lock.rb +31 -0
  9. data/lib/query_memcached.rb +191 -0
  10. data/test/query_memcached_test.rb +26 -0
  11. data/test/testing_app/README +1 -0
  12. data/test/testing_app/Rakefile +8 -0
  13. data/test/testing_app/app/controllers/application.rb +15 -0
  14. data/test/testing_app/app/helpers/application_helper.rb +3 -0
  15. data/test/testing_app/app/models/author.rb +133 -0
  16. data/test/testing_app/app/models/auto_id.rb +4 -0
  17. data/test/testing_app/app/models/binary.rb +2 -0
  18. data/test/testing_app/app/models/book.rb +4 -0
  19. data/test/testing_app/app/models/categorization.rb +5 -0
  20. data/test/testing_app/app/models/category.rb +29 -0
  21. data/test/testing_app/app/models/citation.rb +6 -0
  22. data/test/testing_app/app/models/club.rb +7 -0
  23. data/test/testing_app/app/models/column_name.rb +3 -0
  24. data/test/testing_app/app/models/comment.rb +25 -0
  25. data/test/testing_app/app/models/company.rb +123 -0
  26. data/test/testing_app/app/models/company_in_module.rb +61 -0
  27. data/test/testing_app/app/models/computer.rb +4 -0
  28. data/test/testing_app/app/models/contact.rb +16 -0
  29. data/test/testing_app/app/models/course.rb +3 -0
  30. data/test/testing_app/app/models/customer.rb +55 -0
  31. data/test/testing_app/app/models/default.rb +2 -0
  32. data/test/testing_app/app/models/developer.rb +76 -0
  33. data/test/testing_app/app/models/edge.rb +5 -0
  34. data/test/testing_app/app/models/entrant.rb +3 -0
  35. data/test/testing_app/app/models/guid.rb +2 -0
  36. data/test/testing_app/app/models/item.rb +7 -0
  37. data/test/testing_app/app/models/job.rb +5 -0
  38. data/test/testing_app/app/models/joke.rb +3 -0
  39. data/test/testing_app/app/models/keyboard.rb +3 -0
  40. data/test/testing_app/app/models/legacy_thing.rb +3 -0
  41. data/test/testing_app/app/models/matey.rb +4 -0
  42. data/test/testing_app/app/models/member.rb +9 -0
  43. data/test/testing_app/app/models/membership.rb +9 -0
  44. data/test/testing_app/app/models/minimalistic.rb +2 -0
  45. data/test/testing_app/app/models/mixed_case_monkey.rb +3 -0
  46. data/test/testing_app/app/models/movie.rb +5 -0
  47. data/test/testing_app/app/models/order.rb +4 -0
  48. data/test/testing_app/app/models/owner.rb +4 -0
  49. data/test/testing_app/app/models/parrot.rb +13 -0
  50. data/test/testing_app/app/models/person.rb +10 -0
  51. data/test/testing_app/app/models/pet.rb +4 -0
  52. data/test/testing_app/app/models/pirate.rb +9 -0
  53. data/test/testing_app/app/models/post.rb +80 -0
  54. data/test/testing_app/app/models/price_estimate.rb +3 -0
  55. data/test/testing_app/app/models/project.rb +29 -0
  56. data/test/testing_app/app/models/reader.rb +4 -0
  57. data/test/testing_app/app/models/reference.rb +4 -0
  58. data/test/testing_app/app/models/reply.rb +39 -0
  59. data/test/testing_app/app/models/ship.rb +3 -0
  60. data/test/testing_app/app/models/sponsor.rb +4 -0
  61. data/test/testing_app/app/models/subject.rb +4 -0
  62. data/test/testing_app/app/models/subscriber.rb +8 -0
  63. data/test/testing_app/app/models/subscription.rb +4 -0
  64. data/test/testing_app/app/models/tag.rb +7 -0
  65. data/test/testing_app/app/models/tagging.rb +10 -0
  66. data/test/testing_app/app/models/task.rb +2 -0
  67. data/test/testing_app/app/models/topic.rb +65 -0
  68. data/test/testing_app/app/models/treasure.rb +6 -0
  69. data/test/testing_app/app/models/vertex.rb +9 -0
  70. data/test/testing_app/app/models/warehouse_thing.rb +5 -0
  71. data/test/testing_app/config/boot.rb +109 -0
  72. data/test/testing_app/config/database.yml +11 -0
  73. data/test/testing_app/config/environment.rb +19 -0
  74. data/test/testing_app/config/environments/development.rb +0 -0
  75. data/test/testing_app/config/environments/production.rb +0 -0
  76. data/test/testing_app/config/environments/test.rb +0 -0
  77. data/test/testing_app/config/initializers/inflections.rb +10 -0
  78. data/test/testing_app/config/initializers/mime_types.rb +5 -0
  79. data/test/testing_app/config/initializers/new_rails_defaults.rb +15 -0
  80. data/test/testing_app/config/routes.rb +41 -0
  81. data/test/testing_app/db/schema.rb +443 -0
  82. data/test/testing_app/script/about +3 -0
  83. data/test/testing_app/script/console +3 -0
  84. data/test/testing_app/script/dbconsole +3 -0
  85. data/test/testing_app/script/destroy +3 -0
  86. data/test/testing_app/script/generate +3 -0
  87. data/test/testing_app/script/performance/benchmarker +3 -0
  88. data/test/testing_app/script/performance/profiler +3 -0
  89. data/test/testing_app/script/performance/request +3 -0
  90. data/test/testing_app/script/plugin +3 -0
  91. data/test/testing_app/script/process/inspector +3 -0
  92. data/test/testing_app/script/process/reaper +3 -0
  93. data/test/testing_app/script/process/spawner +3 -0
  94. data/test/testing_app/script/runner +3 -0
  95. data/test/testing_app/script/server +3 -0
  96. data/test/testing_app/test/fixtures/accounts.yml +28 -0
  97. data/test/testing_app/test/fixtures/all/developers.yml +0 -0
  98. data/test/testing_app/test/fixtures/all/people.csv +0 -0
  99. data/test/testing_app/test/fixtures/all/tasks.yml +0 -0
  100. data/test/testing_app/test/fixtures/author_addresses.yml +5 -0
  101. data/test/testing_app/test/fixtures/author_favorites.yml +4 -0
  102. data/test/testing_app/test/fixtures/authors.yml +9 -0
  103. data/test/testing_app/test/fixtures/binaries.yml +132 -0
  104. data/test/testing_app/test/fixtures/books.yml +7 -0
  105. data/test/testing_app/test/fixtures/categories.yml +14 -0
  106. data/test/testing_app/test/fixtures/categories/special_categories.yml +9 -0
  107. data/test/testing_app/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
  108. data/test/testing_app/test/fixtures/categories_posts.yml +23 -0
  109. data/test/testing_app/test/fixtures/categorizations.yml +17 -0
  110. data/test/testing_app/test/fixtures/clubs.yml +6 -0
  111. data/test/testing_app/test/fixtures/comments.yml +59 -0
  112. data/test/testing_app/test/fixtures/companies.yml +55 -0
  113. data/test/testing_app/test/fixtures/computers.yml +4 -0
  114. data/test/testing_app/test/fixtures/courses.yml +7 -0
  115. data/test/testing_app/test/fixtures/customers.yml +17 -0
  116. data/test/testing_app/test/fixtures/developers.yml +21 -0
  117. data/test/testing_app/test/fixtures/developers_projects.yml +17 -0
  118. data/test/testing_app/test/fixtures/edges.yml +6 -0
  119. data/test/testing_app/test/fixtures/entrants.yml +14 -0
  120. data/test/testing_app/test/fixtures/fk_test_has_fk.yml +3 -0
  121. data/test/testing_app/test/fixtures/fk_test_has_pk.yml +2 -0
  122. data/test/testing_app/test/fixtures/funny_jokes.yml +10 -0
  123. data/test/testing_app/test/fixtures/items.yml +4 -0
  124. data/test/testing_app/test/fixtures/jobs.yml +7 -0
  125. data/test/testing_app/test/fixtures/legacy_things.yml +3 -0
  126. data/test/testing_app/test/fixtures/mateys.yml +4 -0
  127. data/test/testing_app/test/fixtures/members.yml +4 -0
  128. data/test/testing_app/test/fixtures/memberships.yml +20 -0
  129. data/test/testing_app/test/fixtures/minimalistics.yml +2 -0
  130. data/test/testing_app/test/fixtures/mixed_case_monkeys.yml +6 -0
  131. data/test/testing_app/test/fixtures/mixins.yml +29 -0
  132. data/test/testing_app/test/fixtures/movies.yml +7 -0
  133. data/test/testing_app/test/fixtures/naked/csv/accounts.csv +1 -0
  134. data/test/testing_app/test/fixtures/naked/yml/accounts.yml +1 -0
  135. data/test/testing_app/test/fixtures/naked/yml/companies.yml +1 -0
  136. data/test/testing_app/test/fixtures/naked/yml/courses.yml +1 -0
  137. data/test/testing_app/test/fixtures/owners.yml +7 -0
  138. data/test/testing_app/test/fixtures/parrots.yml +27 -0
  139. data/test/testing_app/test/fixtures/parrots_pirates.yml +7 -0
  140. data/test/testing_app/test/fixtures/people.yml +6 -0
  141. data/test/testing_app/test/fixtures/pets.yml +14 -0
  142. data/test/testing_app/test/fixtures/pirates.yml +9 -0
  143. data/test/testing_app/test/fixtures/posts.yml +49 -0
  144. data/test/testing_app/test/fixtures/price_estimates.yml +7 -0
  145. data/test/testing_app/test/fixtures/projects.yml +7 -0
  146. data/test/testing_app/test/fixtures/readers.yml +9 -0
  147. data/test/testing_app/test/fixtures/references.yml +17 -0
  148. data/test/testing_app/test/fixtures/reserved_words/distinct.yml +5 -0
  149. data/test/testing_app/test/fixtures/reserved_words/distincts_selects.yml +11 -0
  150. data/test/testing_app/test/fixtures/reserved_words/group.yml +14 -0
  151. data/test/testing_app/test/fixtures/reserved_words/select.yml +8 -0
  152. data/test/testing_app/test/fixtures/reserved_words/values.yml +7 -0
  153. data/test/testing_app/test/fixtures/ships.yml +5 -0
  154. data/test/testing_app/test/fixtures/sponsors.yml +9 -0
  155. data/test/testing_app/test/fixtures/subscribers.yml +7 -0
  156. data/test/testing_app/test/fixtures/subscriptions.yml +12 -0
  157. data/test/testing_app/test/fixtures/taggings.yml +28 -0
  158. data/test/testing_app/test/fixtures/tags.yml +7 -0
  159. data/test/testing_app/test/fixtures/tasks.yml +7 -0
  160. data/test/testing_app/test/fixtures/topics.yml +42 -0
  161. data/test/testing_app/test/fixtures/treasures.yml +10 -0
  162. data/test/testing_app/test/fixtures/vertices.yml +4 -0
  163. data/test/testing_app/test/fixtures/warehouse-things.yml +3 -0
  164. data/test/testing_app/test/test_helper.rb +131 -0
  165. data/test/testing_app/test/unit/query_cache_test.rb +180 -0
  166. metadata +289 -0
@@ -0,0 +1,4 @@
1
+ workstation:
2
+ id: 1
3
+ developer: 1
4
+ extendedWarranty: 1
@@ -0,0 +1,7 @@
1
+ ruby:
2
+ id: 1
3
+ name: Ruby Development
4
+
5
+ java:
6
+ id: 2
7
+ name: Java Development
@@ -0,0 +1,17 @@
1
+ david:
2
+ id: 1
3
+ name: David
4
+ balance: 50
5
+ address_street: Funny Street
6
+ address_city: Scary Town
7
+ address_country: Loony Land
8
+ gps_location: 35.544623640962634x-105.9309951055148
9
+
10
+ zaphod:
11
+ id: 2
12
+ name: Zaphod
13
+ balance: 62
14
+ address_street: Avenue Road
15
+ address_city: Hamlet Town
16
+ address_country: Nation Land
17
+ gps_location: NULL
@@ -0,0 +1,21 @@
1
+ david:
2
+ id: 1
3
+ name: David
4
+ salary: 80000
5
+
6
+ jamis:
7
+ id: 2
8
+ name: Jamis
9
+ salary: 150000
10
+
11
+ <% for digit in 3..10 %>
12
+ dev_<%= digit %>:
13
+ id: <%= digit %>
14
+ name: fixture_<%= digit %>
15
+ salary: 100000
16
+ <% end %>
17
+
18
+ poor_jamis:
19
+ id: 11
20
+ name: Jamis
21
+ salary: 9000
@@ -0,0 +1,17 @@
1
+ david_action_controller:
2
+ developer_id: 1
3
+ project_id: 2
4
+ joined_on: 2004-10-10
5
+
6
+ david_active_record:
7
+ developer_id: 1
8
+ project_id: 1
9
+ joined_on: 2004-10-10
10
+
11
+ jamis_active_record:
12
+ developer_id: 2
13
+ project_id: 1
14
+
15
+ poor_jamis_active_record:
16
+ developer_id: 11
17
+ project_id: 1
@@ -0,0 +1,6 @@
1
+ <% (1..4).each do |id| %>
2
+ edge_<%= id %>:
3
+ id: <%= id %>
4
+ source_id: <%= id %>
5
+ sink_id: <%= id + 1 %>
6
+ <% end %>
@@ -0,0 +1,14 @@
1
+ first:
2
+ id: 1
3
+ course_id: 1
4
+ name: Ruby Developer
5
+
6
+ second:
7
+ id: 2
8
+ course_id: 1
9
+ name: Ruby Guru
10
+
11
+ third:
12
+ id: 3
13
+ course_id: 2
14
+ name: Java Lover
@@ -0,0 +1,3 @@
1
+ first:
2
+ id: 1
3
+ fk_id: 1
@@ -0,0 +1,10 @@
1
+ a_joke:
2
+ id: 1
3
+ name: Knock knock
4
+
5
+ another_joke:
6
+ id: 2
7
+ name: |
8
+ The \n Aristocrats
9
+ Ate the candy
10
+
@@ -0,0 +1,4 @@
1
+ dvd:
2
+ id: 1
3
+ name: Godfather
4
+
@@ -0,0 +1,7 @@
1
+ unicyclist:
2
+ id: 1
3
+ ideal_reference_id: 2
4
+ clown:
5
+ id: 2
6
+ magician:
7
+ id: 3
@@ -0,0 +1,3 @@
1
+ obtuse:
2
+ id: 1
3
+ tps_report_number: 500
@@ -0,0 +1,4 @@
1
+ blackbeard_to_redbeard:
2
+ pirate_id: <%= Fixtures.identify(:blackbeard) %>
3
+ target_id: <%= Fixtures.identify(:redbeard) %>
4
+ weight: 10
@@ -0,0 +1,4 @@
1
+ groucho:
2
+ name: Groucho Marx
3
+ some_other_guy:
4
+ name: Englebert Humperdink
@@ -0,0 +1,20 @@
1
+ membership_of_boring_club:
2
+ joined_on: <%= 3.weeks.ago.to_s(:db) %>
3
+ club: boring_club
4
+ member: groucho
5
+ favourite: false
6
+ type: CurrentMembership
7
+
8
+ membership_of_favourite_club:
9
+ joined_on: <%= 3.weeks.ago.to_s(:db) %>
10
+ club: moustache_club
11
+ member: groucho
12
+ favourite: true
13
+ type: Membership
14
+
15
+ other_guys_membership:
16
+ joined_on: <%= 4.weeks.ago.to_s(:db) %>
17
+ club: boring_club
18
+ member: some_other_guy
19
+ favourite: false
20
+ type: CurrentMembership
@@ -0,0 +1,6 @@
1
+ first:
2
+ monkeyID: 1
3
+ fleaCount: 42
4
+ second:
5
+ monkeyID: 2
6
+ fleaCount: 43
@@ -0,0 +1,29 @@
1
+ # Nested set mixins
2
+
3
+ <% (1..10).each do |counter| %>
4
+ set_<%= counter %>:
5
+ id: <%= counter+3000 %>
6
+ <% end %>
7
+
8
+ # Big old set
9
+ <%
10
+ [[4001, 0, 1, 20],
11
+ [4002, 4001, 2, 7],
12
+ [4003, 4002, 3, 4],
13
+ [4004, 4002, 5, 6],
14
+ [4005, 4001, 14, 13],
15
+ [4006, 4005, 9, 10],
16
+ [4007, 4005, 11, 12],
17
+ [4008, 4001, 8, 19],
18
+ [4009, 4008, 15, 16],
19
+ [4010, 4008, 17, 18]].each do |set| %>
20
+ tree_<%= set[0] %>:
21
+ id: <%= set[0]%>
22
+ parent_id: <%= set[1]%>
23
+ type: NestedSetWithStringScope
24
+ lft: <%= set[2]%>
25
+ rgt: <%= set[3]%>
26
+ root_id: 42
27
+
28
+ <% end %>
29
+
@@ -0,0 +1,7 @@
1
+ first:
2
+ movieid: 1
3
+ name: Terminator
4
+
5
+ second:
6
+ movieid: 2
7
+ name: Gladiator
@@ -0,0 +1 @@
1
+ # i wonder what will happen here
@@ -0,0 +1,7 @@
1
+ blackbeard:
2
+ owner_id: 1
3
+ name: blackbeard
4
+
5
+ ashley:
6
+ owner_id: 2
7
+ name: ashley
@@ -0,0 +1,27 @@
1
+ george:
2
+ name: "Curious George"
3
+ treasures: diamond, sapphire
4
+ parrot_sti_class: LiveParrot
5
+
6
+ louis:
7
+ name: "King Louis"
8
+ treasures: [diamond, sapphire]
9
+ parrot_sti_class: LiveParrot
10
+
11
+ frederick:
12
+ name: $LABEL
13
+ parrot_sti_class: LiveParrot
14
+
15
+ polly:
16
+ id: 4
17
+ name: $LABEL
18
+ killer: blackbeard
19
+ treasures: sapphire, ruby
20
+ parrot_sti_class: DeadParrot
21
+
22
+ DEFAULTS: &DEFAULTS
23
+ treasures: sapphire, ruby
24
+ parrot_sti_class: LiveParrot
25
+
26
+ davey:
27
+ <<: *DEFAULTS
@@ -0,0 +1,7 @@
1
+ george_blackbeard:
2
+ parrot_id: <%= Fixtures.identify(:george) %>
3
+ pirate_id: <%= Fixtures.identify(:blackbeard) %>
4
+
5
+ louis_blackbeard:
6
+ parrot_id: <%= Fixtures.identify(:louis) %>
7
+ pirate_id: <%= Fixtures.identify(:blackbeard) %>
@@ -0,0 +1,6 @@
1
+ michael:
2
+ id: 1
3
+ first_name: Michael
4
+ david:
5
+ id: 2
6
+ first_name: David
@@ -0,0 +1,14 @@
1
+ parrot:
2
+ pet_id: 1
3
+ name: parrot
4
+ owner_id: 1
5
+
6
+ chew:
7
+ pet_id: 2
8
+ name: chew
9
+ owner_id: 2
10
+
11
+ mochi:
12
+ pet_id: 3
13
+ name: mochi
14
+ owner_id: 2
@@ -0,0 +1,9 @@
1
+ blackbeard:
2
+ catchphrase: "Yar."
3
+ parrot: george
4
+
5
+ redbeard:
6
+ catchphrase: "Avast!"
7
+ parrot: louis
8
+ created_on: <%= 2.weeks.ago.to_s(:db) %>
9
+ updated_on: <%= 2.weeks.ago.to_s(:db) %>
@@ -0,0 +1,49 @@
1
+ welcome:
2
+ id: 1
3
+ author_id: 1
4
+ title: Welcome to the weblog
5
+ body: Such a lovely day
6
+ comments_count: 2
7
+ type: Post
8
+
9
+ thinking:
10
+ id: 2
11
+ author_id: 1
12
+ title: So I was thinking
13
+ body: Like I hopefully always am
14
+ type: SpecialPost
15
+
16
+ authorless:
17
+ id: 3
18
+ author_id: 0
19
+ title: I don't have any comments
20
+ body: I just don't want to
21
+ type: Post
22
+
23
+ sti_comments:
24
+ id: 4
25
+ author_id: 1
26
+ title: sti comments
27
+ body: hello
28
+ type: Post
29
+
30
+ sti_post_and_comments:
31
+ id: 5
32
+ author_id: 1
33
+ title: sti me
34
+ body: hello
35
+ type: StiPost
36
+
37
+ sti_habtm:
38
+ id: 6
39
+ author_id: 1
40
+ title: habtm sti test
41
+ body: hello
42
+ type: Post
43
+
44
+ eager_other:
45
+ id: 7
46
+ author_id: 2
47
+ title: eager loading with OR'd conditions
48
+ body: hello
49
+ type: Post
@@ -0,0 +1,7 @@
1
+ saphire_1:
2
+ price: 10
3
+ estimate_of: sapphire (Treasure)
4
+
5
+ sapphire_2:
6
+ price: 20
7
+ estimate_of: sapphire (Treasure)
@@ -0,0 +1,7 @@
1
+ action_controller:
2
+ id: 2
3
+ name: Active Controller
4
+
5
+ active_record:
6
+ id: 1
7
+ name: Active Record
@@ -0,0 +1,9 @@
1
+ michael_welcome:
2
+ id: 1
3
+ post_id: 1
4
+ person_id: 1
5
+
6
+ michael_authorless:
7
+ id: 2
8
+ post_id: 3
9
+ person_id: 1
@@ -0,0 +1,17 @@
1
+ michael_magician:
2
+ id: 1
3
+ person_id: 1
4
+ job_id: 3
5
+ favourite: false
6
+
7
+ michael_unicyclist:
8
+ id: 2
9
+ person_id: 1
10
+ job_id: 1
11
+ favourite: true
12
+
13
+ david_unicyclist:
14
+ id: 3
15
+ person_id: 2
16
+ job_id: 1
17
+ favourite: false
@@ -0,0 +1,5 @@
1
+ distinct1:
2
+ id: 1
3
+
4
+ distinct2:
5
+ id: 2
@@ -0,0 +1,11 @@
1
+ distincts_selects1:
2
+ distinct_id: 1
3
+ select_id: 1
4
+
5
+ distincts_selects2:
6
+ distinct_id: 1
7
+ select_id: 2
8
+
9
+ distincts_selects3:
10
+ distinct_id: 2
11
+ select_id: 3
@@ -0,0 +1,14 @@
1
+ group1:
2
+ id: 1
3
+ select_id: 1
4
+ order: x
5
+
6
+ group2:
7
+ id: 2
8
+ select_id: 2
9
+ order: y
10
+
11
+ group3:
12
+ id: 3
13
+ select_id: 2
14
+ order: z