gitrb 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/gitrb.gemspec +1 -2
- data/lib/gitrb/blob.rb +0 -4
- data/lib/gitrb/commit.rb +0 -4
- data/lib/gitrb/gitobject.rb +4 -0
- data/lib/gitrb/repository.rb +11 -8
- data/lib/gitrb/tag.rb +0 -4
- data/lib/gitrb/tree.rb +0 -4
- data/lib/gitrb/user.rb +5 -3
- data/lib/gitrb.rb +0 -1
- metadata +3 -4
- data/lib/gitrb/diff.rb +0 -3
data/gitrb.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'gitrb'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.7'
|
4
4
|
s.summary = 'Pure ruby git implementation'
|
5
5
|
s.author = 'Daniel Mendler'
|
6
6
|
s.email = 'mail@daniel-mendler.de'
|
@@ -18,7 +18,6 @@ gitrb.gemspec
|
|
18
18
|
lib/gitrb.rb
|
19
19
|
lib/gitrb/blob.rb
|
20
20
|
lib/gitrb/commit.rb
|
21
|
-
lib/gitrb/diff.rb
|
22
21
|
lib/gitrb/gitobject.rb
|
23
22
|
lib/gitrb/pack.rb
|
24
23
|
lib/gitrb/reference.rb
|
data/lib/gitrb/blob.rb
CHANGED
data/lib/gitrb/commit.rb
CHANGED
data/lib/gitrb/gitobject.rb
CHANGED
data/lib/gitrb/repository.rb
CHANGED
@@ -12,6 +12,8 @@ module Gitrb
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
Diff = Struct.new(:from, :to, :patch)
|
16
|
+
|
15
17
|
class Repository
|
16
18
|
attr_reader :path, :root, :branch, :head, :encoding
|
17
19
|
|
@@ -82,7 +84,7 @@ module Gitrb
|
|
82
84
|
!!@lock[Thread.current.object_id]
|
83
85
|
end
|
84
86
|
|
85
|
-
#
|
87
|
+
# Difference between versions
|
86
88
|
# Options:
|
87
89
|
# :to - Required target commit
|
88
90
|
# :from - Optional source commit (otherwise comparision with empty tree)
|
@@ -152,14 +154,15 @@ module Gitrb
|
|
152
154
|
end
|
153
155
|
|
154
156
|
# Returns a list of commits starting from head commit.
|
155
|
-
def log(
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
raise ArgumentError, "Invalid commit: #{start}" if start =~ /^\-/
|
157
|
+
def log(opts = {})
|
158
|
+
max_count = opts[:max_count]
|
159
|
+
skip = opts[:skip]
|
160
|
+
start = opts[:start]
|
161
|
+
path = opts[:path]
|
162
|
+
raise ArgumentError, "Invalid commit: #{start}" if start.to_s =~ /^\-/
|
161
163
|
log = git_log('--pretty=tformat:%H%n%P%n%T%n%an%n%ae%n%at%n%cn%n%ce%n%ct%n%x00%s%n%b%x00',
|
162
|
-
"
|
164
|
+
skip ? "--skip=#{skip.to_i}" : nil,
|
165
|
+
max_count ? "--max-count=#{max_count.to_i}" : nil, start, '--', path).split(/\n*\x00\n*/)
|
163
166
|
commits = []
|
164
167
|
log.each_slice(2) do |data, message|
|
165
168
|
data = data.split("\n")
|
data/lib/gitrb/tag.rb
CHANGED
data/lib/gitrb/tree.rb
CHANGED
data/lib/gitrb/user.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
module Gitrb
|
2
|
+
class User
|
3
|
+
attr_reader :name, :email, :date
|
2
4
|
|
3
|
-
class User < Struct.new(:name, :email, :date)
|
4
5
|
def initialize(name, email, date = Time.now)
|
5
|
-
|
6
|
+
@name = name
|
7
|
+
@email = email
|
8
|
+
@date = date
|
6
9
|
end
|
7
10
|
|
8
11
|
def dump
|
@@ -17,5 +20,4 @@ module Gitrb
|
|
17
20
|
end
|
18
21
|
|
19
22
|
end
|
20
|
-
|
21
23
|
end
|
data/lib/gitrb.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 7
|
9
|
+
version: 0.1.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Daniel Mendler
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-21 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -45,7 +45,6 @@ files:
|
|
45
45
|
- lib/gitrb.rb
|
46
46
|
- lib/gitrb/blob.rb
|
47
47
|
- lib/gitrb/commit.rb
|
48
|
-
- lib/gitrb/diff.rb
|
49
48
|
- lib/gitrb/gitobject.rb
|
50
49
|
- lib/gitrb/pack.rb
|
51
50
|
- lib/gitrb/reference.rb
|
data/lib/gitrb/diff.rb
DELETED