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.
- data/.gitignore +2 -0
- data/MIT-LICENSE +20 -0
- data/README.markdown +87 -0
- data/RUNNING_TESTS +18 -0
- data/Rakefile +37 -0
- data/TODO +6 -0
- data/init.rb +3 -0
- data/lib/extensions/lock.rb +31 -0
- data/lib/query_memcached.rb +191 -0
- data/test/query_memcached_test.rb +26 -0
- data/test/testing_app/README +1 -0
- data/test/testing_app/Rakefile +8 -0
- data/test/testing_app/app/controllers/application.rb +15 -0
- data/test/testing_app/app/helpers/application_helper.rb +3 -0
- data/test/testing_app/app/models/author.rb +133 -0
- data/test/testing_app/app/models/auto_id.rb +4 -0
- data/test/testing_app/app/models/binary.rb +2 -0
- data/test/testing_app/app/models/book.rb +4 -0
- data/test/testing_app/app/models/categorization.rb +5 -0
- data/test/testing_app/app/models/category.rb +29 -0
- data/test/testing_app/app/models/citation.rb +6 -0
- data/test/testing_app/app/models/club.rb +7 -0
- data/test/testing_app/app/models/column_name.rb +3 -0
- data/test/testing_app/app/models/comment.rb +25 -0
- data/test/testing_app/app/models/company.rb +123 -0
- data/test/testing_app/app/models/company_in_module.rb +61 -0
- data/test/testing_app/app/models/computer.rb +4 -0
- data/test/testing_app/app/models/contact.rb +16 -0
- data/test/testing_app/app/models/course.rb +3 -0
- data/test/testing_app/app/models/customer.rb +55 -0
- data/test/testing_app/app/models/default.rb +2 -0
- data/test/testing_app/app/models/developer.rb +76 -0
- data/test/testing_app/app/models/edge.rb +5 -0
- data/test/testing_app/app/models/entrant.rb +3 -0
- data/test/testing_app/app/models/guid.rb +2 -0
- data/test/testing_app/app/models/item.rb +7 -0
- data/test/testing_app/app/models/job.rb +5 -0
- data/test/testing_app/app/models/joke.rb +3 -0
- data/test/testing_app/app/models/keyboard.rb +3 -0
- data/test/testing_app/app/models/legacy_thing.rb +3 -0
- data/test/testing_app/app/models/matey.rb +4 -0
- data/test/testing_app/app/models/member.rb +9 -0
- data/test/testing_app/app/models/membership.rb +9 -0
- data/test/testing_app/app/models/minimalistic.rb +2 -0
- data/test/testing_app/app/models/mixed_case_monkey.rb +3 -0
- data/test/testing_app/app/models/movie.rb +5 -0
- data/test/testing_app/app/models/order.rb +4 -0
- data/test/testing_app/app/models/owner.rb +4 -0
- data/test/testing_app/app/models/parrot.rb +13 -0
- data/test/testing_app/app/models/person.rb +10 -0
- data/test/testing_app/app/models/pet.rb +4 -0
- data/test/testing_app/app/models/pirate.rb +9 -0
- data/test/testing_app/app/models/post.rb +80 -0
- data/test/testing_app/app/models/price_estimate.rb +3 -0
- data/test/testing_app/app/models/project.rb +29 -0
- data/test/testing_app/app/models/reader.rb +4 -0
- data/test/testing_app/app/models/reference.rb +4 -0
- data/test/testing_app/app/models/reply.rb +39 -0
- data/test/testing_app/app/models/ship.rb +3 -0
- data/test/testing_app/app/models/sponsor.rb +4 -0
- data/test/testing_app/app/models/subject.rb +4 -0
- data/test/testing_app/app/models/subscriber.rb +8 -0
- data/test/testing_app/app/models/subscription.rb +4 -0
- data/test/testing_app/app/models/tag.rb +7 -0
- data/test/testing_app/app/models/tagging.rb +10 -0
- data/test/testing_app/app/models/task.rb +2 -0
- data/test/testing_app/app/models/topic.rb +65 -0
- data/test/testing_app/app/models/treasure.rb +6 -0
- data/test/testing_app/app/models/vertex.rb +9 -0
- data/test/testing_app/app/models/warehouse_thing.rb +5 -0
- data/test/testing_app/config/boot.rb +109 -0
- data/test/testing_app/config/database.yml +11 -0
- data/test/testing_app/config/environment.rb +19 -0
- data/test/testing_app/config/environments/development.rb +0 -0
- data/test/testing_app/config/environments/production.rb +0 -0
- data/test/testing_app/config/environments/test.rb +0 -0
- data/test/testing_app/config/initializers/inflections.rb +10 -0
- data/test/testing_app/config/initializers/mime_types.rb +5 -0
- data/test/testing_app/config/initializers/new_rails_defaults.rb +15 -0
- data/test/testing_app/config/routes.rb +41 -0
- data/test/testing_app/db/schema.rb +443 -0
- data/test/testing_app/script/about +3 -0
- data/test/testing_app/script/console +3 -0
- data/test/testing_app/script/dbconsole +3 -0
- data/test/testing_app/script/destroy +3 -0
- data/test/testing_app/script/generate +3 -0
- data/test/testing_app/script/performance/benchmarker +3 -0
- data/test/testing_app/script/performance/profiler +3 -0
- data/test/testing_app/script/performance/request +3 -0
- data/test/testing_app/script/plugin +3 -0
- data/test/testing_app/script/process/inspector +3 -0
- data/test/testing_app/script/process/reaper +3 -0
- data/test/testing_app/script/process/spawner +3 -0
- data/test/testing_app/script/runner +3 -0
- data/test/testing_app/script/server +3 -0
- data/test/testing_app/test/fixtures/accounts.yml +28 -0
- data/test/testing_app/test/fixtures/all/developers.yml +0 -0
- data/test/testing_app/test/fixtures/all/people.csv +0 -0
- data/test/testing_app/test/fixtures/all/tasks.yml +0 -0
- data/test/testing_app/test/fixtures/author_addresses.yml +5 -0
- data/test/testing_app/test/fixtures/author_favorites.yml +4 -0
- data/test/testing_app/test/fixtures/authors.yml +9 -0
- data/test/testing_app/test/fixtures/binaries.yml +132 -0
- data/test/testing_app/test/fixtures/books.yml +7 -0
- data/test/testing_app/test/fixtures/categories.yml +14 -0
- data/test/testing_app/test/fixtures/categories/special_categories.yml +9 -0
- data/test/testing_app/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
- data/test/testing_app/test/fixtures/categories_posts.yml +23 -0
- data/test/testing_app/test/fixtures/categorizations.yml +17 -0
- data/test/testing_app/test/fixtures/clubs.yml +6 -0
- data/test/testing_app/test/fixtures/comments.yml +59 -0
- data/test/testing_app/test/fixtures/companies.yml +55 -0
- data/test/testing_app/test/fixtures/computers.yml +4 -0
- data/test/testing_app/test/fixtures/courses.yml +7 -0
- data/test/testing_app/test/fixtures/customers.yml +17 -0
- data/test/testing_app/test/fixtures/developers.yml +21 -0
- data/test/testing_app/test/fixtures/developers_projects.yml +17 -0
- data/test/testing_app/test/fixtures/edges.yml +6 -0
- data/test/testing_app/test/fixtures/entrants.yml +14 -0
- data/test/testing_app/test/fixtures/fk_test_has_fk.yml +3 -0
- data/test/testing_app/test/fixtures/fk_test_has_pk.yml +2 -0
- data/test/testing_app/test/fixtures/funny_jokes.yml +10 -0
- data/test/testing_app/test/fixtures/items.yml +4 -0
- data/test/testing_app/test/fixtures/jobs.yml +7 -0
- data/test/testing_app/test/fixtures/legacy_things.yml +3 -0
- data/test/testing_app/test/fixtures/mateys.yml +4 -0
- data/test/testing_app/test/fixtures/members.yml +4 -0
- data/test/testing_app/test/fixtures/memberships.yml +20 -0
- data/test/testing_app/test/fixtures/minimalistics.yml +2 -0
- data/test/testing_app/test/fixtures/mixed_case_monkeys.yml +6 -0
- data/test/testing_app/test/fixtures/mixins.yml +29 -0
- data/test/testing_app/test/fixtures/movies.yml +7 -0
- data/test/testing_app/test/fixtures/naked/csv/accounts.csv +1 -0
- data/test/testing_app/test/fixtures/naked/yml/accounts.yml +1 -0
- data/test/testing_app/test/fixtures/naked/yml/companies.yml +1 -0
- data/test/testing_app/test/fixtures/naked/yml/courses.yml +1 -0
- data/test/testing_app/test/fixtures/owners.yml +7 -0
- data/test/testing_app/test/fixtures/parrots.yml +27 -0
- data/test/testing_app/test/fixtures/parrots_pirates.yml +7 -0
- data/test/testing_app/test/fixtures/people.yml +6 -0
- data/test/testing_app/test/fixtures/pets.yml +14 -0
- data/test/testing_app/test/fixtures/pirates.yml +9 -0
- data/test/testing_app/test/fixtures/posts.yml +49 -0
- data/test/testing_app/test/fixtures/price_estimates.yml +7 -0
- data/test/testing_app/test/fixtures/projects.yml +7 -0
- data/test/testing_app/test/fixtures/readers.yml +9 -0
- data/test/testing_app/test/fixtures/references.yml +17 -0
- data/test/testing_app/test/fixtures/reserved_words/distinct.yml +5 -0
- data/test/testing_app/test/fixtures/reserved_words/distincts_selects.yml +11 -0
- data/test/testing_app/test/fixtures/reserved_words/group.yml +14 -0
- data/test/testing_app/test/fixtures/reserved_words/select.yml +8 -0
- data/test/testing_app/test/fixtures/reserved_words/values.yml +7 -0
- data/test/testing_app/test/fixtures/ships.yml +5 -0
- data/test/testing_app/test/fixtures/sponsors.yml +9 -0
- data/test/testing_app/test/fixtures/subscribers.yml +7 -0
- data/test/testing_app/test/fixtures/subscriptions.yml +12 -0
- data/test/testing_app/test/fixtures/taggings.yml +28 -0
- data/test/testing_app/test/fixtures/tags.yml +7 -0
- data/test/testing_app/test/fixtures/tasks.yml +7 -0
- data/test/testing_app/test/fixtures/topics.yml +42 -0
- data/test/testing_app/test/fixtures/treasures.yml +10 -0
- data/test/testing_app/test/fixtures/vertices.yml +4 -0
- data/test/testing_app/test/fixtures/warehouse-things.yml +3 -0
- data/test/testing_app/test/test_helper.rb +131 -0
- data/test/testing_app/test/unit/query_cache_test.rb +180 -0
- metadata +289 -0
@@ -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,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,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 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
# i wonder what will happen here
|
@@ -0,0 +1 @@
|
|
1
|
+
qwerty
|
@@ -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,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
|