|
commit 634396b2f541a9f2d58b00be1a07f0c358b999b3 |
|
Author: Tom Preston-Werner <tom@mojombo.com> |
|
Date: Tue Oct 9 23:18:20 2007 -0700 |
|
|
|
initial grit setup |
|
|
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,5 @@ |
|
+== 1.0.0 / 2007-10-09 |
|
+ |
|
+* 1 major enhancement |
|
+ * Birthday! |
|
+ |
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,7 @@ |
|
+History.txt |
|
+Manifest.txt |
|
+README.txt |
|
+Rakefile |
|
+bin/grit |
|
+lib/grit.rb |
|
+test/test_grit.rb |
|
\ No newline at end of file |
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,48 @@ |
|
+grit |
|
+ by FIX (your name) |
|
+ FIX (url) |
|
+ |
|
+== DESCRIPTION: |
|
+ |
|
+FIX (describe your package) |
|
+ |
|
+== FEATURES/PROBLEMS: |
|
+ |
|
+* FIX (list of features or problems) |
|
+ |
|
+== SYNOPSIS: |
|
+ |
|
+ FIX (code sample of usage) |
|
+ |
|
+== REQUIREMENTS: |
|
+ |
|
+* FIX (list of requirements) |
|
+ |
|
+== INSTALL: |
|
+ |
|
+* FIX (sudo gem install, anything else) |
|
+ |
|
+== LICENSE: |
|
+ |
|
+(The MIT License) |
|
+ |
|
+Copyright (c) 2007 FIX |
|
+ |
|
+Permission is hereby granted, free of charge, to any person obtaining |
|
+a copy of this software and associated documentation files (the |
|
+'Software'), to deal in the Software without restriction, including |
|
+without limitation the rights to use, copy, modify, merge, publish, |
|
+distribute, sublicense, and/or sell copies of the Software, and to |
|
+permit persons to whom the Software is furnished to do so, subject to |
|
+the following conditions: |
|
+ |
|
+The above copyright notice and this permission notice shall be |
|
+included in all copies or substantial portions of the Software. |
|
+ |
|
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,17 @@ |
|
+# -*- ruby -*- |
|
+ |
|
+require 'rubygems' |
|
+require 'hoe' |
|
+require './lib/grit.rb' |
|
+ |
|
+Hoe.new('grit', GitPython.VERSION) do |p| |
|
+ p.rubyforge_name = 'grit' |
|
+ # p.author = 'FIX' |
|
+ # p.email = 'FIX' |
|
+ # p.summary = 'FIX' |
|
+ # p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n") |
|
+ # p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1] |
|
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n") |
|
+end |
|
+ |
|
+# vim: syntax=Ruby |
|
|
|
new file mode 100644 |
|
|
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,12 @@ |
|
+$:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed |
|
+ |
|
+# core |
|
+ |
|
+# stdlib |
|
+ |
|
+# internal requires |
|
+require 'grit/grit' |
|
+ |
|
+class Grit |
|
+ VERSION = '1.0.0' |
|
+end |
|
\ No newline at end of file |
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,4 @@ |
|
+class Grit |
|
+ class InvalidGitRepositoryError < StandardError |
|
+ end |
|
+end |
|
\ No newline at end of file |
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,24 @@ |
|
+class Grit |
|
+ attr_accessor :path |
|
+ |
|
+ # Create a new Grit instance |
|
+ # +path+ is the path to either the root git directory or the bare git repo |
|
+ # |
|
+ # Examples |
|
+ # g = Grit.new("/Users/tom/dev/grit") |
|
+ # g = Grit.new("/Users/tom/public/grit.git") |
|
+ def initialize(path) |
|
+ if File.exist?(File.join(path, '.git')) |
|
+ self.path = File.join(path, '.git') |
|
+ elsif File.exist?(path) && path =~ /\.git$/ |
|
+ self.path = path |
|
+ else |
|
+ raise InvalidGitRepositoryError.new(path) unless File.exist?(path) |
|
+ end |
|
+ end |
|
+ |
|
+ # Return the project's description. Taken verbatim from REPO/description |
|
+ def description |
|
+ File.open(File.join(self.path, 'description')).read.chomp |
|
+ end |
|
+end |
|
\ No newline at end of file |
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,5 @@ |
|
+require File.join(File.dirname(__FILE__), *%w[.. lib grit]) |
|
+ |
|
+require 'test/unit' |
|
+ |
|
+GRIT_REPO = File.join(File.dirname(__FILE__), *%w[..]) |
|
|
|
new file mode 100644 |
|
|
|
|
|
|
|
@@ -0,0 +1,11 @@ |
|
+require File.dirname(__FILE__) + '/helper' |
|
+ |
|
+class TestGrit < Test::Unit::TestCase |
|
+ def setup |
|
+ @g = Grit.new(GRIT_REPO) |
|
+ end |
|
+ |
|
+ def test_description |
|
+ assert_equal "Grit is a ruby library for interfacing with git repositories.", @g.description |
|
+ end |
|
+end |
|
\ No newline at end of file |
|
|