git-db 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +59 -0
- data/Rakefile +43 -0
- data/VERSION +1 -0
- data/bin/git-db +17 -0
- data/features/git-db.feature +9 -0
- data/features/step_definitions/git-db_steps.rb +0 -0
- data/features/support/env.rb +4 -0
- data/git-db.gemspec +91 -0
- data/lib/git-db/commands/receive-pack.rb +73 -0
- data/lib/git-db/commands/upload-pack.rb +140 -0
- data/lib/git-db/commands.rb +21 -0
- data/lib/git-db/database.rb +134 -0
- data/lib/git-db/objects/base.rb +34 -0
- data/lib/git-db/objects/blob.rb +11 -0
- data/lib/git-db/objects/commit.rb +49 -0
- data/lib/git-db/objects/entry.rb +27 -0
- data/lib/git-db/objects/tag.rb +7 -0
- data/lib/git-db/objects/tree.rb +45 -0
- data/lib/git-db/objects.rb +20 -0
- data/lib/git-db/pack.rb +182 -0
- data/lib/git-db/protocol.rb +73 -0
- data/lib/git-db/utility/counting_io.rb +24 -0
- data/lib/git-db/utility.rb +3 -0
- data/lib/git-db.rb +68 -0
- data/spec/git-db/commands_spec.rb +23 -0
- data/spec/git-db/objects/base_spec.rb +27 -0
- data/spec/git-db/objects/entry_spec.rb +25 -0
- data/spec/git-db/objects/tag_spec.rb +14 -0
- data/spec/git-db/objects/tree_spec.rb +42 -0
- data/spec/git-db/utility/counting_io_spec.rb +30 -0
- data/spec/git-db_spec.rb +45 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +11 -0
- metadata +118 -0
data/spec/git-db_spec.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "GitDB" do
|
4
|
+
|
5
|
+
describe "git utility" do
|
6
|
+
it "can convert shas to/from hex/binary representation" do
|
7
|
+
@hex = "6161616161616161616161616161616161616161"
|
8
|
+
@sha = "aaaaaaaaaaaaaaaaaaaa"
|
9
|
+
|
10
|
+
GitDB.hex_to_sha1(@hex.dup).should == @sha.dup
|
11
|
+
GitDB.sha1_to_hex(@sha.dup).should == @hex.dup
|
12
|
+
end
|
13
|
+
|
14
|
+
it "has a null sha" do
|
15
|
+
GitDB.null_sha1.should == "0000000000000000000000000000000000000000"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "logging" do
|
20
|
+
it "has a logger that can respond to puts" do
|
21
|
+
GitDB.logger.should respond_to(:puts)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "logs messages sent to log" do
|
25
|
+
@logger = mock(Logger)
|
26
|
+
@message = "Log This"
|
27
|
+
|
28
|
+
GitDB.should_receive(:logger).and_return(@logger)
|
29
|
+
@logger.should_receive(:puts).with(@message)
|
30
|
+
|
31
|
+
GitDB.log(@message)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "database" do
|
36
|
+
it "returns a database for a repository" do
|
37
|
+
@repository = "Test Repository"
|
38
|
+
|
39
|
+
GitDB::Database.should_receive(:database).with(@repository)
|
40
|
+
|
41
|
+
GitDB.database(@repository)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
data/spec/rcov.opts
ADDED
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: git-db
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Dollar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-09-14 00:00:00 -04:00
|
13
|
+
default_executable: git-db
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: couchrest
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
description: Database-based git server
|
36
|
+
email: <ddollar@gmail.com>
|
37
|
+
executables:
|
38
|
+
- git-db
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README.rdoc
|
44
|
+
files:
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- bin/git-db
|
52
|
+
- features/git-db.feature
|
53
|
+
- features/step_definitions/git-db_steps.rb
|
54
|
+
- features/support/env.rb
|
55
|
+
- git-db.gemspec
|
56
|
+
- lib/git-db.rb
|
57
|
+
- lib/git-db/commands.rb
|
58
|
+
- lib/git-db/commands/receive-pack.rb
|
59
|
+
- lib/git-db/commands/upload-pack.rb
|
60
|
+
- lib/git-db/database.rb
|
61
|
+
- lib/git-db/objects.rb
|
62
|
+
- lib/git-db/objects/base.rb
|
63
|
+
- lib/git-db/objects/blob.rb
|
64
|
+
- lib/git-db/objects/commit.rb
|
65
|
+
- lib/git-db/objects/entry.rb
|
66
|
+
- lib/git-db/objects/tag.rb
|
67
|
+
- lib/git-db/objects/tree.rb
|
68
|
+
- lib/git-db/pack.rb
|
69
|
+
- lib/git-db/protocol.rb
|
70
|
+
- lib/git-db/utility.rb
|
71
|
+
- lib/git-db/utility/counting_io.rb
|
72
|
+
- spec/git-db/commands_spec.rb
|
73
|
+
- spec/git-db/objects/base_spec.rb
|
74
|
+
- spec/git-db/objects/entry_spec.rb
|
75
|
+
- spec/git-db/objects/tag_spec.rb
|
76
|
+
- spec/git-db/objects/tree_spec.rb
|
77
|
+
- spec/git-db/utility/counting_io_spec.rb
|
78
|
+
- spec/git-db_spec.rb
|
79
|
+
- spec/rcov.opts
|
80
|
+
- spec/spec.opts
|
81
|
+
- spec/spec_helper.rb
|
82
|
+
has_rdoc: true
|
83
|
+
homepage: http://github.com/ddollar/git-db
|
84
|
+
licenses: []
|
85
|
+
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options:
|
88
|
+
- --charset=UTF-8
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: "0"
|
96
|
+
version:
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: "0"
|
102
|
+
version:
|
103
|
+
requirements: []
|
104
|
+
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 1.3.5
|
107
|
+
signing_key:
|
108
|
+
specification_version: 3
|
109
|
+
summary: Database-based git server
|
110
|
+
test_files:
|
111
|
+
- spec/git-db/commands_spec.rb
|
112
|
+
- spec/git-db/objects/base_spec.rb
|
113
|
+
- spec/git-db/objects/entry_spec.rb
|
114
|
+
- spec/git-db/objects/tag_spec.rb
|
115
|
+
- spec/git-db/objects/tree_spec.rb
|
116
|
+
- spec/git-db/utility/counting_io_spec.rb
|
117
|
+
- spec/git-db_spec.rb
|
118
|
+
- spec/spec_helper.rb
|