<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE</filename>
    </added>
    <added>
      <filename>adapters/ambitious_activerecord/LICENSE</filename>
    </added>
    <added>
      <filename>adapters/ambitious_activerecord/README</filename>
    </added>
    <added>
      <filename>app_generators/ambition_adapter/templates/LICENSE</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -23,6 +23,7 @@ lib/ambition/processors/select.rb
 lib/ambition/processors/slice.rb
 lib/ambition/processors/sort.rb
 lib/ambition.rb
+LICENSE
 Manifest
 README
 test/adapters/exemplar/association_test.rb</diff>
      <filename>Manifest</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,7 @@ class AmbitionAdapterGenerator &lt; RubiGen::Base
 
       ##
       # Normal files
-      files = %w( README Rakefile )
+      files = %w( LICENSE README Rakefile )
       files.each do |file|
         m.template file, file
       end</diff>
      <filename>app_generators/ambition_adapter/ambition_adapter_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,7 @@ task :build do
     live_file = &quot;live/#{file_name}&quot;
 
     unless uptodate?(live_file, file) &amp;&amp; uptodate?(live_file, &quot;src/layout.textile&quot;)
-      File.new(live_file, 'w') { |f| f.puts(compile(file)); f.flush }
+      File.open(live_file, 'w') { |f| f.puts(compile(file)); f.flush }
       puts &quot;created #{live_file}&quot;
       cp file, 'live/textile/' + file.split('/').last.sub('.textile', '.txt')
     end</diff>
      <filename>site/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,234 @@
-Hi.
+h2. An Ambitious ActiveRecord Adapter
+
+I could tell you all about how awesome the internals are, or 
+how fun it was to write, or how it'll make you rich and famous, 
+but instead I'm just going to show you some examples. 
+
+h2. Get It 
+
+@$ sudo gem install ambitious-activerecord@
+
+This will suck in the adapter and its dependencies (ActiveRecord &amp; Ambition). 
+It's fully usable outside of Rails (I use it in a Camping app or two), as long
+as you're riding ActiveRecord.
+
+To use with Rails, after installing the gem:
+  
+&lt;pre&gt;
+$ cd vendor/plugins
+$ gem unpack ambitious-activerecord
+&lt;/pre&gt;
+
+h2. Examples
+
+Basically, you write your SQL in Ruby.  No, not in Ruby.  As Ruby.
+
+&lt;ruby&gt;
+User.select { |u| u.city == 'San Francisco' }.each do |user|
+  puts user.name
+end
+&lt;/ruby&gt;
+
+And that's it.
+
+The key is that queries aren't actually run until the data they represent is 
+requested. Usually this is done with what I call a kicker method. You can call them 
+that, too.
+
+Kicker methods are guys like @detect@, @each@, @each_with_index@, @map@, @entries@, 
+@to_a@, and @first@ (with no argument). Methods like @select@, @sort_by@, and @first@ 
+(with an argument) are not kicker methods and return a @Context@ object without running any SQL.
+
+Our @Context@ object has two useful methods: @to_s@ and @to_hash@.  With these,
+we can check out what exactly we're building.  Not everyone has @to_s@,
+though.  Mostly ignore these methods and treat everything like you normally
+would.
+
+See, @to_s@:
+
+&lt;ruby&gt;
+&gt;&gt; User.select { |m| m.name == 'jon' }.to_s
+=&gt; &quot;SELECT * FROM users WHERE users.name = 'jon'&quot;
+&lt;/ruby&gt;
+
+See, @to_hash@:
+
+&lt;ruby&gt;
+&gt;&gt; User.select { |m| m.name == 'jon' }.to_hash
+=&gt; { :conditions =&gt; &quot;users.name = 'jon'&quot; }
+&lt;/ruby&gt;
+
+h2. Equality - select { |u| u.field == 'bob' }
+
+&lt;ruby&gt;
+User.select { |m| m.name == 'jon' }
+&quot;SELECT * FROM users WHERE users.name = 'jon'&quot;
+
+User.select { |m| m.created_at &gt; 2.days.ago }
+&quot;SELECT * FROM users WHERE users.created_at &gt; '2007-09-26 20:37:47'&quot;
+
+User.select { |m| m.name == 'jon' }
+&quot;SELECT * FROM users WHERE users.name = 'jon'&quot;
+
+User.select { |m| m.name != 'jon' }
+&quot;SELECT * FROM users WHERE users.name &lt;&gt; 'jon'&quot;
+
+User.select { |m| m.name == 'jon' &amp;&amp; m.age == 21 }
+&quot;SELECT * FROM users WHERE (users.name = 'jon' AND users.age = 21)&quot;
+
+User.select { |m| m.name == 'jon' || m.age == 21 }
+&quot;SELECT * FROM users WHERE (users.name = 'jon' OR users.age = 21)&quot;
+  
+User.select { |m| m.name == 'jon' || m.age == 21 &amp;&amp; m.password == 'pass' }
+&quot;SELECT * FROM users WHERE 
+ (users.name = 'jon' OR (users.age = 21 AND users.password = 'pass'))&quot;
+
+User.select { |m| (m.name == 'jon' || m.name == 'rick') &amp;&amp; m.age == 21 }
+&quot;SELECT * FROM users WHERE 
+ ((users.name = 'jon' OR users.name = 'rick') AND users.age = 21)&quot;
+&lt;/ruby&gt;
+  
+h2. Associations - select { |u| u.field == 'bob' &amp;&amp; u.association.field == 'bob@bob.com' }
+
+The @to_s@ method doesn't work on associations yet, but that's okay: they can 
+still query through ActiveRecord just fine.
+
+&lt;ruby&gt;
+User.select do |u| 
+  u.email == 'chris@ozmm.org' &amp;&amp; u.profile.name == 'chris wanstrath' 
+end.map(&amp;:title)
+
+&quot;SELECT users.id AS t0_r0, ... FROM users 
+ LEFT OUTER JOIN profiles ON profiles.user_id = users.id 
+ WHERE ((users.email = 'chris@ozmm.org' AND profiles.name = 'chris wanstrath'))&quot;
+&lt;/ruby&gt;
+
+h2. Comparisons - select { |u| u.age &gt; 21 }
+
+&lt;ruby&gt;
+User.select { |m| m.age &gt; 21 }
+&quot;SELECT * FROM users WHERE users.age &gt; 21&quot;
+
+User.select { |m| m.age &lt; 21 }.to_s
+&quot;SELECT * FROM users WHERE users.age &lt; 21&quot;
+
+User.select { |m| [1, 2, 3, 4].include? m.id }
+&quot;SELECT * FROM users WHERE users.id IN (1, 2, 3, 4)&quot;
+&lt;/ruby&gt;
+
+h2. LIKE and REGEXP (RLIKE) - select { |m| m.name =~ 'chris' }
+
+&lt;ruby&gt;
+User.select { |m| m.name =~ 'chris' }
+&quot;SELECT * FROM users WHERE users.name LIKE 'chris'&quot;
+
+User.select { |m| m.name =~ 'chri%' }
+&quot;SELECT * FROM users WHERE users.name LIKE 'chri%'&quot;
+
+User.select { |m| m.name !~ 'chris' }
+&quot;SELECT * FROM users WHERE users.name NOT LIKE 'chris'&quot;
+
+User.select { |m| !(m.name =~ 'chris') }
+&quot;SELECT * FROM users WHERE users.name NOT LIKE 'chris'&quot;
+
+User.select { |m| m.name =~ /chris/ }
+&quot;SELECT * FROM users WHERE users.name REGEXP 'chris'&quot;
+&lt;/ruby&gt;
+
+h2. #detect
+
+&lt;ruby&gt;
+User.detect { |m| m.name == 'chris' }
+&quot;SELECT * FROM users WHERE users.name = 'chris' LIMIT 1&quot;
+&lt;/ruby&gt;
+
+h2. LIMITs - first, first(x), [offset, limit], [range], slice
+
+&lt;ruby&gt;
+User.select { |m| m.name == 'jon' }.first
+&quot;SELECT * FROM users WHERE users.name = 'jon' LIMIT 1&quot;
+
+User.select { |m| m.name == 'jon' }.first(5)
+&quot;SELECT * FROM users WHERE users.name = 'jon' LIMIT 5&quot;
+
+User.select { |m| m.name == 'jon' }[10, 20]
+&quot;SELECT * FROM users WHERE users.name = 'jon' LIMIT 10, 20&quot;
+
+User.select { |m| m.name == 'jon' }[10..20]
+&quot;SELECT * FROM users WHERE users.name = 'jon' LIMIT 10, 10&quot;
+&lt;/ruby&gt;
+
+h2. ORDER - sort_by { |u| u.field }
+
+&lt;ruby&gt;
+User.select { |m| m.name == 'jon' }.sort_by { |m| m.name }
+&quot;SELECT * FROM users WHERE users.name = 'jon' ORDER BY users.name&quot;
+
+User.select { |m| m.name == 'jon' }.sort_by { |m| [ m.name,  m.age ] }
+&quot;SELECT * FROM users WHERE users.name = 'jon' ORDER BY users.name, users.age&quot;
+
+User.select { |m| m.name == 'jon' }.sort_by { |m| [ m.name,  -m.age ] }
+&quot;SELECT * FROM users WHERE users.name = 'jon' 
+ ORDER BY users.name, users.age DESC&quot;
+
+User.select { |m| m.name == 'jon' }.sort_by { |m| [ -m.name,  -m.age ] }
+&quot;SELECT * FROM users WHERE users.name = 'jon' 
+ ORDER BY users.name DESC, users.age DESC&quot;
+
+User.select { |m| m.name == 'jon' }.sort_by { |m| -m.age }
+&quot;SELECT * FROM users WHERE users.name = 'jon' ORDER BY users.age DESC&quot;
+
+User.select { |m| m.name == 'jon' }.sort_by { |m| -m.profiles.title }
+&quot;SELECT users.id AS t0_r0, ... FROM users 
+ LEFT OUTER JOIN profiles ON profiles.user_id = users.id 
+ WHERE (users.name = 'jon') ORDER BY profiles.title DESC&quot;
+
+User.select { |m| m.name == 'jon' }.sort_by { rand }
+&quot;SELECT * FROM users WHERE users.name = 'jon' ORDER BY RAND()&quot;
+&lt;/ruby&gt;
+
+h2. COUNT - select { |u| u.name == 'jon' }.size
+
+&lt;ruby&gt;
+User.select { |m| m.name == 'jon' }.size
+&quot;SELECT count(*) AS count_all FROM users WHERE (users.name = 'jon')&quot;
+
+&gt;&gt; User.select { |m| m.name == 'jon' }.size
+=&gt; 21
+&lt;/ruby&gt;
+
+h2. Other Enumerables
+
+These methods perform COUNT() operations rather than loading your array into memory.  They're all 
+kickers.
+  
+&lt;ruby&gt;  
+User.any? { |m| m.name == 'jon' }
+User.all? { |m| m.name == 'jon' }
+User.select { |m| m.name == 'jon' }.empty?
+&lt;/ruby&gt;
+
+h2. More Sugar
+
+The @downcase@ and @upcase@ methods will map to LOWER() and UPPER(), respectively.
+
+&lt;ruby&gt;
+&gt;&gt; User.select { |m| m.name.downcase =~ 'jon%' }.to_s
+=&gt; &quot;SELECT * FROM users WHERE LOWER(users.name) LIKE 'jon%'&quot;
+&lt;/ruby&gt;
+
+h2. Quoting
+
+Columns and values will be quoted using ActiveRecord's quote_column_name and quote methods, if
+possible.
+
+h2. SELECT * FROM bugs 
+
+Found a bug?  Sweet.  Add it at &quot;the Lighthouse&quot;:http://err.lighthouseapp.com/projects/466-plugins/tickets/new.
+
+More information on Ambition:
+
+  * &quot;http://ambition.rubyforge.org&quot;:http://ambition.rubyforge.org
+  * &quot;http://groups.google.com/group/ambition-rb/&quot;:http://groups.google.com/group/ambition-rb/
+
+- Chris Wanstrath [ chris@ozmm.org ]
\ No newline at end of file</diff>
      <filename>site/src/adapters/activerecord.textile</filename>
    </modified>
    <modified>
      <diff>@@ -113,9 +113,7 @@ pre {
 .ruby .brackets {	
   color: #777;
 }
-.ruby .symbol { 
-  color: #00fb79;
-}
+
 .ruby .regex { 
   color: #37ffff;
 }</diff>
      <filename>site/src/static/hubris.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>189244070fd4dca0fa36a0e6c8745814ccd603e8</id>
    </parent>
  </parents>
  <author>
    <name>Chris Wanstrath</name>
    <email>chris@ozmm.org</email>
  </author>
  <url>http://github.com/defunkt/ambition/commit/42b276419222e6fa372da1f6fc50ec9a6f348f01</url>
  <id>42b276419222e6fa372da1f6fc50ec9a6f348f01</id>
  <committed-date>2007-11-28T19:01:44-08:00</committed-date>
  <authored-date>2007-11-28T19:01:44-08:00</authored-date>
  <message>license and readme stuff</message>
  <tree>fc0d8a69cde541a1620f8ef965a9c1e13034305c</tree>
  <committer>
    <name>Chris Wanstrath</name>
    <email>chris@ozmm.org</email>
  </committer>
</commit>
