arel 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. data/.gitignore +6 -0
  2. data/README.markdown +184 -0
  3. data/Rakefile +60 -0
  4. data/VERSION +1 -0
  5. data/arel.gemspec +233 -0
  6. data/doc/CONVENTIONS +17 -0
  7. data/doc/TODO +118 -0
  8. data/lib/arel.rb +10 -0
  9. data/lib/arel/algebra.rb +4 -0
  10. data/lib/arel/algebra/extensions.rb +4 -0
  11. data/lib/arel/algebra/extensions/class.rb +32 -0
  12. data/lib/arel/algebra/extensions/hash.rb +11 -0
  13. data/lib/arel/algebra/extensions/object.rb +17 -0
  14. data/lib/arel/algebra/extensions/symbol.rb +9 -0
  15. data/lib/arel/algebra/predicates.rb +41 -0
  16. data/lib/arel/algebra/primitives.rb +5 -0
  17. data/lib/arel/algebra/primitives/attribute.rb +150 -0
  18. data/lib/arel/algebra/primitives/expression.rb +43 -0
  19. data/lib/arel/algebra/primitives/ordering.rb +23 -0
  20. data/lib/arel/algebra/primitives/value.rb +14 -0
  21. data/lib/arel/algebra/relations.rb +14 -0
  22. data/lib/arel/algebra/relations/operations/alias.rb +7 -0
  23. data/lib/arel/algebra/relations/operations/group.rb +12 -0
  24. data/lib/arel/algebra/relations/operations/join.rb +64 -0
  25. data/lib/arel/algebra/relations/operations/order.rb +18 -0
  26. data/lib/arel/algebra/relations/operations/project.rb +20 -0
  27. data/lib/arel/algebra/relations/operations/skip.rb +6 -0
  28. data/lib/arel/algebra/relations/operations/take.rb +10 -0
  29. data/lib/arel/algebra/relations/operations/where.rb +16 -0
  30. data/lib/arel/algebra/relations/relation.rb +136 -0
  31. data/lib/arel/algebra/relations/row.rb +26 -0
  32. data/lib/arel/algebra/relations/utilities/compound.rb +30 -0
  33. data/lib/arel/algebra/relations/utilities/externalization.rb +24 -0
  34. data/lib/arel/algebra/relations/utilities/nil.rb +7 -0
  35. data/lib/arel/algebra/relations/writes.rb +36 -0
  36. data/lib/arel/engines.rb +2 -0
  37. data/lib/arel/engines/memory.rb +4 -0
  38. data/lib/arel/engines/memory/engine.rb +16 -0
  39. data/lib/arel/engines/memory/predicates.rb +35 -0
  40. data/lib/arel/engines/memory/primitives.rb +27 -0
  41. data/lib/arel/engines/memory/relations.rb +5 -0
  42. data/lib/arel/engines/memory/relations/array.rb +25 -0
  43. data/lib/arel/engines/memory/relations/compound.rb +9 -0
  44. data/lib/arel/engines/memory/relations/operations.rb +61 -0
  45. data/lib/arel/engines/memory/relations/writes.rb +7 -0
  46. data/lib/arel/engines/sql.rb +7 -0
  47. data/lib/arel/engines/sql/christener.rb +13 -0
  48. data/lib/arel/engines/sql/engine.rb +37 -0
  49. data/lib/arel/engines/sql/extensions.rb +4 -0
  50. data/lib/arel/engines/sql/extensions/array.rb +16 -0
  51. data/lib/arel/engines/sql/extensions/nil_class.rb +11 -0
  52. data/lib/arel/engines/sql/extensions/object.rb +15 -0
  53. data/lib/arel/engines/sql/extensions/range.rb +15 -0
  54. data/lib/arel/engines/sql/formatters.rb +113 -0
  55. data/lib/arel/engines/sql/predicates.rb +51 -0
  56. data/lib/arel/engines/sql/primitives.rb +85 -0
  57. data/lib/arel/engines/sql/relations.rb +9 -0
  58. data/lib/arel/engines/sql/relations/operations/alias.rb +5 -0
  59. data/lib/arel/engines/sql/relations/operations/join.rb +33 -0
  60. data/lib/arel/engines/sql/relations/relation.rb +50 -0
  61. data/lib/arel/engines/sql/relations/table.rb +52 -0
  62. data/lib/arel/engines/sql/relations/utilities/compound.rb +10 -0
  63. data/lib/arel/engines/sql/relations/utilities/externalization.rb +14 -0
  64. data/lib/arel/engines/sql/relations/utilities/nil.rb +6 -0
  65. data/lib/arel/engines/sql/relations/utilities/recursion.rb +13 -0
  66. data/lib/arel/engines/sql/relations/writes.rb +39 -0
  67. data/lib/arel/session.rb +48 -0
  68. data/spec/arel/algebra/unit/predicates/binary_spec.rb +33 -0
  69. data/spec/arel/algebra/unit/predicates/equality_spec.rb +27 -0
  70. data/spec/arel/algebra/unit/predicates/in_spec.rb +10 -0
  71. data/spec/arel/algebra/unit/primitives/attribute_spec.rb +183 -0
  72. data/spec/arel/algebra/unit/primitives/expression_spec.rb +45 -0
  73. data/spec/arel/algebra/unit/primitives/value_spec.rb +15 -0
  74. data/spec/arel/algebra/unit/relations/alias_spec.rb +16 -0
  75. data/spec/arel/algebra/unit/relations/delete_spec.rb +9 -0
  76. data/spec/arel/algebra/unit/relations/group_spec.rb +10 -0
  77. data/spec/arel/algebra/unit/relations/insert_spec.rb +9 -0
  78. data/spec/arel/algebra/unit/relations/join_spec.rb +26 -0
  79. data/spec/arel/algebra/unit/relations/order_spec.rb +21 -0
  80. data/spec/arel/algebra/unit/relations/project_spec.rb +34 -0
  81. data/spec/arel/algebra/unit/relations/relation_spec.rb +188 -0
  82. data/spec/arel/algebra/unit/relations/skip_spec.rb +10 -0
  83. data/spec/arel/algebra/unit/relations/table_spec.rb +39 -0
  84. data/spec/arel/algebra/unit/relations/take_spec.rb +10 -0
  85. data/spec/arel/algebra/unit/relations/update_spec.rb +9 -0
  86. data/spec/arel/algebra/unit/relations/where_spec.rb +18 -0
  87. data/spec/arel/algebra/unit/session/session_spec.rb +84 -0
  88. data/spec/arel/engines/memory/integration/joins/cross_engine_spec.rb +48 -0
  89. data/spec/arel/engines/memory/unit/relations/array_spec.rb +32 -0
  90. data/spec/arel/engines/memory/unit/relations/insert_spec.rb +28 -0
  91. data/spec/arel/engines/memory/unit/relations/join_spec.rb +31 -0
  92. data/spec/arel/engines/memory/unit/relations/order_spec.rb +27 -0
  93. data/spec/arel/engines/memory/unit/relations/project_spec.rb +27 -0
  94. data/spec/arel/engines/memory/unit/relations/skip_spec.rb +26 -0
  95. data/spec/arel/engines/memory/unit/relations/take_spec.rb +26 -0
  96. data/spec/arel/engines/memory/unit/relations/where_spec.rb +39 -0
  97. data/spec/arel/engines/sql/integration/joins/with_adjacency_spec.rb +209 -0
  98. data/spec/arel/engines/sql/integration/joins/with_aggregations_spec.rb +167 -0
  99. data/spec/arel/engines/sql/integration/joins/with_compounds_spec.rb +107 -0
  100. data/spec/arel/engines/sql/unit/engine_spec.rb +45 -0
  101. data/spec/arel/engines/sql/unit/predicates/binary_spec.rb +117 -0
  102. data/spec/arel/engines/sql/unit/predicates/equality_spec.rb +46 -0
  103. data/spec/arel/engines/sql/unit/predicates/in_spec.rb +86 -0
  104. data/spec/arel/engines/sql/unit/predicates/predicates_spec.rb +65 -0
  105. data/spec/arel/engines/sql/unit/primitives/attribute_spec.rb +32 -0
  106. data/spec/arel/engines/sql/unit/primitives/expression_spec.rb +24 -0
  107. data/spec/arel/engines/sql/unit/primitives/literal_spec.rb +23 -0
  108. data/spec/arel/engines/sql/unit/primitives/value_spec.rb +29 -0
  109. data/spec/arel/engines/sql/unit/relations/alias_spec.rb +43 -0
  110. data/spec/arel/engines/sql/unit/relations/delete_spec.rb +63 -0
  111. data/spec/arel/engines/sql/unit/relations/group_spec.rb +56 -0
  112. data/spec/arel/engines/sql/unit/relations/insert_spec.rb +107 -0
  113. data/spec/arel/engines/sql/unit/relations/join_spec.rb +57 -0
  114. data/spec/arel/engines/sql/unit/relations/order_spec.rb +113 -0
  115. data/spec/arel/engines/sql/unit/relations/project_spec.rb +110 -0
  116. data/spec/arel/engines/sql/unit/relations/skip_spec.rb +32 -0
  117. data/spec/arel/engines/sql/unit/relations/table_spec.rb +69 -0
  118. data/spec/arel/engines/sql/unit/relations/take_spec.rb +32 -0
  119. data/spec/arel/engines/sql/unit/relations/update_spec.rb +151 -0
  120. data/spec/arel/engines/sql/unit/relations/where_spec.rb +56 -0
  121. data/spec/connections/mysql_connection.rb +16 -0
  122. data/spec/connections/postgresql_connection.rb +15 -0
  123. data/spec/connections/sqlite3_connection.rb +25 -0
  124. data/spec/doubles/hash.rb +23 -0
  125. data/spec/matchers/be_like.rb +24 -0
  126. data/spec/matchers/disambiguate_attributes.rb +28 -0
  127. data/spec/matchers/hash_the_same_as.rb +26 -0
  128. data/spec/schemas/mysql_schema.rb +18 -0
  129. data/spec/schemas/postgresql_schema.rb +18 -0
  130. data/spec/schemas/sqlite3_schema.rb +18 -0
  131. data/spec/spec_helper.rb +47 -0
  132. metadata +250 -0
@@ -0,0 +1,6 @@
1
+ coverage/*
2
+ config/database.yml
3
+ spec/fixtures/*database*
4
+ *.DS_Store
5
+ debug.log
6
+ pkg
@@ -0,0 +1,184 @@
1
+ ## Abstract ##
2
+
3
+ Arel is a Relational Algebra for Ruby. It 1) simplifies the generation complex of SQL queries and it 2) adapts to various RDBMS systems. It is intended to be a framework framework; that is, you can build your own ORM with it, focusing on innovative object and collection modeling as opposed to database compatibility and query generation.
4
+
5
+ ## Status ##
6
+
7
+ Arel is alpha software, BEWARE. Nevertheless, at this point, many (most?) SELECT queries can be composed, including very very complicated ones. Writes are only experimental for now.
8
+
9
+ For the moment, Arel uses ActiveRecord's connection adapters to connect to the various engines, connection pooling, perform quoting, and do type conversion. On the horizon is the use of DataObjects instead.
10
+
11
+ The long term goal, following both LINQ and DataMapper, is to have Arel adapt to engines beyond RDBMS, including XML, IMAP, YAML, etc.
12
+
13
+ ## A Gentle Introduction ##
14
+
15
+ Generating a query with ARel is simple. For example, in order to produce
16
+
17
+ SELECT * FROM users
18
+
19
+ you construct a table relation and convert it to sql:
20
+
21
+ users = Table(:users)
22
+ users.to_sql
23
+
24
+ In fact, you will probably never call `#to_sql`. Rather, you'll work with data from the table directly. You can iterate through all rows in the `users` table like this:
25
+
26
+ users.each { |user| ... }
27
+
28
+ In other words, Arel relations implement Ruby's Enumerable interface. Let's have a look at a concrete example:
29
+
30
+ users.first # => { users[:id] => 1, users[:name] => 'bob' }
31
+
32
+ As you can see, Arel converts the rows from the database into a hash, the values of which are sublimated to the appropriate Ruby primitive (integers, strings, and so forth).
33
+
34
+ ### More Sophisticated <strike>Queries</strike> Relations ###
35
+
36
+ Here is a whirlwind tour through the most common relational operators. These will probably cover 80% of all interaction with the database.
37
+
38
+ First is the 'restriction' operator, `where`:
39
+
40
+ users.where(users[:name].eq('amy'))
41
+ # => SELECT * FROM users WHERE users.name = 'amy'
42
+
43
+ What would, in SQL, be part of the `SELECT` clause is called in Arel a `projection`:
44
+
45
+ users.project(users[:id]) # => SELECT users.id FROM users
46
+
47
+ Joins resemble SQL strongly:
48
+
49
+ users.join(photos).on(users[:id].eq(photos[:user_id]))
50
+ # => SELECT * FROM users INNER JOIN photos ON users.id = photos.user_id
51
+
52
+ What are called `LIMIT` and `OFFSET` in SQL are called `take` and `skip` in Arel:
53
+
54
+ users.take(5) # => SELECT * FROM users LIMIT 5
55
+ users.skip(4) # => SELECT * FROM users OFFSET 4
56
+
57
+ `GROUP BY` is called `group`:
58
+
59
+ users.group(users[:name]) # => SELECT * FROM users GROUP BY name
60
+
61
+ The best property of the Relational Algebra is its "composability", or closure under all operations. For example, to select AND project, just "chain" the method invocations:
62
+
63
+ users \
64
+ .where(users[:name].eq('amy')) \
65
+ .project(users[:id]) \
66
+ # => SELECT users.id FROM users WHERE users.name = 'amy'
67
+
68
+ All operators are chainable in this way, and they are chainable any number of times, in any order.
69
+
70
+ users.where(users[:name].eq('bob')).where(users[:age].lt(25))
71
+
72
+ Of course, many of the operators take multiple arguments, so the last example can be written more tersely:
73
+
74
+ users.where(users[:name].eq('bob'), users[:age].lt(25))
75
+
76
+ The `OR` operator is not yet supported. It will work like this:
77
+
78
+ users.where(users[:name].eq('bob').or(users[:age].lt(25)))
79
+
80
+ The `AND` operator will behave similarly.
81
+
82
+ Finally, most operations take a block form. For example:
83
+
84
+ Table(:users) \
85
+ .where { |u| u[:id].eq(1) } \
86
+ .project { |u| u[:id] }
87
+
88
+ This provides a (sometimes) convenient alternative syntax.
89
+
90
+ ### The Crazy Features ###
91
+
92
+ The examples above are fairly simple and other libraries match or come close to matching the expressiveness of Arel (e.g., `Sequel` in Ruby).
93
+
94
+ #### Complex Joins ####
95
+
96
+ Where Arel really shines in its ability to handle complex joins and aggregations. As a first example, let's consider an "adjacency list", a tree represented in a table. Suppose we have a table `comments`, representing a threaded discussion:
97
+
98
+ comments = Table(:comments)
99
+
100
+ And this table has the following attributes:
101
+
102
+ comments.attributes # => [comments[:id], comments[:body], comments[:parent_id]]
103
+
104
+ The `parent_id` column is a foreign key from the `comments` table to itself. Now, joining a table to itself requires aliasing in SQL. In fact, you may alias in Arel as well:
105
+
106
+ replies = comments.alias
107
+ comments_with_replies = \
108
+ comments.join(replies).on(replies[:parent_id].eq(comments[:id]))
109
+ # => SELECT * FROM comments INNER JOIN comments AS comments_2 WHERE comments_2.parent_id = comments.id
110
+
111
+ The call to `#alias` is actually optional: Arel will always produce a unique name for every table joined in the relation, and it will always do so deterministically to exploit query caching. Explicit aliasing is more common, however. When you want to extract specific slices of data, aliased tables are a necessity. For example to get just certain columns from the row, treat a row like a hash:
112
+
113
+ comments_with_replies.first[replies[:body]]
114
+
115
+ This will return the first comment's reply's body.
116
+
117
+ If you don't need to extract the data later (for example, you're simply doing a join to find comments that have replies, you don't care what the content of the replies are), the block form may be preferable:
118
+
119
+ comments.join(comments) { |comments, replies| replies[:parent_id].eq(comments[:id]) }
120
+ # => SELECT * FROM comments INNER JOIN comments AS comments_2 WHERE comments_2.parent_id = comments.id
121
+
122
+ Note that you do NOT want to do something like:
123
+
124
+ comments.join(comments, comments[:parent_id].eq(comments[:id]))
125
+ # => SELECT * FROM comments INNER JOIN comments AS comments_2 WHERE comments.parent_id = comments.id
126
+
127
+ This does NOT have the same meaning as the previous query, since the comments[:parent_id] reference is effectively ambiguous.
128
+
129
+ #### Complex Aggregations ####
130
+
131
+ My personal favorite feature of Arel, certainly the most difficult to implement, and possibly only of marginal value, is **closure under joining even in the presence of aggregations**. This is a feature where the Relational Algebra is fundamentally easier to use than SQL. Think of this as a preview of the kind of radical functionality that is to come, stuff no other "ORM" is doing.
132
+
133
+ The easiest way to introduce this is in SQL. Your task is to get all users and the **count** of their associated photos. Let's start from the inside out:
134
+
135
+ SELECT count(*)
136
+ FROM photos
137
+ GROUP BY user_id
138
+
139
+ Now, we'd like to join this with the user table. Naively, you might try to do this:
140
+
141
+ SELECT users.*, count(photos.id)
142
+ FROM users
143
+ LEFT OUTER JOIN photos
144
+ ON users.id = photos.id
145
+ GROUP BY photos.user_id
146
+
147
+ Of course, this has a slightly different meaning than our intended query. This is actually a fairly advanced topic in SQL so let's see why this doesn't work *step by step*. Suppose we have these records in our `users` table:
148
+
149
+ mysql> select * from users;
150
+ +------+--------+
151
+ | id | name |
152
+ +------+--------+
153
+ | 1 | hai |
154
+ | 2 | bai |
155
+ | 3 | dumpty |
156
+ +------+--------+
157
+
158
+ And these in the photos table:
159
+
160
+ mysql> select * from photos;
161
+ +------+---------+-----------+
162
+ | id | user_id | camera_id |
163
+ +------+---------+-----------+
164
+ | 1 | 1 | 1 |
165
+ | 2 | 1 | 1 |
166
+ | 3 | 1 | 1 |
167
+ +------+---------+-----------+
168
+
169
+ If we perform the above, incorrect query, we get the following:
170
+
171
+ mysql> select users.*, count(photos.id) from users left outer join photos on users.id = photos.user_id limit 3 group by user_id;
172
+ +------+------+------------------+
173
+ | id | name | count(photos.id) |
174
+ +------+------+------------------+
175
+ | 2 | bai | 0 |
176
+ | 1 | hai | 3 |
177
+ +------+------+------------------+
178
+
179
+ As you can see, we're completely missing data for user with id 3. `dumpty` has no photos, neither does `bai`. But strangely `bai` appeared and `dumpty` didn't! The reason is that the `GROUP BY` clause is aggregating on both tables, not just the `photos` table. All users without photos have a `photos.id` of `null` (thanks to the left outer join). These are rolled up together and an arbitrary user wins. In this case, `bai` not `dumpty`.
180
+
181
+ SELECT users.*, photos_aggregation.cnt
182
+ FROM users
183
+ LEFT OUTER JOIN (SELECT user_id, count(*) as cnt FROM photos GROUP BY user_id) AS photos_aggregation
184
+ ON photos_aggregation.user_id = users.id
@@ -0,0 +1,60 @@
1
+ require "rubygems"
2
+ require "spec/rake/spectask"
3
+
4
+ $LOAD_PATH.unshift "lib"
5
+ require "arel"
6
+
7
+ begin
8
+ require 'jeweler'
9
+
10
+ Jeweler::Tasks.new do |s|
11
+ s.name = "arel"
12
+ s.authors = ["Bryan Helmkamp", "Nick Kallen"]
13
+ s.email = "bryan" + "@" + "brynary.com"
14
+ s.homepage = "http://github.com/brynary/arel"
15
+ s.summary = "Arel is a relational algebra engine for Ruby"
16
+ # s.description = "TODO"
17
+ s.rubyforge_project = "arel"
18
+ s.extra_rdoc_files = %w(README.markdown)
19
+ end
20
+
21
+ Jeweler::RubyforgeTasks.new
22
+ rescue LoadError
23
+ puts "Jeweler not available. Install it with: gem install jeweler"
24
+ end
25
+
26
+ desc "Run specs using RCov (uses mysql database adapter)"
27
+ Spec::Rake::SpecTask.new(:coverage) do |t|
28
+ t.spec_files =
29
+ ["spec/connections/mysql_connection.rb"] +
30
+ FileList['spec/**/*_spec.rb']
31
+
32
+ t.rcov = true
33
+ t.rcov_opts << '--exclude' << "spec,gems"
34
+ t.rcov_opts << '--text-summary'
35
+ t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
36
+ t.rcov_opts << '--only-uncovered'
37
+ end
38
+
39
+ namespace :spec do
40
+ for adapter in %w[mysql sqlite3 postgresql]
41
+ desc "Run specs with the #{adapter} database adapter"
42
+ Spec::Rake::SpecTask.new(adapter) do |t|
43
+ t.spec_files =
44
+ ["spec/connections/#{adapter}_connection.rb"] +
45
+ ["spec/schemas/#{adapter}_schema.rb"] +
46
+ FileList['spec/**/*_spec.rb']
47
+ end
48
+ end
49
+ end
50
+
51
+ desc "Run specs with mysql and sqlite3 database adapters (default)"
52
+ task :spec => ["check_dependencies", "spec:sqlite3", "spec:mysql", "spec:postgresql"]
53
+
54
+ desc "Default task is to run specs"
55
+ task :default => :spec
56
+
57
+ desc 'Removes trailing whitespace'
58
+ task :whitespace do
59
+ sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
60
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,233 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{arel}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Bryan Helmkamp", "Nick Kallen"]
12
+ s.date = %q{2009-08-06}
13
+ s.email = %q{bryan@brynary.com}
14
+ s.extra_rdoc_files = [
15
+ "README.markdown"
16
+ ]
17
+ s.files = [
18
+ ".gitignore",
19
+ "README.markdown",
20
+ "Rakefile",
21
+ "VERSION",
22
+ "arel.gemspec",
23
+ "doc/CONVENTIONS",
24
+ "doc/TODO",
25
+ "lib/arel.rb",
26
+ "lib/arel/.DS_Store",
27
+ "lib/arel/algebra.rb",
28
+ "lib/arel/algebra/extensions.rb",
29
+ "lib/arel/algebra/extensions/class.rb",
30
+ "lib/arel/algebra/extensions/hash.rb",
31
+ "lib/arel/algebra/extensions/object.rb",
32
+ "lib/arel/algebra/extensions/symbol.rb",
33
+ "lib/arel/algebra/predicates.rb",
34
+ "lib/arel/algebra/primitives.rb",
35
+ "lib/arel/algebra/primitives/attribute.rb",
36
+ "lib/arel/algebra/primitives/expression.rb",
37
+ "lib/arel/algebra/primitives/ordering.rb",
38
+ "lib/arel/algebra/primitives/value.rb",
39
+ "lib/arel/algebra/relations.rb",
40
+ "lib/arel/algebra/relations/operations/alias.rb",
41
+ "lib/arel/algebra/relations/operations/group.rb",
42
+ "lib/arel/algebra/relations/operations/join.rb",
43
+ "lib/arel/algebra/relations/operations/order.rb",
44
+ "lib/arel/algebra/relations/operations/project.rb",
45
+ "lib/arel/algebra/relations/operations/skip.rb",
46
+ "lib/arel/algebra/relations/operations/take.rb",
47
+ "lib/arel/algebra/relations/operations/where.rb",
48
+ "lib/arel/algebra/relations/relation.rb",
49
+ "lib/arel/algebra/relations/row.rb",
50
+ "lib/arel/algebra/relations/utilities/compound.rb",
51
+ "lib/arel/algebra/relations/utilities/externalization.rb",
52
+ "lib/arel/algebra/relations/utilities/nil.rb",
53
+ "lib/arel/algebra/relations/writes.rb",
54
+ "lib/arel/engines.rb",
55
+ "lib/arel/engines/memory.rb",
56
+ "lib/arel/engines/memory/engine.rb",
57
+ "lib/arel/engines/memory/predicates.rb",
58
+ "lib/arel/engines/memory/primitives.rb",
59
+ "lib/arel/engines/memory/relations.rb",
60
+ "lib/arel/engines/memory/relations/array.rb",
61
+ "lib/arel/engines/memory/relations/compound.rb",
62
+ "lib/arel/engines/memory/relations/operations.rb",
63
+ "lib/arel/engines/memory/relations/writes.rb",
64
+ "lib/arel/engines/sql.rb",
65
+ "lib/arel/engines/sql/christener.rb",
66
+ "lib/arel/engines/sql/engine.rb",
67
+ "lib/arel/engines/sql/extensions.rb",
68
+ "lib/arel/engines/sql/extensions/array.rb",
69
+ "lib/arel/engines/sql/extensions/nil_class.rb",
70
+ "lib/arel/engines/sql/extensions/object.rb",
71
+ "lib/arel/engines/sql/extensions/range.rb",
72
+ "lib/arel/engines/sql/formatters.rb",
73
+ "lib/arel/engines/sql/predicates.rb",
74
+ "lib/arel/engines/sql/primitives.rb",
75
+ "lib/arel/engines/sql/relations.rb",
76
+ "lib/arel/engines/sql/relations/operations/alias.rb",
77
+ "lib/arel/engines/sql/relations/operations/join.rb",
78
+ "lib/arel/engines/sql/relations/relation.rb",
79
+ "lib/arel/engines/sql/relations/table.rb",
80
+ "lib/arel/engines/sql/relations/utilities/compound.rb",
81
+ "lib/arel/engines/sql/relations/utilities/externalization.rb",
82
+ "lib/arel/engines/sql/relations/utilities/nil.rb",
83
+ "lib/arel/engines/sql/relations/utilities/recursion.rb",
84
+ "lib/arel/engines/sql/relations/writes.rb",
85
+ "lib/arel/session.rb",
86
+ "spec/arel/algebra/unit/predicates/binary_spec.rb",
87
+ "spec/arel/algebra/unit/predicates/equality_spec.rb",
88
+ "spec/arel/algebra/unit/predicates/in_spec.rb",
89
+ "spec/arel/algebra/unit/primitives/attribute_spec.rb",
90
+ "spec/arel/algebra/unit/primitives/expression_spec.rb",
91
+ "spec/arel/algebra/unit/primitives/value_spec.rb",
92
+ "spec/arel/algebra/unit/relations/alias_spec.rb",
93
+ "spec/arel/algebra/unit/relations/delete_spec.rb",
94
+ "spec/arel/algebra/unit/relations/group_spec.rb",
95
+ "spec/arel/algebra/unit/relations/insert_spec.rb",
96
+ "spec/arel/algebra/unit/relations/join_spec.rb",
97
+ "spec/arel/algebra/unit/relations/order_spec.rb",
98
+ "spec/arel/algebra/unit/relations/project_spec.rb",
99
+ "spec/arel/algebra/unit/relations/relation_spec.rb",
100
+ "spec/arel/algebra/unit/relations/skip_spec.rb",
101
+ "spec/arel/algebra/unit/relations/table_spec.rb",
102
+ "spec/arel/algebra/unit/relations/take_spec.rb",
103
+ "spec/arel/algebra/unit/relations/update_spec.rb",
104
+ "spec/arel/algebra/unit/relations/where_spec.rb",
105
+ "spec/arel/algebra/unit/session/session_spec.rb",
106
+ "spec/arel/engines/memory/integration/joins/cross_engine_spec.rb",
107
+ "spec/arel/engines/memory/unit/relations/array_spec.rb",
108
+ "spec/arel/engines/memory/unit/relations/insert_spec.rb",
109
+ "spec/arel/engines/memory/unit/relations/join_spec.rb",
110
+ "spec/arel/engines/memory/unit/relations/order_spec.rb",
111
+ "spec/arel/engines/memory/unit/relations/project_spec.rb",
112
+ "spec/arel/engines/memory/unit/relations/skip_spec.rb",
113
+ "spec/arel/engines/memory/unit/relations/take_spec.rb",
114
+ "spec/arel/engines/memory/unit/relations/where_spec.rb",
115
+ "spec/arel/engines/sql/integration/joins/with_adjacency_spec.rb",
116
+ "spec/arel/engines/sql/integration/joins/with_aggregations_spec.rb",
117
+ "spec/arel/engines/sql/integration/joins/with_compounds_spec.rb",
118
+ "spec/arel/engines/sql/unit/engine_spec.rb",
119
+ "spec/arel/engines/sql/unit/predicates/binary_spec.rb",
120
+ "spec/arel/engines/sql/unit/predicates/equality_spec.rb",
121
+ "spec/arel/engines/sql/unit/predicates/in_spec.rb",
122
+ "spec/arel/engines/sql/unit/predicates/predicates_spec.rb",
123
+ "spec/arel/engines/sql/unit/primitives/attribute_spec.rb",
124
+ "spec/arel/engines/sql/unit/primitives/expression_spec.rb",
125
+ "spec/arel/engines/sql/unit/primitives/literal_spec.rb",
126
+ "spec/arel/engines/sql/unit/primitives/value_spec.rb",
127
+ "spec/arel/engines/sql/unit/relations/alias_spec.rb",
128
+ "spec/arel/engines/sql/unit/relations/delete_spec.rb",
129
+ "spec/arel/engines/sql/unit/relations/group_spec.rb",
130
+ "spec/arel/engines/sql/unit/relations/insert_spec.rb",
131
+ "spec/arel/engines/sql/unit/relations/join_spec.rb",
132
+ "spec/arel/engines/sql/unit/relations/order_spec.rb",
133
+ "spec/arel/engines/sql/unit/relations/project_spec.rb",
134
+ "spec/arel/engines/sql/unit/relations/skip_spec.rb",
135
+ "spec/arel/engines/sql/unit/relations/table_spec.rb",
136
+ "spec/arel/engines/sql/unit/relations/take_spec.rb",
137
+ "spec/arel/engines/sql/unit/relations/update_spec.rb",
138
+ "spec/arel/engines/sql/unit/relations/where_spec.rb",
139
+ "spec/connections/mysql_connection.rb",
140
+ "spec/connections/postgresql_connection.rb",
141
+ "spec/connections/sqlite3_connection.rb",
142
+ "spec/doubles/hash.rb",
143
+ "spec/matchers/be_like.rb",
144
+ "spec/matchers/disambiguate_attributes.rb",
145
+ "spec/matchers/hash_the_same_as.rb",
146
+ "spec/schemas/mysql_schema.rb",
147
+ "spec/schemas/postgresql_schema.rb",
148
+ "spec/schemas/sqlite3_schema.rb",
149
+ "spec/spec_helper.rb"
150
+ ]
151
+ s.homepage = %q{http://github.com/brynary/arel}
152
+ s.rdoc_options = ["--charset=UTF-8"]
153
+ s.require_paths = ["lib"]
154
+ s.rubyforge_project = %q{arel}
155
+ s.rubygems_version = %q{1.3.4}
156
+ s.summary = %q{Arel is a relational algebra engine for Ruby}
157
+ s.test_files = [
158
+ "spec/arel/algebra/unit/predicates/binary_spec.rb",
159
+ "spec/arel/algebra/unit/predicates/equality_spec.rb",
160
+ "spec/arel/algebra/unit/predicates/in_spec.rb",
161
+ "spec/arel/algebra/unit/primitives/attribute_spec.rb",
162
+ "spec/arel/algebra/unit/primitives/expression_spec.rb",
163
+ "spec/arel/algebra/unit/primitives/value_spec.rb",
164
+ "spec/arel/algebra/unit/relations/alias_spec.rb",
165
+ "spec/arel/algebra/unit/relations/delete_spec.rb",
166
+ "spec/arel/algebra/unit/relations/group_spec.rb",
167
+ "spec/arel/algebra/unit/relations/insert_spec.rb",
168
+ "spec/arel/algebra/unit/relations/join_spec.rb",
169
+ "spec/arel/algebra/unit/relations/order_spec.rb",
170
+ "spec/arel/algebra/unit/relations/project_spec.rb",
171
+ "spec/arel/algebra/unit/relations/relation_spec.rb",
172
+ "spec/arel/algebra/unit/relations/skip_spec.rb",
173
+ "spec/arel/algebra/unit/relations/table_spec.rb",
174
+ "spec/arel/algebra/unit/relations/take_spec.rb",
175
+ "spec/arel/algebra/unit/relations/update_spec.rb",
176
+ "spec/arel/algebra/unit/relations/where_spec.rb",
177
+ "spec/arel/algebra/unit/session/session_spec.rb",
178
+ "spec/arel/engines/memory/integration/joins/cross_engine_spec.rb",
179
+ "spec/arel/engines/memory/unit/relations/array_spec.rb",
180
+ "spec/arel/engines/memory/unit/relations/insert_spec.rb",
181
+ "spec/arel/engines/memory/unit/relations/join_spec.rb",
182
+ "spec/arel/engines/memory/unit/relations/order_spec.rb",
183
+ "spec/arel/engines/memory/unit/relations/project_spec.rb",
184
+ "spec/arel/engines/memory/unit/relations/skip_spec.rb",
185
+ "spec/arel/engines/memory/unit/relations/take_spec.rb",
186
+ "spec/arel/engines/memory/unit/relations/where_spec.rb",
187
+ "spec/arel/engines/sql/integration/joins/with_adjacency_spec.rb",
188
+ "spec/arel/engines/sql/integration/joins/with_aggregations_spec.rb",
189
+ "spec/arel/engines/sql/integration/joins/with_compounds_spec.rb",
190
+ "spec/arel/engines/sql/unit/engine_spec.rb",
191
+ "spec/arel/engines/sql/unit/predicates/binary_spec.rb",
192
+ "spec/arel/engines/sql/unit/predicates/equality_spec.rb",
193
+ "spec/arel/engines/sql/unit/predicates/in_spec.rb",
194
+ "spec/arel/engines/sql/unit/predicates/predicates_spec.rb",
195
+ "spec/arel/engines/sql/unit/primitives/attribute_spec.rb",
196
+ "spec/arel/engines/sql/unit/primitives/expression_spec.rb",
197
+ "spec/arel/engines/sql/unit/primitives/literal_spec.rb",
198
+ "spec/arel/engines/sql/unit/primitives/value_spec.rb",
199
+ "spec/arel/engines/sql/unit/relations/alias_spec.rb",
200
+ "spec/arel/engines/sql/unit/relations/delete_spec.rb",
201
+ "spec/arel/engines/sql/unit/relations/group_spec.rb",
202
+ "spec/arel/engines/sql/unit/relations/insert_spec.rb",
203
+ "spec/arel/engines/sql/unit/relations/join_spec.rb",
204
+ "spec/arel/engines/sql/unit/relations/order_spec.rb",
205
+ "spec/arel/engines/sql/unit/relations/project_spec.rb",
206
+ "spec/arel/engines/sql/unit/relations/skip_spec.rb",
207
+ "spec/arel/engines/sql/unit/relations/table_spec.rb",
208
+ "spec/arel/engines/sql/unit/relations/take_spec.rb",
209
+ "spec/arel/engines/sql/unit/relations/update_spec.rb",
210
+ "spec/arel/engines/sql/unit/relations/where_spec.rb",
211
+ "spec/connections/mysql_connection.rb",
212
+ "spec/connections/postgresql_connection.rb",
213
+ "spec/connections/sqlite3_connection.rb",
214
+ "spec/doubles/hash.rb",
215
+ "spec/matchers/be_like.rb",
216
+ "spec/matchers/disambiguate_attributes.rb",
217
+ "spec/matchers/hash_the_same_as.rb",
218
+ "spec/schemas/mysql_schema.rb",
219
+ "spec/schemas/postgresql_schema.rb",
220
+ "spec/schemas/sqlite3_schema.rb",
221
+ "spec/spec_helper.rb"
222
+ ]
223
+
224
+ if s.respond_to? :specification_version then
225
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
226
+ s.specification_version = 3
227
+
228
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
229
+ else
230
+ end
231
+ else
232
+ end
233
+ end