Permalink
Browse files

reviewed all files. updated name to le git. updated README to include…

… laundry list of needed gems. got tests running (but failing).
  • Loading branch information...
1 parent 0f4ea3c commit edbfb1015e1a0227324d44c90261bfb055a80774 @croaky croaky committed May 26, 2009
View
@@ -1,2 +1,5 @@
tags
pkg
+*.swp
+*.swo
+.DS_Store
View
@@ -1,37 +0,0 @@
-# It's a GitHub party, and your invited!
-
-[GitHub](http://github.com) offers an API to some of its data. See [The GitHub API](http://github.com/guides/the-github-api) for details.
-
-github-party provides a Ruby wrapper around the API using [rest-client](http://rest-client.heroku.com/rdoc/) and [happymapper](http://happymapper.rubyforge.org/).
-
-Below is the [The GitHub API](http://github.com/guides/the-github-api), but using github-party:
-
-
- require 'rubygems'
- require 'github_party'
-
- # Grabbing all recent commits:
- commits = GitHub::Commit.find "caged", "gitnub", :all
-
- # Grabbing a single commit:
- commit = GitHub::Commit.find "defunkt", "github-gem", "c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b"
-
- # Repository search:
- repositories = GitHub::Repository.search "merb"
-
- # You can also grab a user’s info, including a list of his repositories:
- repository = GitHub::User.find "defunkt"
-
-## TODO
-
- * Commit
- * Committed/authored date. [HappyMapper needs to support dashes first](http://jnunemaker.lighthouseapp.com/projects/20014-happy-mapper/tickets/6-specifying-attributeselements-with-dashes-fails)
- * Added/modified/deleted files
- * Parent
- * Author/commiter
-
- * General
- * Try moving back to HTTParty
- * Most seem to support pagination
- * Connect the classes. For example, repository.commits should hit the GitHub::Commit API
-
View
@@ -0,0 +1,25 @@
+h1. Le Git
+
+bq. French for "Ruby wrapper around the Github API (v2)".
+
+Le Git provides a Ruby wrapper around the "The GitHub API":http://github.com/guides/the-github-api using "rest-client":http://rdoc.info/projects/adamwiggins/rest-client and "happymapper":http://rdoc.info/projects/jnunemaker/happymapper.
+
+h2. Example usage
+
+ require 'rubygems'
+ require 'le_git'
+
+ commits = GitHub::Commit.find "caged", "gitnub", :all
+
+ commit = GitHub::Commit.find "defunkt", "github-gem", "c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b"
+
+ repositories = GitHub::Repository.search "merb"
+
+ user = GitHub::User.find "defunkt"
+
+h2. Maintainers
+
+Running the test suite requires:
+
+ sudo gem install happymapper fakeweb rcov jeremymcanally-context jeremymcanally-matchy jeremymcanally-pending thoughtbot-quietbacktrace redgreen
+
View
@@ -6,12 +6,12 @@ require 'rcov/rcovtask'
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
- s.name = "github-party"
- s.summary = "TODO"
- s.email = "josh@technicalpickles.com"
- s.homepage = "http://github.com/technicalpickles/github-party/tree"
+ s.name = "le-git"
+ s.summary = "TODO"
+ s.email = "josh@technicalpickles.com"
+ s.homepage = "http://github.com/dancroak/le-git"
s.description = "TODO"
- s.authors = ["Josh Nichols"]
+ s.authors = ["Josh Nichols", "Dan Croak"]
s.add_dependency "rest-client"
s.add_dependency "happymapper"
end
@@ -40,4 +40,4 @@ Rcov::RcovTask.new do |t|
t.verbose = true
end
-task :default => :rcov
+task :default => :test
View
@@ -1,35 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{github-party}
- s.version = "0.1.0"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Josh Nichols"]
- s.date = %q{2009-01-20}
- s.description = %q{TODO}
- s.email = %q{josh@technicalpickles.com}
- s.files = ["README.markdown", "VERSION.yml", "lib/github_party", "lib/github_party/commit.rb", "lib/github_party/repository.rb", "lib/github_party/user.rb", "lib/github_party.rb", "test/fixtures", "test/fixtures/commit.xml", "test/fixtures/commits.xml", "test/fixtures/search.xml", "test/fixtures/user.xml", "test/github_commit_test.rb", "test/github_repository_test.rb", "test/github_user_test.rb", "test/test_helper.rb"]
- s.has_rdoc = true
- s.homepage = %q{http://github.com/technicalpickles/github-party/tree}
- s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.1}
- s.summary = %q{TODO}
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 2
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rest-client>, [">= 0"])
- s.add_runtime_dependency(%q<happymapper>, [">= 0"])
- else
- s.add_dependency(%q<rest-client>, [">= 0"])
- s.add_dependency(%q<happymapper>, [">= 0"])
- end
- else
- s.add_dependency(%q<rest-client>, [">= 0"])
- s.add_dependency(%q<happymapper>, [">= 0"])
- end
-end
View
@@ -1,8 +0,0 @@
-require 'rubygems'
-
-require 'happymapper'
-require 'rest_client'
-
-require 'github_party/repository'
-require 'github_party/user'
-require 'github_party/commit'
View
@@ -0,0 +1,8 @@
+require 'rubygems'
+
+require 'happymapper'
+require 'rest_client'
+
+require 'le_git/repository'
+require 'le_git/user'
+require 'le_git/commit'
@@ -4,10 +4,10 @@ class Commit
tag "commit"
- element :url, String
- element :tree, String
+ element :url, String
+ element :tree, String
element :message, String
- element :id, String
+ element :id, String
# Find commit(s) for a particular username/repository
#
@@ -39,7 +39,7 @@ def self.find(username, repository, hash_or_all)
end
protected
-
+
def self.find_all(username, repository)
xml = RestClient.get("http://github.com/api/v1/xml/#{username}/#{repository}/commits/master")
parse(xml)
@@ -48,8 +48,7 @@ def self.find_all(username, repository)
def self.find_by_hash(username, repository, hash)
xml = RestClient.get("http://github.com/api/v1/xml/#{username}/#{repository}/commit/#{hash}")
commits = parse(xml)
- commits.first # TODO assert size of commits
+ commits.first
end
end
-
end
File renamed without changes.
@@ -2,21 +2,21 @@ module GitHub
class User
include HappyMapper
- tag "user" # TODO report that namespaced classes fail here
+ tag "user"
element :company, String
element :name, String
element :blog, String
element :email, String
- element :location, String
+ element :location, String
element :login, String
has_many :repositories, Repository
def self.find(username)
xml = RestClient.get("http://github.com/api/v1/xml/#{username}")
users = parse(xml)
- users.first
+ users.first
end
end
end
Binary file not shown.
View
Binary file not shown.
@@ -1,7 +1,6 @@
require File.join(File.dirname(__FILE__), '/test_helper.rb')
class GitHubCommitTest < Test::Unit::TestCase
-
context "A single commit" do
setup do
FakeWeb.register_uri("http://github.com/api/v1/xml/defunkt/github-gem/commit/c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b", :response => File.join(File.dirname(__FILE__), 'fixtures', 'commit.xml'))
View
@@ -12,7 +12,6 @@ class GitHubUserTest < Test::Unit::TestCase
@user.name.should == "Josh Nichols"
end
-
test "#blog" do
@user.blog.should == "http://technicalpickles.com"
end
@@ -69,7 +68,6 @@ class GitHubUserTest < Test::Unit::TestCase
test "#homepage" do
@repository.homepage == ""
end
-
end
end
end
View
@@ -1,11 +1,20 @@
require 'test/unit'
require 'rubygems'
-require 'context'
-require 'matchy'
-require 'pending'
require 'fake_web'
+require 'quietbacktrace'
+require 'redgreen'
FakeWeb.allow_net_connect = false
+CONTEXT_NOISE = %w(context)
+
+backtrace_cleaner = QuietBacktrace::BacktraceCleaner.new
+backtrace_cleaner.add_silencer { |line| line.include?(CONTEXT_NOISE) }
+
+require 'context'
+require 'matchy'
+require 'pending'
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib') )
-require 'github_party'
+require 'le_git'
+

0 comments on commit edbfb10

Please sign in to comment.