<!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>
· <a href="http://defunkt.github.com/ambition/adapters.html"><span class="a">a</span>dapters</a>
· <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">
>> LDAP::User.select { |m| m.name == 'jon' && m.age == 21 }.to_s
=> "(&(name=jon)(age=21))"
>> SQL::User.select { |m| m.name == 'jon' && m.age == 21 }.to_s
=> "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’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’ve got a hoppin’ 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
>> require 'rubygems'
>> 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’ 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>