summaryrefslogtreecommitdiffstats
path: root/lib/git/raw/internal/object.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-20 13:24:44 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-20 13:24:44 -0800
commit90dea6d415bfc5734bc87c2797b26cca311246bc (patch)
treeca17b784c0f417bb62fde17e9b11a1a8a444c07e /lib/git/raw/internal/object.rb
parentd07a2c04c1599fe707831afdd29397cc36e02fa6 (diff)
downloadthird_party-ruby-git-90dea6d415bfc5734bc87c2797b26cca311246bc.zip
third_party-ruby-git-90dea6d415bfc5734bc87c2797b26cca311246bc.tar.gz
third_party-ruby-git-90dea6d415bfc5734bc87c2797b26cca311246bc.tar.xz
have the pure ruby bindings working to some degree
Diffstat (limited to 'lib/git/raw/internal/object.rb')
-rw-r--r--lib/git/raw/internal/object.rb38
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/git/raw/internal/object.rb b/lib/git/raw/internal/object.rb
index b81df2b..7f95685 100644
--- a/lib/git/raw/internal/object.rb
+++ b/lib/git/raw/internal/object.rb
@@ -1,23 +1,27 @@
require 'digest/sha1'
-module Git module Raw module Internal
- OBJ_NONE = 0
- OBJ_COMMIT = 1
- OBJ_TREE = 2
- OBJ_BLOB = 3
- OBJ_TAG = 4
+module Git
+ module Raw
+ module Internal
+ OBJ_NONE = 0
+ OBJ_COMMIT = 1
+ OBJ_TREE = 2
+ OBJ_BLOB = 3
+ OBJ_TAG = 4
- OBJ_TYPES = [nil, :commit, :tree, :blob, :tag].freeze
+ OBJ_TYPES = [nil, :commit, :tree, :blob, :tag].freeze
- class RawObject
- attr_accessor :type, :content
- def initialize(type, content)
- @type = type
- @content = content
- end
+ class RawObject
+ attr_accessor :type, :content
+ def initialize(type, content)
+ @type = type
+ @content = content
+ end
- def sha1
- Digest::SHA1.digest("%s %d\0" % [@type, @content.length] + @content)
- end
+ def sha1
+ Digest::SHA1.digest("%s %d\0" % [@type, @content.length] + @content)
+ end
+ end
+ end
end
-end end
+end