arel 2.1.2 → 2.1.3

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.
@@ -1,4 +1,10 @@
1
- == 2.1.2 / Unreleased
1
+ == 2.1.3 / 2011-06-27
2
+
3
+ * Bug Fixues
4
+
5
+ * Fixed broken gem build.
6
+
7
+ == 2.1.2 / 2011-06-27
2
8
 
3
9
  * Bug Fixes
4
10
 
@@ -21,9 +21,11 @@ lib/arel/insert_manager.rb
21
21
  lib/arel/math.rb
22
22
  lib/arel/nodes.rb
23
23
  lib/arel/nodes/and.rb
24
+ lib/arel/nodes/ascending.rb
24
25
  lib/arel/nodes/binary.rb
25
26
  lib/arel/nodes/count.rb
26
27
  lib/arel/nodes/delete_statement.rb
28
+ lib/arel/nodes/descending.rb
27
29
  lib/arel/nodes/equality.rb
28
30
  lib/arel/nodes/function.rb
29
31
  lib/arel/nodes/in.rb
@@ -59,6 +61,7 @@ lib/arel/visitors.rb
59
61
  lib/arel/visitors/depth_first.rb
60
62
  lib/arel/visitors/dot.rb
61
63
  lib/arel/visitors/ibm_db.rb
64
+ lib/arel/visitors/informix.rb
62
65
  lib/arel/visitors/join_sql.rb
63
66
  lib/arel/visitors/mssql.rb
64
67
  lib/arel/visitors/mysql.rb
@@ -72,10 +75,13 @@ lib/arel/visitors/where_sql.rb
72
75
  test/attributes/test_attribute.rb
73
76
  test/helper.rb
74
77
  test/nodes/test_as.rb
78
+ test/nodes/test_ascending.rb
75
79
  test/nodes/test_bin.rb
76
80
  test/nodes/test_count.rb
77
81
  test/nodes/test_delete_statement.rb
82
+ test/nodes/test_descending.rb
78
83
  test/nodes/test_equality.rb
84
+ test/nodes/test_infix_operation.rb
79
85
  test/nodes/test_insert_statement.rb
80
86
  test/nodes/test_named_function.rb
81
87
  test/nodes/test_node.rb
@@ -99,6 +105,7 @@ test/test_update_manager.rb
99
105
  test/visitors/test_depth_first.rb
100
106
  test/visitors/test_dot.rb
101
107
  test/visitors/test_ibm_db.rb
108
+ test/visitors/test_informix.rb
102
109
  test/visitors/test_join_sql.rb
103
110
  test/visitors/test_mssql.rb
104
111
  test/visitors/test_mysql.rb
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{arel}
5
- s.version = "2.1.2.20110627094400"
5
+ s.version = "2.1.3.20110627095956"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = [%q{Aaron Patterson}, %q{Bryan Halmkamp}, %q{Emilio Tagua}, %q{Nick Kallen}]
@@ -17,7 +17,7 @@ with it, focusing on innovative object and collection modeling as opposed to
17
17
  database compatibility and query generation.}
18
18
  s.email = [%q{aaron@tenderlovemaking.com}, %q{bryan@brynary.com}, %q{miloops@gmail.com}, %q{nick@example.org}]
19
19
  s.extra_rdoc_files = [%q{History.txt}, %q{MIT-LICENSE.txt}, %q{Manifest.txt}, %q{README.markdown}]
20
- s.files = [%q{.autotest}, %q{.gemtest}, %q{History.txt}, %q{MIT-LICENSE.txt}, %q{Manifest.txt}, %q{README.markdown}, %q{Rakefile}, %q{arel.gemspec}, %q{lib/arel.rb}, %q{lib/arel/alias_predication.rb}, %q{lib/arel/attributes.rb}, %q{lib/arel/attributes/attribute.rb}, %q{lib/arel/compatibility/wheres.rb}, %q{lib/arel/crud.rb}, %q{lib/arel/delete_manager.rb}, %q{lib/arel/deprecated.rb}, %q{lib/arel/expression.rb}, %q{lib/arel/expressions.rb}, %q{lib/arel/factory_methods.rb}, %q{lib/arel/insert_manager.rb}, %q{lib/arel/math.rb}, %q{lib/arel/nodes.rb}, %q{lib/arel/nodes/and.rb}, %q{lib/arel/nodes/binary.rb}, %q{lib/arel/nodes/count.rb}, %q{lib/arel/nodes/delete_statement.rb}, %q{lib/arel/nodes/equality.rb}, %q{lib/arel/nodes/function.rb}, %q{lib/arel/nodes/in.rb}, %q{lib/arel/nodes/infix_operation.rb}, %q{lib/arel/nodes/inner_join.rb}, %q{lib/arel/nodes/insert_statement.rb}, %q{lib/arel/nodes/join_source.rb}, %q{lib/arel/nodes/named_function.rb}, %q{lib/arel/nodes/node.rb}, %q{lib/arel/nodes/ordering.rb}, %q{lib/arel/nodes/outer_join.rb}, %q{lib/arel/nodes/select_core.rb}, %q{lib/arel/nodes/select_statement.rb}, %q{lib/arel/nodes/sql_literal.rb}, %q{lib/arel/nodes/string_join.rb}, %q{lib/arel/nodes/table_alias.rb}, %q{lib/arel/nodes/terminal.rb}, %q{lib/arel/nodes/unary.rb}, %q{lib/arel/nodes/unqualified_column.rb}, %q{lib/arel/nodes/update_statement.rb}, %q{lib/arel/nodes/values.rb}, %q{lib/arel/nodes/with.rb}, %q{lib/arel/order_predications.rb}, %q{lib/arel/predications.rb}, %q{lib/arel/relation.rb}, %q{lib/arel/select_manager.rb}, %q{lib/arel/sql/engine.rb}, %q{lib/arel/sql_literal.rb}, %q{lib/arel/table.rb}, %q{lib/arel/tree_manager.rb}, %q{lib/arel/update_manager.rb}, %q{lib/arel/visitors.rb}, %q{lib/arel/visitors/depth_first.rb}, %q{lib/arel/visitors/dot.rb}, %q{lib/arel/visitors/ibm_db.rb}, %q{lib/arel/visitors/join_sql.rb}, %q{lib/arel/visitors/mssql.rb}, %q{lib/arel/visitors/mysql.rb}, %q{lib/arel/visitors/oracle.rb}, %q{lib/arel/visitors/order_clauses.rb}, %q{lib/arel/visitors/postgresql.rb}, %q{lib/arel/visitors/sqlite.rb}, %q{lib/arel/visitors/to_sql.rb}, %q{lib/arel/visitors/visitor.rb}, %q{lib/arel/visitors/where_sql.rb}, %q{test/attributes/test_attribute.rb}, %q{test/helper.rb}, %q{test/nodes/test_as.rb}, %q{test/nodes/test_bin.rb}, %q{test/nodes/test_count.rb}, %q{test/nodes/test_delete_statement.rb}, %q{test/nodes/test_equality.rb}, %q{test/nodes/test_insert_statement.rb}, %q{test/nodes/test_named_function.rb}, %q{test/nodes/test_node.rb}, %q{test/nodes/test_not.rb}, %q{test/nodes/test_or.rb}, %q{test/nodes/test_select_core.rb}, %q{test/nodes/test_select_statement.rb}, %q{test/nodes/test_sql_literal.rb}, %q{test/nodes/test_sum.rb}, %q{test/nodes/test_update_statement.rb}, %q{test/support/fake_record.rb}, %q{test/test_activerecord_compat.rb}, %q{test/test_attributes.rb}, %q{test/test_crud.rb}, %q{test/test_delete_manager.rb}, %q{test/test_factory_methods.rb}, %q{test/test_insert_manager.rb}, %q{test/test_select_manager.rb}, %q{test/test_table.rb}, %q{test/test_update_manager.rb}, %q{test/visitors/test_depth_first.rb}, %q{test/visitors/test_dot.rb}, %q{test/visitors/test_ibm_db.rb}, %q{test/visitors/test_join_sql.rb}, %q{test/visitors/test_mssql.rb}, %q{test/visitors/test_mysql.rb}, %q{test/visitors/test_oracle.rb}, %q{test/visitors/test_postgres.rb}, %q{test/visitors/test_sqlite.rb}, %q{test/visitors/test_to_sql.rb}, %q{test/nodes/test_ascending.rb}, %q{test/nodes/test_descending.rb}, %q{test/nodes/test_infix_operation.rb}, %q{test/visitors/test_informix.rb}]
20
+ s.files = [%q{.autotest}, %q{.gemtest}, %q{History.txt}, %q{MIT-LICENSE.txt}, %q{Manifest.txt}, %q{README.markdown}, %q{Rakefile}, %q{arel.gemspec}, %q{lib/arel.rb}, %q{lib/arel/alias_predication.rb}, %q{lib/arel/attributes.rb}, %q{lib/arel/attributes/attribute.rb}, %q{lib/arel/compatibility/wheres.rb}, %q{lib/arel/crud.rb}, %q{lib/arel/delete_manager.rb}, %q{lib/arel/deprecated.rb}, %q{lib/arel/expression.rb}, %q{lib/arel/expressions.rb}, %q{lib/arel/factory_methods.rb}, %q{lib/arel/insert_manager.rb}, %q{lib/arel/math.rb}, %q{lib/arel/nodes.rb}, %q{lib/arel/nodes/and.rb}, %q{lib/arel/nodes/ascending.rb}, %q{lib/arel/nodes/binary.rb}, %q{lib/arel/nodes/count.rb}, %q{lib/arel/nodes/delete_statement.rb}, %q{lib/arel/nodes/descending.rb}, %q{lib/arel/nodes/equality.rb}, %q{lib/arel/nodes/function.rb}, %q{lib/arel/nodes/in.rb}, %q{lib/arel/nodes/infix_operation.rb}, %q{lib/arel/nodes/inner_join.rb}, %q{lib/arel/nodes/insert_statement.rb}, %q{lib/arel/nodes/join_source.rb}, %q{lib/arel/nodes/named_function.rb}, %q{lib/arel/nodes/node.rb}, %q{lib/arel/nodes/ordering.rb}, %q{lib/arel/nodes/outer_join.rb}, %q{lib/arel/nodes/select_core.rb}, %q{lib/arel/nodes/select_statement.rb}, %q{lib/arel/nodes/sql_literal.rb}, %q{lib/arel/nodes/string_join.rb}, %q{lib/arel/nodes/table_alias.rb}, %q{lib/arel/nodes/terminal.rb}, %q{lib/arel/nodes/unary.rb}, %q{lib/arel/nodes/unqualified_column.rb}, %q{lib/arel/nodes/update_statement.rb}, %q{lib/arel/nodes/values.rb}, %q{lib/arel/nodes/with.rb}, %q{lib/arel/order_predications.rb}, %q{lib/arel/predications.rb}, %q{lib/arel/relation.rb}, %q{lib/arel/select_manager.rb}, %q{lib/arel/sql/engine.rb}, %q{lib/arel/sql_literal.rb}, %q{lib/arel/table.rb}, %q{lib/arel/tree_manager.rb}, %q{lib/arel/update_manager.rb}, %q{lib/arel/visitors.rb}, %q{lib/arel/visitors/depth_first.rb}, %q{lib/arel/visitors/dot.rb}, %q{lib/arel/visitors/ibm_db.rb}, %q{lib/arel/visitors/informix.rb}, %q{lib/arel/visitors/join_sql.rb}, %q{lib/arel/visitors/mssql.rb}, %q{lib/arel/visitors/mysql.rb}, %q{lib/arel/visitors/oracle.rb}, %q{lib/arel/visitors/order_clauses.rb}, %q{lib/arel/visitors/postgresql.rb}, %q{lib/arel/visitors/sqlite.rb}, %q{lib/arel/visitors/to_sql.rb}, %q{lib/arel/visitors/visitor.rb}, %q{lib/arel/visitors/where_sql.rb}, %q{test/attributes/test_attribute.rb}, %q{test/helper.rb}, %q{test/nodes/test_as.rb}, %q{test/nodes/test_ascending.rb}, %q{test/nodes/test_bin.rb}, %q{test/nodes/test_count.rb}, %q{test/nodes/test_delete_statement.rb}, %q{test/nodes/test_descending.rb}, %q{test/nodes/test_equality.rb}, %q{test/nodes/test_infix_operation.rb}, %q{test/nodes/test_insert_statement.rb}, %q{test/nodes/test_named_function.rb}, %q{test/nodes/test_node.rb}, %q{test/nodes/test_not.rb}, %q{test/nodes/test_or.rb}, %q{test/nodes/test_select_core.rb}, %q{test/nodes/test_select_statement.rb}, %q{test/nodes/test_sql_literal.rb}, %q{test/nodes/test_sum.rb}, %q{test/nodes/test_update_statement.rb}, %q{test/support/fake_record.rb}, %q{test/test_activerecord_compat.rb}, %q{test/test_attributes.rb}, %q{test/test_crud.rb}, %q{test/test_delete_manager.rb}, %q{test/test_factory_methods.rb}, %q{test/test_insert_manager.rb}, %q{test/test_select_manager.rb}, %q{test/test_table.rb}, %q{test/test_update_manager.rb}, %q{test/visitors/test_depth_first.rb}, %q{test/visitors/test_dot.rb}, %q{test/visitors/test_ibm_db.rb}, %q{test/visitors/test_informix.rb}, %q{test/visitors/test_join_sql.rb}, %q{test/visitors/test_mssql.rb}, %q{test/visitors/test_mysql.rb}, %q{test/visitors/test_oracle.rb}, %q{test/visitors/test_postgres.rb}, %q{test/visitors/test_sqlite.rb}, %q{test/visitors/test_to_sql.rb}]
21
21
  s.homepage = %q{http://github.com/rails/arel}
22
22
  s.rdoc_options = [%q{--main}, %q{README.markdown}]
23
23
  s.require_paths = [%q{lib}]
@@ -33,7 +33,7 @@ require 'arel/sql_literal'
33
33
  ####
34
34
 
35
35
  module Arel
36
- VERSION = '2.1.2'
36
+ VERSION = '2.1.3'
37
37
 
38
38
  def self.sql raw_sql
39
39
  Arel::Nodes::SqlLiteral.new raw_sql
@@ -0,0 +1,23 @@
1
+ module Arel
2
+ module Nodes
3
+ class Ascending < Ordering
4
+
5
+ def reverse
6
+ Descending.new(expr)
7
+ end
8
+
9
+ def direction
10
+ :asc
11
+ end
12
+
13
+ def ascending?
14
+ true
15
+ end
16
+
17
+ def descending?
18
+ false
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module Arel
2
+ module Nodes
3
+ class Descending < Ordering
4
+
5
+ def reverse
6
+ Ascending.new(expr)
7
+ end
8
+
9
+ def direction
10
+ :desc
11
+ end
12
+
13
+ def ascending?
14
+ false
15
+ end
16
+
17
+ def descending?
18
+ true
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,33 @@
1
+ module Arel
2
+ module Visitors
3
+ class Informix < Arel::Visitors::ToSql
4
+ private
5
+ def visit_Arel_Nodes_SelectStatement o
6
+ [
7
+ "SELECT",
8
+ (visit(o.offset) if o.offset),
9
+ (visit(o.limit) if o.limit),
10
+ o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join,
11
+ ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?),
12
+ (visit(o.lock) if o.lock),
13
+ ].compact.join ' '
14
+ end
15
+ def visit_Arel_Nodes_SelectCore o
16
+ [
17
+ "#{o.projections.map { |x| visit x }.join ', '}",
18
+ ("FROM #{visit o.froms}" if o.froms),
19
+ ("WHERE #{o.wheres.map { |x| visit x }.join ' AND ' }" unless o.wheres.empty?),
20
+ ("GROUP BY #{o.groups.map { |x| visit x }.join ', ' }" unless o.groups.empty?),
21
+ (visit(o.having) if o.having),
22
+ ].compact.join ' '
23
+ end
24
+ def visit_Arel_Nodes_Offset o
25
+ "SKIP #{visit o.expr}"
26
+ end
27
+ def visit_Arel_Nodes_Limit o
28
+ "LIMIT #{visit o.expr}"
29
+ end
30
+ end
31
+ end
32
+ end
33
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 2
10
- version: 2.1.2
9
+ - 3
10
+ version: 2.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aaron Patterson
@@ -82,9 +82,11 @@ files:
82
82
  - lib/arel/math.rb
83
83
  - lib/arel/nodes.rb
84
84
  - lib/arel/nodes/and.rb
85
+ - lib/arel/nodes/ascending.rb
85
86
  - lib/arel/nodes/binary.rb
86
87
  - lib/arel/nodes/count.rb
87
88
  - lib/arel/nodes/delete_statement.rb
89
+ - lib/arel/nodes/descending.rb
88
90
  - lib/arel/nodes/equality.rb
89
91
  - lib/arel/nodes/function.rb
90
92
  - lib/arel/nodes/in.rb
@@ -120,6 +122,7 @@ files:
120
122
  - lib/arel/visitors/depth_first.rb
121
123
  - lib/arel/visitors/dot.rb
122
124
  - lib/arel/visitors/ibm_db.rb
125
+ - lib/arel/visitors/informix.rb
123
126
  - lib/arel/visitors/join_sql.rb
124
127
  - lib/arel/visitors/mssql.rb
125
128
  - lib/arel/visitors/mysql.rb
@@ -133,10 +136,13 @@ files:
133
136
  - test/attributes/test_attribute.rb
134
137
  - test/helper.rb
135
138
  - test/nodes/test_as.rb
139
+ - test/nodes/test_ascending.rb
136
140
  - test/nodes/test_bin.rb
137
141
  - test/nodes/test_count.rb
138
142
  - test/nodes/test_delete_statement.rb
143
+ - test/nodes/test_descending.rb
139
144
  - test/nodes/test_equality.rb
145
+ - test/nodes/test_infix_operation.rb
140
146
  - test/nodes/test_insert_statement.rb
141
147
  - test/nodes/test_named_function.rb
142
148
  - test/nodes/test_node.rb
@@ -160,6 +166,7 @@ files:
160
166
  - test/visitors/test_depth_first.rb
161
167
  - test/visitors/test_dot.rb
162
168
  - test/visitors/test_ibm_db.rb
169
+ - test/visitors/test_informix.rb
163
170
  - test/visitors/test_join_sql.rb
164
171
  - test/visitors/test_mssql.rb
165
172
  - test/visitors/test_mysql.rb
@@ -167,10 +174,6 @@ files:
167
174
  - test/visitors/test_postgres.rb
168
175
  - test/visitors/test_sqlite.rb
169
176
  - test/visitors/test_to_sql.rb
170
- - test/nodes/test_ascending.rb
171
- - test/nodes/test_descending.rb
172
- - test/nodes/test_infix_operation.rb
173
- - test/visitors/test_informix.rb
174
177
  homepage: http://github.com/rails/arel
175
178
  licenses: []
176
179