ambition 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +7 -2
- data/Rakefile +1 -1
- data/lib/ambition/processor.rb +8 -8
- metadata +2 -2
data/README
CHANGED
@@ -9,7 +9,7 @@ but instead I'm just going to show you some examples.
|
|
9
9
|
The goal is this: write once, run with ActiveRecord, Sequel, DataMapper,
|
10
10
|
whatever. Kind of like Rack for databases.
|
11
11
|
|
12
|
-
== Git It (
|
12
|
+
== Git It (with Git, even)
|
13
13
|
|
14
14
|
$ sudo gem install ambition -y
|
15
15
|
|
@@ -24,6 +24,10 @@ To use with Rails, after installing the gem:
|
|
24
24
|
|
25
25
|
RDoc exists: http://rock.errtheblog.com/ambition
|
26
26
|
|
27
|
+
Have at the Git repo:
|
28
|
+
|
29
|
+
$ git clone git://errtheblog.com/git/ambition
|
30
|
+
|
27
31
|
== Examples
|
28
32
|
|
29
33
|
Basically, you write your SQL in Ruby. No, not in Ruby. As Ruby.
|
@@ -199,7 +203,8 @@ possible.
|
|
199
203
|
|
200
204
|
== SELECT * FROM bugs
|
201
205
|
|
202
|
-
Found a bug? Sweet. Add it at the Lighthouse:
|
206
|
+
Found a bug? Sweet. Add it at the Lighthouse:
|
207
|
+
http://err.lighthouseapp.com/projects/466-plugins/tickets/new
|
203
208
|
|
204
209
|
Feature requests are welcome.
|
205
210
|
|
data/Rakefile
CHANGED
data/lib/ambition/processor.rb
CHANGED
@@ -1,19 +1,14 @@
|
|
1
1
|
require 'active_record/connection_adapters/abstract/quoting'
|
2
2
|
|
3
3
|
module Ambition
|
4
|
-
class Processor
|
4
|
+
class Processor
|
5
5
|
include ActiveRecord::ConnectionAdapters::Quoting
|
6
6
|
|
7
7
|
attr_reader :key, :join_string, :prefix, :includes
|
8
8
|
|
9
9
|
def initialize
|
10
|
-
|
11
|
-
@
|
12
|
-
@expected = String
|
13
|
-
@auto_shift_type = true
|
14
|
-
@warn_on_default = false
|
15
|
-
@default_method = :process_error
|
16
|
-
@includes = []
|
10
|
+
@unsupported = [:alloca, :cfunc, :cref, :evstr, :ifunc, :last, :memo, :newline, :opt_n, :method] # internal nodes that you can't get to
|
11
|
+
@includes = []
|
17
12
|
end
|
18
13
|
|
19
14
|
##
|
@@ -92,5 +87,10 @@ module Ambition
|
|
92
87
|
raise "No reflection `#{receiver.last}' found on #{@owner}"
|
93
88
|
end
|
94
89
|
end
|
90
|
+
|
91
|
+
def process(node)
|
92
|
+
node ||= []
|
93
|
+
respond_to?(method = "process_#{node.shift}") ? send(method, node) : ''
|
94
|
+
end
|
95
95
|
end
|
96
96
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ambition
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-09-
|
6
|
+
version: 0.2.0
|
7
|
+
date: 2007-09-04 00:00:00 -07:00
|
8
8
|
summary: Ambition builds SQL from plain jane Ruby.
|
9
9
|
require_paths:
|
10
10
|
- lib
|