Implement Blob, Tree and Lazy, add tests for Tree.
[phpgit.git] / tests / fixtures / diff_i
blobcec64e1d2bfbaff09a6239d360525525a6da4506
1 commit 634396b2f541a9f2d58b00be1a07f0c358b999b3
2 Author: Tom Preston-Werner <tom@mojombo.com>
3 Date:   Tue Oct 9 23:18:20 2007 -0700
5     initial grit setup
7 diff --git a/History.txt b/History.txt
8 new file mode 100644
9 index 0000000000000000000000000000000000000000..81d2c27608b352814cbe979a6acd678d30219678
10 --- /dev/null
11 +++ b/History.txt
12 @@ -0,0 +1,5 @@
13 +== 1.0.0 / 2007-10-09
15 +* 1 major enhancement
16 +  * Birthday!
18 diff --git a/Manifest.txt b/Manifest.txt
19 new file mode 100644
20 index 0000000000000000000000000000000000000000..641972d82c6d1b51122274ae8f6a0ecdfb56ee22
21 --- /dev/null
22 +++ b/Manifest.txt
23 @@ -0,0 +1,7 @@
24 +History.txt
25 +Manifest.txt
26 +README.txt
27 +Rakefile
28 +bin/grit
29 +lib/grit.rb
30 +test/test_grit.rb
31 \ No newline at end of file
32 diff --git a/README.txt b/README.txt
33 new file mode 100644
34 index 0000000000000000000000000000000000000000..8b1e02c0fb554eed2ce2ef737a68bb369d7527df
35 --- /dev/null
36 +++ b/README.txt
37 @@ -0,0 +1,48 @@
38 +grit
39 +    by FIX (your name)
40 +    FIX (url)
42 +== DESCRIPTION:
43 +  
44 +FIX (describe your package)
46 +== FEATURES/PROBLEMS:
47 +  
48 +* FIX (list of features or problems)
50 +== SYNOPSIS:
52 +  FIX (code sample of usage)
54 +== REQUIREMENTS:
56 +* FIX (list of requirements)
58 +== INSTALL:
60 +* FIX (sudo gem install, anything else)
62 +== LICENSE:
64 +(The MIT License)
66 +Copyright (c) 2007 FIX
68 +Permission is hereby granted, free of charge, to any person obtaining
69 +a copy of this software and associated documentation files (the
70 +'Software'), to deal in the Software without restriction, including
71 +without limitation the rights to use, copy, modify, merge, publish,
72 +distribute, sublicense, and/or sell copies of the Software, and to
73 +permit persons to whom the Software is furnished to do so, subject to
74 +the following conditions:
76 +The above copyright notice and this permission notice shall be
77 +included in all copies or substantial portions of the Software.
79 +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
80 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
81 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
82 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
83 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
84 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
85 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
86 diff --git a/Rakefile b/Rakefile
87 new file mode 100644
88 index 0000000000000000000000000000000000000000..ff69c3684a18592c741332b290492aa39d980e02
89 --- /dev/null
90 +++ b/Rakefile
91 @@ -0,0 +1,17 @@
92 +# -*- ruby -*-
94 +require 'rubygems'
95 +require 'hoe'
96 +require './lib/grit.rb'
98 +Hoe.new('grit', GitPython.VERSION) do |p|
99 +  p.rubyforge_name = 'grit'
100 +  # p.author = 'FIX'
101 +  # p.email = 'FIX'
102 +  # p.summary = 'FIX'
103 +  # p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
104 +  # p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
105 +  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
106 +end
108 +# vim: syntax=Ruby
109 diff --git a/bin/grit b/bin/grit
110 new file mode 100644
111 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
112 diff --git a/lib/grit.rb b/lib/grit.rb
113 new file mode 100644
114 index 0000000000000000000000000000000000000000..32cec87d1e78946a827ddf6a8776be4d81dcf1d1
115 --- /dev/null
116 +++ b/lib/grit.rb
117 @@ -0,0 +1,12 @@
118 +$:.unshift File.dirname(__FILE__)     # For use/testing when no gem is installed
120 +# core
122 +# stdlib
124 +# internal requires
125 +require 'grit/grit'
127 +class Grit
128 +  VERSION = '1.0.0'
129 +end
130 \ No newline at end of file
131 diff --git a/lib/grit/errors.rb b/lib/grit/errors.rb
132 new file mode 100644
133 index 0000000000000000000000000000000000000000..b3be31553741937607a89be8b6a2ab1df208852e
134 --- /dev/null
135 +++ b/lib/grit/errors.rb
136 @@ -0,0 +1,4 @@
137 +class Grit
138 +  class InvalidGitRepositoryError < StandardError
139 +  end
140 +end
141 \ No newline at end of file
142 diff --git a/lib/grit/grit.rb b/lib/grit/grit.rb
143 new file mode 100644
144 index 0000000000000000000000000000000000000000..48fd36e16081ec09903f7a0e2253b3d16f9efb01
145 --- /dev/null
146 +++ b/lib/grit/grit.rb
147 @@ -0,0 +1,24 @@
148 +class Grit
149 +  attr_accessor :path
150 +  
151 +  # Create a new Grit instance
152 +  #   +path+ is the path to either the root git directory or the bare git repo
153 +  #
154 +  # Examples
155 +  #   g = Grit.new("/Users/tom/dev/grit")
156 +  #   g = Grit.new("/Users/tom/public/grit.git")
157 +  def initialize(path)
158 +    if File.exist?(File.join(path, '.git'))
159 +      self.path = File.join(path, '.git')
160 +    elsif File.exist?(path) && path =~ /\.git$/
161 +      self.path = path
162 +    else
163 +      raise InvalidGitRepositoryError.new(path) unless File.exist?(path)
164 +    end
165 +  end
166 +  
167 +  # Return the project's description. Taken verbatim from REPO/description
168 +  def description
169 +    File.open(File.join(self.path, 'description')).read.chomp
170 +  end
171 +end
172 \ No newline at end of file
173 diff --git a/test/helper.rb b/test/helper.rb
174 new file mode 100644
175 index 0000000000000000000000000000000000000000..56e21da6b4ce3021d2754775dfa589947a4e37e5
176 --- /dev/null
177 +++ b/test/helper.rb
178 @@ -0,0 +1,5 @@
179 +require File.join(File.dirname(__FILE__), *%w[.. lib grit])
181 +require 'test/unit'
183 +GRIT_REPO = File.join(File.dirname(__FILE__), *%w[..])
184 diff --git a/test/test_grit.rb b/test/test_grit.rb
185 new file mode 100644
186 index 0000000000000000000000000000000000000000..93aa481b37629797df739380306ae689e13f2855
187 --- /dev/null
188 +++ b/test/test_grit.rb
189 @@ -0,0 +1,11 @@
190 +require File.dirname(__FILE__) + '/helper'
192 +class TestGrit < Test::Unit::TestCase
193 +  def setup
194 +    @g = Grit.new(GRIT_REPO)
195 +  end
196 +  
197 +  def test_description
198 +    assert_equal "Grit is a ruby library for interfacing with git repositories.", @g.description
199 +  end
200 +end
201 \ No newline at end of file