defunkt / ambition

include Enumerable

This URL has Read+Write access

ambition / index.html
100644 125 lines (79 sloc) 4.295 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Ruby's Ambition</title>
  <link href="http://defunkt.github.com/ambition/static/hubris.css" media="screen" rel="Stylesheet" type="text/css" />
  <script src="http://defunkt.github.com/ambition/static/code_highlighter.js" type="text/javascript"></script>
  <script src="http://defunkt.github.com/ambition/static/ruby.js" type="text/javascript"></script>
</head>
 
<body>
  <div id="main">
    <div id="header">
      <h1><span class="a">A</span>mbition</h1>
      <div id="nav">
        <a href="http://defunkt.github.com/ambition/"><span class="a">o</span>verview</a>
        &#183; <a href="http://defunkt.github.com/ambition/adapters.html"><span class="a">a</span>dapters</a>
        &#183; <a href="http://defunkt.github.com/ambition/api.html"><span class="a">a</span>pi</a>
      </div>
    </div>
 
    <div id="body">
      <h2>Plain Jane Ruby</h2>
 
 
<p>Imagine if instead of writing <span class="caps">SQL</span>, you could write Ruby. Instead of writing <span class="caps">LDAP</span>, you
could write Ruby. Instead of learning some esoteric <span class="caps">API</span>, you just stick to one you know
and love.</p>
 
 
<p>Imagine <strong>A</strong>mbition.</p>
 
 
<pre class="ruby">
&gt;&gt; LDAP::User.select { |m| m.name == 'jon' &#38;&#38; m.age == 21 }.to_s
=&gt; "(&#38;(name=jon)(age=21))"
 
&gt;&gt; SQL::User.select { |m| m.name == 'jon' &#38;&#38; m.age == 21 }.to_s
=&gt; "SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21"
</pre>
 
<p>It <a href="http://errtheblog.com/post/10722">started</a> with <span class="caps">SQL</span>, but it&#8217;s become so much more.</p>
 
 
<h2>The Elevator Pitch</h2>
 
 
<p>Ambition is a framework for writing adapters. Adapters are RubyGems which depend on the
<code>ambition</code> gem and are named something along the lines of <code>ambitious-activerecord</code>. They typically
use Ambition to turn plain jane Ruby into some sort of domain specific query which can be executed.</p>
 
 
<p>Anyone can write and release an adapter. This site describes how to write adapters using
Ambition and also hosts a few.</p>
 
 
<h2>The Community</h2>
 
 
<p>We&#8217;ve got a hoppin&#8217; community over at the <a href="http://groups.google.com/group/ambition-rb">Google Group</a>. Feel
free to jump in with any questions, ideas, or top 5 favorite bands discussions.</p>
 
 
<p>The initial blog posts were <a href="http://errtheblog.com/post/10722">this</a> and <a href="http://errtheblog.com/post/11998">that</a>.
Most of what they describe has become the <code>ambitious-activerecord</code> gem.</p>
 
 
<h2>Ambitious Adapters</h2>
 
 
<p>Adapters are gems named <code>ambitious-something</code>, where <em>something</em> corresponds to the data
store they are adapting. They can be required in code via <code>ambition/adapters/something</code>.</p>
 
 
<p>To install and test the ActiveRecord adapter:</p>
 
 
<pre>
$ gem install ambitious-activerecord
$ irb
&gt;&gt; require 'rubygems'
&gt;&gt; require 'ambition/adapters/active_record'
</pre>
 
<p>Adapters typically inject themselves into their target automatically, so that should be
all you need.</p>
 
 
<p>There are a few adapters in development or released currently:</p>
 
 
<ul>
<li><a href="adapters/activerecord.html">ActiveRecord</a></li>
<li>ActiveLDAP</li>
<li>Facebook</li>
<li>XPath</li>
<li>CouchDB</li>
<li>DataMapper</li>
</ul>
 
 
<p>For information on authoring adapters, hit up the <a href="adapters.html">adapters</a> page.</p>
 
 
<h2>Development</h2>
 
 
<p>Development discussion happens in the <a href="http://groups.google.com/group/ambition-rb">Google Group</a>.
Stay up to date by following Chris&#8217; git repository:</p>
 
 
<p><code>git clone git://github.com/defunkt/ambition</code></p>
    </div>
 
    <div id="footer">
      <a href="" target="_top">back to top</a>
      | <a href="http://rubyforge.org/projects/ambition/">rubyforge</a>
      | <a href="http://groups.google.com/group/ambition-rb/">the list</a>
    </div>
  </div>
</body>
</html>