arel 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/arel.gemspec +8 -5
- data/lib/arel.rb +1 -1
- data/lib/arel/nodes/node.rb +1 -1
- data/lib/arel/nodes/sql_literal.rb +3 -0
- data/lib/arel/visitors/depth_first.rb +1 -0
- data/lib/arel/visitors/dot.rb +1 -0
- data/lib/arel/visitors/oracle.rb +1 -2
- data/lib/arel/visitors/to_sql.rb +1 -0
- data/test/nodes/test_node.rb +1 -0
- data/test/visitors/test_oracle.rb +1 -2
- data/test/visitors/test_to_sql.rb +6 -0
- metadata +19 -8
data/arel.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "arel"
|
5
|
-
s.version = "3.0.
|
5
|
+
s.version = "3.0.1.20120220180444"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Aaron Patterson", "Bryan Halmkamp", "Emilio Tagua", "Nick Kallen"]
|
9
|
-
s.date = "2012-
|
9
|
+
s.date = "2012-02-21"
|
10
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."
|
11
11
|
s.email = ["aaron@tenderlovemaking.com", "bryan@brynary.com", "miloops@gmail.com", "nick@example.org"]
|
12
12
|
s.extra_rdoc_files = ["History.txt", "MIT-LICENSE.txt", "Manifest.txt", "README.markdown"]
|
@@ -23,14 +23,17 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.specification_version = 3
|
24
24
|
|
25
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
-
s.add_development_dependency(%q<
|
26
|
+
s.add_development_dependency(%q<minitest>, ["~> 2.11"])
|
27
27
|
s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
|
28
|
+
s.add_development_dependency(%q<hoe>, ["~> 2.13"])
|
28
29
|
else
|
29
|
-
s.add_dependency(%q<
|
30
|
+
s.add_dependency(%q<minitest>, ["~> 2.11"])
|
30
31
|
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
32
|
+
s.add_dependency(%q<hoe>, ["~> 2.13"])
|
31
33
|
end
|
32
34
|
else
|
33
|
-
s.add_dependency(%q<
|
35
|
+
s.add_dependency(%q<minitest>, ["~> 2.11"])
|
34
36
|
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
37
|
+
s.add_dependency(%q<hoe>, ["~> 2.13"])
|
35
38
|
end
|
36
39
|
end
|
data/lib/arel.rb
CHANGED
data/lib/arel/nodes/node.rb
CHANGED
@@ -109,6 +109,7 @@ module Arel
|
|
109
109
|
alias :visit_Arel_Nodes_Lock :terminal
|
110
110
|
alias :visit_Arel_Nodes_Node :terminal
|
111
111
|
alias :visit_Arel_Nodes_SqlLiteral :terminal
|
112
|
+
alias :visit_Arel_Nodes_BindParam :terminal
|
112
113
|
alias :visit_Arel_SqlLiteral :terminal
|
113
114
|
alias :visit_BigDecimal :terminal
|
114
115
|
alias :visit_Bignum :terminal
|
data/lib/arel/visitors/dot.rb
CHANGED
data/lib/arel/visitors/oracle.rb
CHANGED
@@ -25,9 +25,8 @@ module Arel
|
|
25
25
|
SELECT * FROM (
|
26
26
|
SELECT raw_sql_.*, rownum raw_rnum_
|
27
27
|
FROM (#{sql}) raw_sql_
|
28
|
-
WHERE rownum <= #{offset.expr.to_i + limit}
|
29
28
|
)
|
30
|
-
WHERE #{
|
29
|
+
WHERE raw_rnum_ between #{offset.expr.to_i + 1 } and #{offset.expr.to_i + limit}
|
31
30
|
eosql
|
32
31
|
end
|
33
32
|
|
data/lib/arel/visitors/to_sql.rb
CHANGED
@@ -374,6 +374,7 @@ key on UpdateManager using UpdateManager#key=
|
|
374
374
|
|
375
375
|
def literal o; o end
|
376
376
|
|
377
|
+
alias :visit_Arel_Nodes_BindParam :literal
|
377
378
|
alias :visit_Arel_Nodes_SqlLiteral :literal
|
378
379
|
alias :visit_Arel_SqlLiteral :literal # This is deprecated
|
379
380
|
alias :visit_Bignum :literal
|
data/test/nodes/test_node.rb
CHANGED
@@ -9,6 +9,12 @@ module Arel
|
|
9
9
|
@attr = @table[:id]
|
10
10
|
end
|
11
11
|
|
12
|
+
it 'works with BindParams' do
|
13
|
+
node = Nodes::BindParam.new 'omg'
|
14
|
+
sql = @visitor.accept node
|
15
|
+
sql.must_be_like 'omg'
|
16
|
+
end
|
17
|
+
|
12
18
|
it 'can define a dispatch method' do
|
13
19
|
visited = false
|
14
20
|
viz = Class.new(Arel::Visitors::Visitor) {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,22 +12,22 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-
|
15
|
+
date: 2012-02-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
|
-
name:
|
19
|
-
requirement: &
|
18
|
+
name: minitest
|
19
|
+
requirement: &70143007281780 !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ~>
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: '2.
|
24
|
+
version: '2.11'
|
25
25
|
type: :development
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70143007281780
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rdoc
|
30
|
-
requirement: &
|
30
|
+
requirement: &70143007268400 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
@@ -35,7 +35,18 @@ dependencies:
|
|
35
35
|
version: '3.10'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70143007268400
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: hoe
|
41
|
+
requirement: &70143007266480 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.13'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: *70143007266480
|
39
50
|
description: ! 'Arel is a SQL AST manager for Ruby. It
|
40
51
|
|
41
52
|
|