<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>History.txt</filename>
    </added>
    <added>
      <filename>Manifest.txt</filename>
    </added>
    <added>
      <filename>README.txt</filename>
    </added>
    <added>
      <filename>test/test_ruby-github.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1 +1,3 @@
-/pkg
\ No newline at end of file
+/pkg
+/doc
+.DS_Store
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,13 @@
+# -*- ruby -*-
+
 require 'rubygems'
-require 'rake/gempackagetask'
+require 'hoe'
+require './lib/ruby-github.rb'
 
-spec = Gem::Specification.new do |s| 
-  s.name = &quot;ruby-github&quot;
-  s.version = &quot;0.0.1&quot;
-  s.author = &quot;Michael Bleigh&quot;
-  s.email = &quot;michael@intridea.com&quot;
-  s.homepage = &quot;http://www.mbleigh.com/&quot;
-  s.platform = Gem::Platform::RUBY
-  s.summary = &quot;A simple Ruby library for accessing information through the GitHub API.&quot;
-  s.files = FileList[&quot;{spec,lib}/**/*&quot;].to_a
-  s.require_path = &quot;lib&quot;
-  s.has_rdoc = true
-  s.extra_rdoc_files = %w(README LICENSE)
-  s.add_dependency &quot;json&quot;
+Hoe.new('ruby-github', GitHub::VERSION) do |p|
+  p.developer('Michael Bleigh', 'michael@example.com')
+  p.remote_rdoc_dir = ''
+  p.extra_deps = [&quot;mash &gt;= 0.0.2&quot;, &quot;json&quot;]
 end
- 
-Rake::GemPackageTask.new(spec) do |pkg| 
-  pkg.need_tar = true 
-end 
+
+# vim: syntax=Ruby</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,81 +1,57 @@
 require 'rubygems'
 require 'json'
 require 'open-uri'
+require 'mash'
 
-class GitHub
-  def self.grab(user, repo=nil, branch=nil, commit=nil) #:nodoc:
-    url = &quot;http://github.com/api/v1/json/#{user}&quot;
-    
-    if repo
-      url += &quot;/#{repo}&quot;
-      url += commit ? &quot;/commit/#{commit}&quot; : &quot;/commits/#{branch}&quot;
-    end
-    
-    GitHub::Hash.new(JSON.parse(open(url).read),user,repo)
-  end
-  
-  # Fetches information about the specified user name.
-  def self.user(user)
-    self.grab(user).user
-  end
+module GitHub
+  VERSION = &quot;0.0.2&quot;
+  class API
+    BASE_URL = &quot;http://github.com/api/v1/json&quot;  
   
-  # Fetches the commits for a given repository.
-  def self.commits(user,repository,branch=&quot;master&quot;)
-    self.grab(user,repository,branch).commits
-  end
+    # Fetches information about the specified user name.
+    def self.user(user)
+      url = BASE_URL + &quot;/#{user}&quot;
+      GitHub::User.new(JSON.parse(open(url).read)[&quot;user&quot;])
+    end
   
-  # Fetches a single commit for a repository.
-  def self.commit(user,repository,commit)
-    self.grab(user,repository,nil,commit).commit
-  end
-end
-
-class GitHub::Hash &lt; Hash #:nodoc: all
-  def initialize(hash = nil, user = nil, repo = nil, obj = nil)
-    super(obj)
-    
-    @user = user
-    @repo = repo
-    
-    if hash &amp;&amp; hash.is_a?(Hash)
-      hash.each do |k,v| 
-        v = ::GitHub::Hash.new(v,user,repo,obj) if v.is_a?(Hash) &amp;&amp; !v.is_a?(::GitHub::Hash)
-        if v.is_a?(Array)
-          v = v.collect{|potential_hash|
-            potential_hash = ::GitHub::Hash.new(potential_hash,user,repo,obj) if potential_hash.is_a?(Hash) &amp;&amp; !potential_hash.is_a?(::GitHub::Hash)
-            potential_hash
-          }
-        end
-        self[k] = v
-      end
+    # Fetches the commits for a given repository.
+    def self.commits(user,repository,branch=&quot;master&quot;)
+      url = BASE_URL + &quot;/#{user}/#{repository}/commits/#{branch}&quot;
+      JSON.parse(open(url).read)[&quot;commits&quot;].collect{ |c| 
+        GitHub::Commit.new(c.merge(:user =&gt; user, :repository =&gt; repository))
+      }
     end
-  end
   
-  def id
-    self[&quot;id&quot;] ? self[&quot;id&quot;] : super
+    # Fetches a single commit for a repository.
+    def self.commit(user,repository,commit)
+      url = BASE_URL + &quot;/#{user}/#{repository}/commit/#{commit}&quot;
+      GitHub::Commit.new(JSON.parse(open(url).read).merge(:user =&gt; user, :repository =&gt; repository))
+    end
   end
   
-  def [](key)
-    key = key.to_s
-    super
+  class Repository &lt; Mash
+    def commits
+      ::GitHub::API.commits(user,name)
+    end
   end
   
-  def []=(key,value)
-    key = key.to_s
-    super
+  class User &lt; Mash
+    def initialize(hash = nil)
+      @user = hash[&quot;login&quot;] if hash
+      super
+    end
+    
+    def repositories=(repo_array)
+      puts self.inspect
+      self[&quot;repositories&quot;] = repo_array.collect{|r| ::GitHub::Repository.new(r.merge(:user =&gt; login || @user))}
+    end
   end
   
-  def method_missing(method_name, *args)
-    if (match = method_name.to_s.match(/(.*)=$/)) &amp;&amp; args.size == 1
-      self[match[1]] = args.first
-    elsif keys.include?(method_name.to_s)
-      self[method_name]
-    elsif method_name.to_s == &quot;commits&quot; &amp;&amp; self[&quot;name&quot;] &amp;&amp; self[&quot;url&quot;]
-      GitHub.commits(@user, name)
-    elsif method_name.to_s == &quot;detailed&quot; &amp;&amp; self[&quot;id&quot;] &amp;&amp; self[&quot;message&quot;]
-      GitHub.commit(@user,@repo,self[&quot;id&quot;])
-    else
-      super
+  class Commit &lt; Mash
+    # if a method only available to a detailed commit is called,
+    # automatically fetch it from the API
+    def detailed
+      ::GitHub::API.commit(user,repository,id)
     end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/ruby-github.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>LICENSE</filename>
    </removed>
    <removed>
      <filename>README</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>99d67633f3194d37bac4d95eb8eb7a716b9c320e</id>
    </parent>
  </parents>
  <author>
    <name>Michael Bleigh</name>
    <email>michael@intridea.com</email>
  </author>
  <url>http://github.com/mbleigh/ruby-github/commit/b95c073d78b08031a5e6292da83374a6aa0d97d3</url>
  <id>b95c073d78b08031a5e6292da83374a6aa0d97d3</id>
  <committed-date>2008-04-12T17:57:41-07:00</committed-date>
  <authored-date>2008-04-12T17:57:41-07:00</authored-date>
  <message>0.0.2 - Using Hoe, refactor to use Mash gem and much more structured data.</message>
  <tree>fdadc2c3b968e75124283c55eef6304a8c86a90c</tree>
  <committer>
    <name>Michael Bleigh</name>
    <email>michael@intridea.com</email>
  </committer>
</commit>
