<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>dm-gvideo-adapter.gemspec</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,11 +4,23 @@ dm-gvideo-adapter
 # dependencies
 Gvideo: http://github.com/mattetti/gvideo
 
+install the dependency:
+  
+  $ sudo gem install mattetti-gvideo
+  
+install this adapter
+
+  $ sudo gem install mattetti-dm-gvideo-adapter
+  
+
 Usage:
 
 # URI:
 googlevideo://A005148908335059515423 # google video user id
 
+(or you can set the user_id in your database.yml)
+
+
 Video.all # returns all the user's videos
 Video.get(&quot;-2838281997424715962&quot;)
 Video.first(:title =&gt; &quot;The Illuminati - Secret societies&quot;)</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'rubygems/specification'
 require 'date'
 
 GEM = &quot;dm-gvideo-adapter&quot;
-GEM_VERSION = &quot;0.0.1&quot;
+GEM_VERSION = &quot;1.0.0&quot;
 AUTHOR = &quot;Matt Aimonetti&quot;
 EMAIL = &quot;mattaimonetti@gmail.com&quot;
 HOMEPAGE = &quot;http://merbist.com&quot;
@@ -23,7 +23,7 @@ spec = Gem::Specification.new do |s|
   s.homepage = HOMEPAGE
   
   # Uncomment this to add a dependency
-  # s.add_dependency &quot;foo&quot;
+  # s.add_dependency &quot;gvideo&quot;
   
   s.require_path = 'lib'
   s.autorequire = GEM</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -55,7 +55,7 @@ module DataMapper
           end
 
           # This is the core logic that handles the difference between all/first
-          (results || []).each do |result|
+          results.each do |result|
             props = props_from_result(properties_with_indexes, result, repository)
             arr ? set.load(props) : (break set.load(props, query))
           end</diff>
      <filename>lib/dm-gvideo-adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,53 +32,63 @@ describe &quot;dm-gvideo-adapter&quot; do
       @videos.length.should == @gvideos.length
     end
     
-    it &quot;should be able to retrieve itams using a title (string) condition&quot; do
-      videos = @videos.all(:title =&gt; &quot;Durex: The Garden&quot;)
+    it &quot;should be able to retrieve items using a title (string) condition&quot; do
+      videos = Video.all(:title =&gt; &quot;Durex: The Garden&quot;)
       videos.length.should == 1
       videos.first.title.should == &quot;Durex: The Garden&quot;
     end
     
     it &quot;should be able to retrieve items using a title (regexp) condition&quot; do
-      videos = @videos.all(:title.like =&gt; &quot;The Garden&quot;)
+      videos = Video.all(:title.like =&gt; &quot;The Garden&quot;)
       videos.length.should == 1
       videos.first.title.should == &quot;Durex: The Garden&quot;
     end
     
     it &quot;should be able to retrieve items using a duration (integer) condition (seconds)&quot; do
-      videos = @videos.all(:duration =&gt; 12)
+      videos = Video.all(:duration =&gt; 12)
       videos.length.should == 2
     end
     
     it &quot;should be able to retrieve items using a duration condition :gte &quot; do
-      videos = @videos.all(:duration.gte =&gt; 13)
+      videos = Video.all(:duration.gte =&gt; 13)
       videos.length.should &lt; @gvideos.length
     end
     
     it &quot;should be able to retrieve items using a duration condition :lte &quot; do
-      videos = @videos.all(:duration.lte =&gt; 12)
+      videos = Video.all(:duration.lte =&gt; 12)
       videos.length.should &lt; @gvideos.length
       (@videos.all(:duration.gte =&gt; 13).length + @videos.all(:duration.lte =&gt; 12).length).should == @gvideos.length
     end
     
     it &quot;should be able to use 2 duration conditions&quot; do
-      videos = @videos.all(:duration.lte =&gt; 12, :duration.gte =&gt; 12)
+      videos = Video.all(:duration.lte =&gt; 12, :duration.gte =&gt; 12)
       videos.length.should == @videos.all(:duration =&gt; 12).length
     end
     
   end
   
   describe &quot;getting one resource&quot; do
-    before(:all) do
-      @video = Video.first
-    end
     
     it &quot;should have all the attributes of a video&quot; do
+      video = Video.first
       methods = %W{docid title video_url duration duration_in_minutes thumbnail_url embed_player}
       methods.each do |meth|
-        @video.send(meth.to_sym).should_not be_nil
+        video.send(meth.to_sym).should_not be_nil
       end
     end
     
+    it &quot;should be able to retrieve an item using a title (string) condition&quot; do
+      video = Video.first(:title =&gt; &quot;Durex: The Garden&quot;)
+      video.should be_an_instance_of(Video)
+      video.title.should == &quot;Durex: The Garden&quot;
+    end
+    
+    it &quot;should be able to retrieve items using a title (regexp) condition&quot; do
+      video = Video.first(:title.like =&gt; &quot;The Garden&quot;)
+      video.should be_an_instance_of(Video)
+      video.title.should == &quot;Durex: The Garden&quot;
+    end
+    
   end
   
   </diff>
      <filename>spec/dm-gvideo-adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,5 +19,40 @@ class Video
   property :thumbnail_url, String
   property :embed_player, String
   
+  ##
+  # Simulates Array#first by returning the first entry (when
+  # there are no arguments), or transforms the collection's query
+  # by applying :limit =&gt; n when you supply an Integer. If you
+  # provide a conditions hash, or a Query object, the internal
+  # query is scoped and a new collection is returned
+  #
+  # @param [Integer, Hash[Symbol, Object], Query] args
+  #
+  # @return [DataMapper::Resource, DataMapper::Collection] The
+  # first resource in the entries of this collection, or
+  # a new collection whose query has been merged
+  #
+  # @api public
+  def first(*args)
+    
+    # # TODO: this shouldn't be a kicker if scoped_query() is called
+    # if loaded?
+    #   if args.empty?
+    #     return super
+    #   elsif args.size == 1 &amp;&amp; args.first.kind_of?(Integer)
+    #     limit = args.shift
+    #     return self.class.new(scoped_query(:limit =&gt; limit)) { |c| c.replace(super(limit)) }
+    #   end
+    # end
+    # 
+    # query = args.last.respond_to?(:merge) ? args.pop : {}
+    # query = scoped_query(query.merge(:limit =&gt; args.first || 1))
+    # 
+    # if args.any?
+    #   query.repository.read_many(query)
+    # else
+    #   query.repository.read_one(query)
+    # end
+  end
   
 end
\ No newline at end of file</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4badb2eda33906e646bab75f6b062e31840ff770</id>
    </parent>
  </parents>
  <author>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </author>
  <url>http://github.com/mattetti/dm-gvideo-adapter/commit/046afc2fea3f3eae26751b687871d23f3e62a39f</url>
  <id>046afc2fea3f3eae26751b687871d23f3e62a39f</id>
  <committed-date>2008-09-28T23:43:14-07:00</committed-date>
  <authored-date>2008-09-28T23:43:14-07:00</authored-date>
  <message>ready for a first release</message>
  <tree>4bd1fefb329be83b416d5da75c000afd9d17642a</tree>
  <committer>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </committer>
</commit>
