arel 3.0.3 → 4.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +2 -2
  3. data/Gemfile +3 -4
  4. data/History.txt +0 -51
  5. data/Manifest.txt +8 -2
  6. data/README.markdown +1 -1
  7. data/Rakefile +1 -1
  8. data/arel.gemspec +21 -29
  9. data/lib/arel.rb +1 -3
  10. data/lib/arel/nodes.rb +1 -0
  11. data/lib/arel/nodes/and.rb +10 -0
  12. data/lib/arel/nodes/binary.rb +11 -0
  13. data/lib/arel/nodes/extract.rb +11 -0
  14. data/lib/arel/nodes/false.rb +7 -0
  15. data/lib/arel/nodes/function.rb +11 -0
  16. data/lib/arel/nodes/grouping.rb +7 -0
  17. data/lib/arel/nodes/insert_statement.rb +12 -0
  18. data/lib/arel/nodes/named_function.rb +9 -0
  19. data/lib/arel/nodes/select_core.rb +20 -0
  20. data/lib/arel/nodes/select_statement.rb +15 -1
  21. data/lib/arel/nodes/table_alias.rb +4 -0
  22. data/lib/arel/nodes/terminal.rb +7 -0
  23. data/lib/arel/nodes/true.rb +7 -0
  24. data/lib/arel/nodes/unary.rb +10 -1
  25. data/lib/arel/nodes/update_statement.rb +15 -0
  26. data/lib/arel/nodes/window.rb +30 -3
  27. data/lib/arel/select_manager.rb +4 -0
  28. data/lib/arel/table.rb +13 -0
  29. data/lib/arel/tree_manager.rb +0 -2
  30. data/lib/arel/visitors/bind_visitor.rb +10 -0
  31. data/lib/arel/visitors/dot.rb +1 -1
  32. data/lib/arel/visitors/oracle.rb +1 -2
  33. data/lib/arel/visitors/to_sql.rb +138 -27
  34. data/test/nodes/test_and.rb +20 -0
  35. data/test/nodes/test_as.rb +12 -0
  36. data/test/nodes/test_ascending.rb +10 -0
  37. data/test/nodes/test_bin.rb +10 -0
  38. data/test/nodes/test_count.rb +12 -0
  39. data/test/nodes/test_delete_statement.rb +20 -0
  40. data/test/nodes/test_descending.rb +10 -0
  41. data/test/nodes/test_distinct.rb +20 -0
  42. data/test/nodes/test_equality.rb +10 -0
  43. data/test/nodes/test_extract.rb +14 -0
  44. data/test/nodes/test_false.rb +20 -0
  45. data/test/nodes/test_grouping.rb +25 -0
  46. data/test/nodes/test_infix_operation.rb +10 -0
  47. data/test/nodes/test_insert_statement.rb +24 -0
  48. data/test/nodes/test_named_function.rb +16 -0
  49. data/test/nodes/test_not.rb +12 -0
  50. data/test/nodes/test_or.rb +12 -0
  51. data/test/nodes/test_over.rb +18 -0
  52. data/test/nodes/test_select_core.rb +38 -0
  53. data/test/nodes/test_select_statement.rb +36 -0
  54. data/test/nodes/test_sql_literal.rb +10 -0
  55. data/test/nodes/test_sum.rb +12 -0
  56. data/test/nodes/test_table_alias.rb +36 -0
  57. data/test/nodes/test_true.rb +21 -0
  58. data/test/nodes/test_update_statement.rb +40 -0
  59. data/test/nodes/test_window.rb +73 -0
  60. data/test/test_attributes.rb +12 -0
  61. data/test/test_insert_manager.rb +0 -2
  62. data/test/test_select_manager.rb +10 -5
  63. data/test/test_table.rb +24 -0
  64. data/test/test_update_manager.rb +8 -0
  65. data/test/visitors/test_bind_visitor.rb +20 -1
  66. data/test/visitors/test_oracle.rb +1 -2
  67. data/test/visitors/test_to_sql.rb +44 -0
  68. metadata +76 -86
  69. data/lib/arel/nodes/ordering.rb +0 -6
  70. data/lib/arel/relation.rb +0 -6
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3bffeca2f74de102b93f79a39be17415ef98399f
4
+ data.tar.gz: ebd8a4b403109325f511a917ade3a8ea79a86292
5
+ SHA512:
6
+ metadata.gz: 8c2e5369682dc3fd3ed0d0ebc8336ce5a4d0ad8f0436ccbc49c5c741cad6c7601fd13d36906319260ddc184270f2bfd6712d3024d1bf144c1fcb5378327caf64
7
+ data.tar.gz: 69c8070216e4a9ed581a0ff084710c20d5152051d8be144a4e51351fa6c8215373c692301c847fee61eec88c8aa764914ec919208b635a8388368031e6f2c3c9
@@ -1,8 +1,8 @@
1
1
  script: "rake test"
2
2
  rvm:
3
3
  - 1.8.7
4
- - rbx
5
- - rbx-2.0
4
+ - rbx-18mode
5
+ - rbx-19mode
6
6
  - jruby
7
7
  - 1.9.2
8
8
  - 1.9.3
data/Gemfile CHANGED
@@ -2,11 +2,10 @@
2
2
 
3
3
  # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
4
4
 
5
- source "https://rubygems.org/"
5
+ source :gemcutter
6
6
 
7
7
 
8
- gem "minitest", "~>4.7", :group => [:development, :test]
9
- gem "rdoc", "~>4.0", :group => [:development, :test]
10
- gem "hoe", "~>3.6", :group => [:development, :test]
8
+ gem "minitest", "~>4.3.3", :group => [:development, :test]
9
+ gem "hoe", "~>3.3.1", :group => [:development, :test]
11
10
 
12
11
  # vim: syntax=ruby
@@ -1,54 +1,3 @@
1
- == 3.0.3 / 2013-11-12
2
-
3
- * Enhancements
4
-
5
- * Support ANSI 2003 window functions
6
-
7
- * Bug Fixes
8
-
9
- * Fix joins in Informix
10
-
11
- == 3.0.2 / 2012-02-21
12
-
13
- * Enhancements
14
-
15
- * Added a module for visiting and transforming bind values
16
- * Fix in [] to be false, not in [] to be true
17
-
18
- * Bug Fixes
19
-
20
- * Revert fix for LIMIT / OFFSET when query is ordered in Oracle
21
-
22
- == 3.0.1 / 2012-02-17
23
-
24
- * Bug Fixes
25
-
26
- * Fixed LIMIT / OFFSET when query is ordered in Oracle
27
-
28
- == 3.0.0 / 2012-01-12
29
-
30
- * Enhancements
31
-
32
- * Support connection pool and schema cache
33
-
34
- * Bug Fixes
35
-
36
- * Conditions with no column can be followed by other conditions in Postgres
37
-
38
- == 2.2.3 / 2012-02-21
39
-
40
- * Enhancements
41
-
42
- * Added a module for visiting and transforming bind values
43
-
44
- == 2.2.2 / 2012-02-20
45
-
46
- * Enhancements
47
-
48
- * Support LOCK
49
- * Allow using non-table alias as a right-hand relation name
50
- * Added SelectManager#distinct
51
-
52
1
  == 2.2.1 / 2011-09-15
53
2
 
54
3
  * Enhancements
@@ -32,6 +32,7 @@ lib/arel/nodes/equality.rb
32
32
  lib/arel/nodes/extract.rb
33
33
  lib/arel/nodes/false.rb
34
34
  lib/arel/nodes/function.rb
35
+ lib/arel/nodes/grouping.rb
35
36
  lib/arel/nodes/in.rb
36
37
  lib/arel/nodes/infix_operation.rb
37
38
  lib/arel/nodes/inner_join.rb
@@ -39,7 +40,6 @@ lib/arel/nodes/insert_statement.rb
39
40
  lib/arel/nodes/join_source.rb
40
41
  lib/arel/nodes/named_function.rb
41
42
  lib/arel/nodes/node.rb
42
- lib/arel/nodes/ordering.rb
43
43
  lib/arel/nodes/outer_join.rb
44
44
  lib/arel/nodes/over.rb
45
45
  lib/arel/nodes/select_core.rb
@@ -57,7 +57,6 @@ lib/arel/nodes/window.rb
57
57
  lib/arel/nodes/with.rb
58
58
  lib/arel/order_predications.rb
59
59
  lib/arel/predications.rb
60
- lib/arel/relation.rb
61
60
  lib/arel/select_manager.rb
62
61
  lib/arel/sql/engine.rb
63
62
  lib/arel/sql_literal.rb
@@ -83,14 +82,18 @@ lib/arel/visitors/where_sql.rb
83
82
  lib/arel/window_predications.rb
84
83
  test/attributes/test_attribute.rb
85
84
  test/helper.rb
85
+ test/nodes/test_and.rb
86
86
  test/nodes/test_as.rb
87
87
  test/nodes/test_ascending.rb
88
88
  test/nodes/test_bin.rb
89
89
  test/nodes/test_count.rb
90
90
  test/nodes/test_delete_statement.rb
91
91
  test/nodes/test_descending.rb
92
+ test/nodes/test_distinct.rb
92
93
  test/nodes/test_equality.rb
93
94
  test/nodes/test_extract.rb
95
+ test/nodes/test_false.rb
96
+ test/nodes/test_grouping.rb
94
97
  test/nodes/test_infix_operation.rb
95
98
  test/nodes/test_insert_statement.rb
96
99
  test/nodes/test_named_function.rb
@@ -102,7 +105,10 @@ test/nodes/test_select_core.rb
102
105
  test/nodes/test_select_statement.rb
103
106
  test/nodes/test_sql_literal.rb
104
107
  test/nodes/test_sum.rb
108
+ test/nodes/test_table_alias.rb
109
+ test/nodes/test_true.rb
105
110
  test/nodes/test_update_statement.rb
111
+ test/nodes/test_window.rb
106
112
  test/support/fake_record.rb
107
113
  test/test_activerecord_compat.rb
108
114
  test/test_attributes.rb
@@ -54,7 +54,7 @@ What are called `LIMIT` and `OFFSET` in SQL are called `take` and `skip` in Arel
54
54
 
55
55
  `GROUP BY` is called `group`:
56
56
 
57
- users.group(users[:name]) # => SELECT * FROM users GROUP BY name
57
+ users.project(users[:name]).group(users[:name]) # => SELECT users.name FROM users GROUP BY users.name
58
58
 
59
59
  The best property of the Relational Algebra is its "composability", or closure under all operations. For example, to restrict AND project, just "chain" the method invocations:
60
60
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require "rubygems"
2
- gem 'hoe', '>= 2.1.0'
2
+ gem 'hoe', '>= 3.3.1'
3
3
  require 'hoe'
4
4
 
5
5
  Hoe.plugins.delete :rubyforge
@@ -1,47 +1,39 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{arel}
5
- s.version = "3.0.3.20131114190737"
4
+ s.name = "arel"
5
+ s.version = "4.0.0.beta1.20130225132415"
6
6
 
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
7
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Aaron Patterson", "Bryan Halmkamp", "Emilio Tagua", "Nick Kallen"]
9
- s.date = %q{2013-11-14}
10
- s.description = %q{Arel is a SQL AST manager for Ruby. It
11
-
12
- 1. Simplifies the generation of complex SQL queries
13
- 2. Adapts to various RDBMS systems
14
-
15
- It is intended to be a framework framework; that is, you can build your own ORM
16
- with it, focusing on innovative object and collection modeling as opposed to
17
- database compatibility and query generation.}
9
+ s.date = "2013-02-25"
10
+ s.description = "Arel is a SQL AST manager for Ruby. It\n\n1. Simplifies the generation of complex SQL queries\n2. Adapts to various RDBMS systems\n\nIt is intended to be a framework framework; that is, you can build your own ORM\nwith it, focusing on innovative object and collection modeling as opposed to\ndatabase compatibility and query generation."
18
11
  s.email = ["aaron@tenderlovemaking.com", "bryan@brynary.com", "miloops@gmail.com", "nick@example.org"]
19
12
  s.extra_rdoc_files = ["History.txt", "MIT-LICENSE.txt", "Manifest.txt", "README.markdown"]
20
- s.files = [".autotest", ".gemtest", ".travis.yml", "Gemfile", "History.txt", "MIT-LICENSE.txt", "Manifest.txt", "README.markdown", "Rakefile", "arel.gemspec", "lib/arel.rb", "lib/arel/alias_predication.rb", "lib/arel/attributes.rb", "lib/arel/attributes/attribute.rb", "lib/arel/compatibility/wheres.rb", "lib/arel/crud.rb", "lib/arel/delete_manager.rb", "lib/arel/deprecated.rb", "lib/arel/expression.rb", "lib/arel/expressions.rb", "lib/arel/factory_methods.rb", "lib/arel/insert_manager.rb", "lib/arel/math.rb", "lib/arel/nodes.rb", "lib/arel/nodes/and.rb", "lib/arel/nodes/ascending.rb", "lib/arel/nodes/binary.rb", "lib/arel/nodes/count.rb", "lib/arel/nodes/delete_statement.rb", "lib/arel/nodes/descending.rb", "lib/arel/nodes/equality.rb", "lib/arel/nodes/extract.rb", "lib/arel/nodes/false.rb", "lib/arel/nodes/function.rb", "lib/arel/nodes/in.rb", "lib/arel/nodes/infix_operation.rb", "lib/arel/nodes/inner_join.rb", "lib/arel/nodes/insert_statement.rb", "lib/arel/nodes/join_source.rb", "lib/arel/nodes/named_function.rb", "lib/arel/nodes/node.rb", "lib/arel/nodes/ordering.rb", "lib/arel/nodes/outer_join.rb", "lib/arel/nodes/over.rb", "lib/arel/nodes/select_core.rb", "lib/arel/nodes/select_statement.rb", "lib/arel/nodes/sql_literal.rb", "lib/arel/nodes/string_join.rb", "lib/arel/nodes/table_alias.rb", "lib/arel/nodes/terminal.rb", "lib/arel/nodes/true.rb", "lib/arel/nodes/unary.rb", "lib/arel/nodes/unqualified_column.rb", "lib/arel/nodes/update_statement.rb", "lib/arel/nodes/values.rb", "lib/arel/nodes/window.rb", "lib/arel/nodes/with.rb", "lib/arel/order_predications.rb", "lib/arel/predications.rb", "lib/arel/relation.rb", "lib/arel/select_manager.rb", "lib/arel/sql/engine.rb", "lib/arel/sql_literal.rb", "lib/arel/table.rb", "lib/arel/tree_manager.rb", "lib/arel/update_manager.rb", "lib/arel/visitors.rb", "lib/arel/visitors/bind_visitor.rb", "lib/arel/visitors/depth_first.rb", "lib/arel/visitors/dot.rb", "lib/arel/visitors/ibm_db.rb", "lib/arel/visitors/informix.rb", "lib/arel/visitors/join_sql.rb", "lib/arel/visitors/mssql.rb", "lib/arel/visitors/mysql.rb", "lib/arel/visitors/oracle.rb", "lib/arel/visitors/order_clauses.rb", "lib/arel/visitors/postgresql.rb", "lib/arel/visitors/sqlite.rb", "lib/arel/visitors/to_sql.rb", "lib/arel/visitors/visitor.rb", "lib/arel/visitors/where_sql.rb", "lib/arel/window_predications.rb", "test/attributes/test_attribute.rb", "test/helper.rb", "test/nodes/test_as.rb", "test/nodes/test_ascending.rb", "test/nodes/test_bin.rb", "test/nodes/test_count.rb", "test/nodes/test_delete_statement.rb", "test/nodes/test_descending.rb", "test/nodes/test_equality.rb", "test/nodes/test_extract.rb", "test/nodes/test_infix_operation.rb", "test/nodes/test_insert_statement.rb", "test/nodes/test_named_function.rb", "test/nodes/test_node.rb", "test/nodes/test_not.rb", "test/nodes/test_or.rb", "test/nodes/test_over.rb", "test/nodes/test_select_core.rb", "test/nodes/test_select_statement.rb", "test/nodes/test_sql_literal.rb", "test/nodes/test_sum.rb", "test/nodes/test_update_statement.rb", "test/support/fake_record.rb", "test/test_activerecord_compat.rb", "test/test_attributes.rb", "test/test_crud.rb", "test/test_delete_manager.rb", "test/test_factory_methods.rb", "test/test_insert_manager.rb", "test/test_select_manager.rb", "test/test_table.rb", "test/test_update_manager.rb", "test/visitors/test_bind_visitor.rb", "test/visitors/test_depth_first.rb", "test/visitors/test_dot.rb", "test/visitors/test_ibm_db.rb", "test/visitors/test_informix.rb", "test/visitors/test_join_sql.rb", "test/visitors/test_mssql.rb", "test/visitors/test_mysql.rb", "test/visitors/test_oracle.rb", "test/visitors/test_postgres.rb", "test/visitors/test_sqlite.rb", "test/visitors/test_to_sql.rb"]
21
- s.homepage = %q{http://github.com/rails/arel}
22
- s.licenses = ["MIT"]
13
+ s.files = [".autotest", ".gemtest", ".travis.yml", "Gemfile", "History.txt", "MIT-LICENSE.txt", "Manifest.txt", "README.markdown", "Rakefile", "arel.gemspec", "lib/arel.rb", "lib/arel/alias_predication.rb", "lib/arel/attributes.rb", "lib/arel/attributes/attribute.rb", "lib/arel/compatibility/wheres.rb", "lib/arel/crud.rb", "lib/arel/delete_manager.rb", "lib/arel/deprecated.rb", "lib/arel/expression.rb", "lib/arel/expressions.rb", "lib/arel/factory_methods.rb", "lib/arel/insert_manager.rb", "lib/arel/math.rb", "lib/arel/nodes.rb", "lib/arel/nodes/and.rb", "lib/arel/nodes/ascending.rb", "lib/arel/nodes/binary.rb", "lib/arel/nodes/count.rb", "lib/arel/nodes/delete_statement.rb", "lib/arel/nodes/descending.rb", "lib/arel/nodes/equality.rb", "lib/arel/nodes/extract.rb", "lib/arel/nodes/false.rb", "lib/arel/nodes/function.rb", "lib/arel/nodes/grouping.rb", "lib/arel/nodes/in.rb", "lib/arel/nodes/infix_operation.rb", "lib/arel/nodes/inner_join.rb", "lib/arel/nodes/insert_statement.rb", "lib/arel/nodes/join_source.rb", "lib/arel/nodes/named_function.rb", "lib/arel/nodes/node.rb", "lib/arel/nodes/outer_join.rb", "lib/arel/nodes/over.rb", "lib/arel/nodes/select_core.rb", "lib/arel/nodes/select_statement.rb", "lib/arel/nodes/sql_literal.rb", "lib/arel/nodes/string_join.rb", "lib/arel/nodes/table_alias.rb", "lib/arel/nodes/terminal.rb", "lib/arel/nodes/true.rb", "lib/arel/nodes/unary.rb", "lib/arel/nodes/unqualified_column.rb", "lib/arel/nodes/update_statement.rb", "lib/arel/nodes/values.rb", "lib/arel/nodes/window.rb", "lib/arel/nodes/with.rb", "lib/arel/order_predications.rb", "lib/arel/predications.rb", "lib/arel/select_manager.rb", "lib/arel/sql/engine.rb", "lib/arel/sql_literal.rb", "lib/arel/table.rb", "lib/arel/tree_manager.rb", "lib/arel/update_manager.rb", "lib/arel/visitors.rb", "lib/arel/visitors/bind_visitor.rb", "lib/arel/visitors/depth_first.rb", "lib/arel/visitors/dot.rb", "lib/arel/visitors/ibm_db.rb", "lib/arel/visitors/informix.rb", "lib/arel/visitors/join_sql.rb", "lib/arel/visitors/mssql.rb", "lib/arel/visitors/mysql.rb", "lib/arel/visitors/oracle.rb", "lib/arel/visitors/order_clauses.rb", "lib/arel/visitors/postgresql.rb", "lib/arel/visitors/sqlite.rb", "lib/arel/visitors/to_sql.rb", "lib/arel/visitors/visitor.rb", "lib/arel/visitors/where_sql.rb", "lib/arel/window_predications.rb", "test/attributes/test_attribute.rb", "test/helper.rb", "test/nodes/test_and.rb", "test/nodes/test_as.rb", "test/nodes/test_ascending.rb", "test/nodes/test_bin.rb", "test/nodes/test_count.rb", "test/nodes/test_delete_statement.rb", "test/nodes/test_descending.rb", "test/nodes/test_distinct.rb", "test/nodes/test_equality.rb", "test/nodes/test_extract.rb", "test/nodes/test_false.rb", "test/nodes/test_grouping.rb", "test/nodes/test_infix_operation.rb", "test/nodes/test_insert_statement.rb", "test/nodes/test_named_function.rb", "test/nodes/test_node.rb", "test/nodes/test_not.rb", "test/nodes/test_or.rb", "test/nodes/test_over.rb", "test/nodes/test_select_core.rb", "test/nodes/test_select_statement.rb", "test/nodes/test_sql_literal.rb", "test/nodes/test_sum.rb", "test/nodes/test_table_alias.rb", "test/nodes/test_true.rb", "test/nodes/test_update_statement.rb", "test/nodes/test_window.rb", "test/support/fake_record.rb", "test/test_activerecord_compat.rb", "test/test_attributes.rb", "test/test_crud.rb", "test/test_delete_manager.rb", "test/test_factory_methods.rb", "test/test_insert_manager.rb", "test/test_select_manager.rb", "test/test_table.rb", "test/test_update_manager.rb", "test/visitors/test_bind_visitor.rb", "test/visitors/test_depth_first.rb", "test/visitors/test_dot.rb", "test/visitors/test_ibm_db.rb", "test/visitors/test_informix.rb", "test/visitors/test_join_sql.rb", "test/visitors/test_mssql.rb", "test/visitors/test_mysql.rb", "test/visitors/test_oracle.rb", "test/visitors/test_postgres.rb", "test/visitors/test_sqlite.rb", "test/visitors/test_to_sql.rb"]
14
+ s.homepage = "http://github.com/rails/arel"
23
15
  s.rdoc_options = ["--main", "README.markdown"]
24
16
  s.require_paths = ["lib"]
25
- s.rubyforge_project = %q{arel}
26
- s.rubygems_version = %q{1.6.2}
27
- s.summary = %q{Arel is a SQL AST manager for Ruby}
28
- s.test_files = ["test/attributes/test_attribute.rb", "test/nodes/test_as.rb", "test/nodes/test_ascending.rb", "test/nodes/test_bin.rb", "test/nodes/test_count.rb", "test/nodes/test_delete_statement.rb", "test/nodes/test_descending.rb", "test/nodes/test_equality.rb", "test/nodes/test_extract.rb", "test/nodes/test_infix_operation.rb", "test/nodes/test_insert_statement.rb", "test/nodes/test_named_function.rb", "test/nodes/test_node.rb", "test/nodes/test_not.rb", "test/nodes/test_or.rb", "test/nodes/test_over.rb", "test/nodes/test_select_core.rb", "test/nodes/test_select_statement.rb", "test/nodes/test_sql_literal.rb", "test/nodes/test_sum.rb", "test/nodes/test_update_statement.rb", "test/test_activerecord_compat.rb", "test/test_attributes.rb", "test/test_crud.rb", "test/test_delete_manager.rb", "test/test_factory_methods.rb", "test/test_insert_manager.rb", "test/test_select_manager.rb", "test/test_table.rb", "test/test_update_manager.rb", "test/visitors/test_bind_visitor.rb", "test/visitors/test_depth_first.rb", "test/visitors/test_dot.rb", "test/visitors/test_ibm_db.rb", "test/visitors/test_informix.rb", "test/visitors/test_join_sql.rb", "test/visitors/test_mssql.rb", "test/visitors/test_mysql.rb", "test/visitors/test_oracle.rb", "test/visitors/test_postgres.rb", "test/visitors/test_sqlite.rb", "test/visitors/test_to_sql.rb"]
17
+ s.rubyforge_project = "arel"
18
+ s.rubygems_version = "2.0.0"
19
+ s.summary = "Arel is a SQL AST manager for Ruby"
20
+ s.test_files = ["test/attributes/test_attribute.rb", "test/nodes/test_and.rb", "test/nodes/test_as.rb", "test/nodes/test_ascending.rb", "test/nodes/test_bin.rb", "test/nodes/test_count.rb", "test/nodes/test_delete_statement.rb", "test/nodes/test_descending.rb", "test/nodes/test_distinct.rb", "test/nodes/test_equality.rb", "test/nodes/test_extract.rb", "test/nodes/test_false.rb", "test/nodes/test_grouping.rb", "test/nodes/test_infix_operation.rb", "test/nodes/test_insert_statement.rb", "test/nodes/test_named_function.rb", "test/nodes/test_node.rb", "test/nodes/test_not.rb", "test/nodes/test_or.rb", "test/nodes/test_over.rb", "test/nodes/test_select_core.rb", "test/nodes/test_select_statement.rb", "test/nodes/test_sql_literal.rb", "test/nodes/test_sum.rb", "test/nodes/test_table_alias.rb", "test/nodes/test_true.rb", "test/nodes/test_update_statement.rb", "test/nodes/test_window.rb", "test/test_activerecord_compat.rb", "test/test_attributes.rb", "test/test_crud.rb", "test/test_delete_manager.rb", "test/test_factory_methods.rb", "test/test_insert_manager.rb", "test/test_select_manager.rb", "test/test_table.rb", "test/test_update_manager.rb", "test/visitors/test_bind_visitor.rb", "test/visitors/test_depth_first.rb", "test/visitors/test_dot.rb", "test/visitors/test_ibm_db.rb", "test/visitors/test_informix.rb", "test/visitors/test_join_sql.rb", "test/visitors/test_mssql.rb", "test/visitors/test_mysql.rb", "test/visitors/test_oracle.rb", "test/visitors/test_postgres.rb", "test/visitors/test_sqlite.rb", "test/visitors/test_to_sql.rb"]
29
21
 
30
22
  if s.respond_to? :specification_version then
31
- s.specification_version = 3
23
+ s.specification_version = 4
32
24
 
33
25
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
34
- s.add_development_dependency(%q<minitest>, ["~> 4.7"])
35
- s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
36
- s.add_development_dependency(%q<hoe>, ["~> 3.7"])
26
+ s.add_development_dependency(%q<minitest>, ["~> 4.6"])
27
+ s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
28
+ s.add_development_dependency(%q<hoe>, ["~> 3.5"])
37
29
  else
38
- s.add_dependency(%q<minitest>, ["~> 4.7"])
39
- s.add_dependency(%q<rdoc>, ["~> 4.0"])
40
- s.add_dependency(%q<hoe>, ["~> 3.7"])
30
+ s.add_dependency(%q<minitest>, ["~> 4.6"])
31
+ s.add_dependency(%q<rdoc>, ["~> 3.10"])
32
+ s.add_dependency(%q<hoe>, ["~> 3.5"])
41
33
  end
42
34
  else
43
- s.add_dependency(%q<minitest>, ["~> 4.7"])
44
- s.add_dependency(%q<rdoc>, ["~> 4.0"])
45
- s.add_dependency(%q<hoe>, ["~> 3.7"])
35
+ s.add_dependency(%q<minitest>, ["~> 4.6"])
36
+ s.add_dependency(%q<rdoc>, ["~> 3.10"])
37
+ s.add_dependency(%q<hoe>, ["~> 3.5"])
46
38
  end
47
39
  end
@@ -12,8 +12,6 @@ require 'arel/attributes'
12
12
  require 'arel/compatibility/wheres'
13
13
 
14
14
  #### these are deprecated
15
- # The Arel::Relation constant is referenced in Rails
16
- require 'arel/relation'
17
15
  require 'arel/expression'
18
16
  ####
19
17
 
@@ -34,7 +32,7 @@ require 'arel/sql_literal'
34
32
  ####
35
33
 
36
34
  module Arel
37
- VERSION = '3.0.3'
35
+ VERSION = '4.0.0.beta1'
38
36
 
39
37
  def self.sql raw_sql
40
38
  Arel::Nodes::SqlLiteral.new raw_sql
@@ -13,6 +13,7 @@ require 'arel/nodes/false'
13
13
 
14
14
  # unary
15
15
  require 'arel/nodes/unary'
16
+ require 'arel/nodes/grouping'
16
17
  require 'arel/nodes/ascending'
17
18
  require 'arel/nodes/descending'
18
19
  require 'arel/nodes/unqualified_column'
@@ -18,6 +18,16 @@ module Arel
18
18
  def right
19
19
  children[1]
20
20
  end
21
+
22
+ def hash
23
+ children.hash
24
+ end
25
+
26
+ def eql? other
27
+ self.class == other.class &&
28
+ self.children == other.children
29
+ end
30
+ alias :== :eql?
21
31
  end
22
32
  end
23
33
  end
@@ -13,6 +13,17 @@ module Arel
13
13
  @left = @left.clone if @left
14
14
  @right = @right.clone if @right
15
15
  end
16
+
17
+ def hash
18
+ [@left, @right].hash
19
+ end
20
+
21
+ def eql? other
22
+ self.class == other.class &&
23
+ self.left == other.left &&
24
+ self.right == other.right
25
+ end
26
+ alias :== :eql?
16
27
  end
17
28
 
18
29
  %w{
@@ -18,6 +18,17 @@ module Arel
18
18
  self.alias = SqlLiteral.new(aliaz)
19
19
  self
20
20
  end
21
+
22
+ def hash
23
+ super ^ [@field, @alias].hash
24
+ end
25
+
26
+ def eql? other
27
+ super &&
28
+ self.field == other.field &&
29
+ self.alias == other.alias
30
+ end
31
+ alias :== :eql?
21
32
  end
22
33
  end
23
34
  end
@@ -1,6 +1,13 @@
1
1
  module Arel
2
2
  module Nodes
3
3
  class False < Arel::Nodes::Node
4
+ def hash
5
+ self.class.hash
6
+ end
7
+
8
+ def eql? other
9
+ self.class == other.class
10
+ end
4
11
  end
5
12
  end
6
13
  end
@@ -16,6 +16,17 @@ module Arel
16
16
  self.alias = SqlLiteral.new(aliaz)
17
17
  self
18
18
  end
19
+
20
+ def hash
21
+ [@expressions, @alias, @distinct].hash
22
+ end
23
+
24
+ def eql? other
25
+ self.class == other.class &&
26
+ self.expressions == other.expressions &&
27
+ self.alias == other.alias &&
28
+ self.distinct == other.distinct
29
+ end
19
30
  end
20
31
 
21
32
  %w{
@@ -0,0 +1,7 @@
1
+ module Arel
2
+ module Nodes
3
+ class Grouping < Unary
4
+ include Arel::Predications
5
+ end
6
+ end
7
+ end
@@ -14,6 +14,18 @@ module Arel
14
14
  @columns = @columns.clone
15
15
  @values = @values.clone if @values
16
16
  end
17
+
18
+ def hash
19
+ [@relation, @columns, @values].hash
20
+ end
21
+
22
+ def eql? other
23
+ self.class == other.class &&
24
+ self.relation == other.relation &&
25
+ self.columns == other.columns &&
26
+ self.values == other.values
27
+ end
28
+ alias :== :eql?
17
29
  end
18
30
  end
19
31
  end
@@ -7,6 +7,15 @@ module Arel
7
7
  super(expr, aliaz)
8
8
  @name = name
9
9
  end
10
+
11
+ def hash
12
+ super ^ @name.hash
13
+ end
14
+
15
+ def eql? other
16
+ super && self.name == other.name
17
+ end
18
+ alias :== :eql?
10
19
  end
11
20
  end
12
21
  end
@@ -37,6 +37,26 @@ module Arel
37
37
  @having = @having.clone if @having
38
38
  @windows = @windows.clone
39
39
  end
40
+
41
+ def hash
42
+ [
43
+ @source, @top, @set_quantifier, @projections,
44
+ @wheres, @groups, @having, @windows
45
+ ].hash
46
+ end
47
+
48
+ def eql? other
49
+ self.class == other.class &&
50
+ self.source == other.source &&
51
+ self.top == other.top &&
52
+ self.set_quantifier == other.set_quantifier &&
53
+ self.projections == other.projections &&
54
+ self.wheres == other.wheres &&
55
+ self.groups == other.groups &&
56
+ self.having == other.having &&
57
+ self.windows == other.windows
58
+ end
59
+ alias :== :eql?
40
60
  end
41
61
  end
42
62
  end
@@ -5,7 +5,6 @@ module Arel
5
5
  attr_accessor :limit, :orders, :lock, :offset, :with
6
6
 
7
7
  def initialize cores = [SelectCore.new]
8
- #puts caller
9
8
  @cores = cores
10
9
  @orders = []
11
10
  @limit = nil
@@ -19,6 +18,21 @@ module Arel
19
18
  @cores = @cores.map { |x| x.clone }
20
19
  @orders = @orders.map { |x| x.clone }
21
20
  end
21
+
22
+ def hash
23
+ [@cores, @orders, @limit, @lock, @offset, @with].hash
24
+ end
25
+
26
+ def eql? other
27
+ self.class == other.class &&
28
+ self.cores == other.cores &&
29
+ self.orders == other.orders &&
30
+ self.limit == other.limit &&
31
+ self.lock == other.lock &&
32
+ self.offset == other.offset &&
33
+ self.with == other.with
34
+ end
35
+ alias :== :eql?
22
36
  end
23
37
  end
24
38
  end