capillary 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/capillary/commit.rb +1 -1
- data/lib/capillary/version.rb +1 -1
- data/test/capillary/commit_test.rb +2 -1
- data/test/capillary/log_parser_test.rb +34 -3
- data/test/fixtures/first_commit.txt +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/lib/capillary/commit.rb
CHANGED
data/lib/capillary/version.rb
CHANGED
@@ -16,6 +16,7 @@
|
|
16
16
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
17
|
#++
|
18
18
|
|
19
|
+
require "json"
|
19
20
|
require "test_helper"
|
20
21
|
require "capillary/commit"
|
21
22
|
|
@@ -41,7 +42,7 @@ class CommitTest < MiniTest::Spec
|
|
41
42
|
should "extract the committer email" do
|
42
43
|
assert_equal "chris@example.com", @commit.committer_email
|
43
44
|
end
|
44
|
-
|
45
|
+
|
45
46
|
should "extract the commit message" do
|
46
47
|
assert_equal "And this is commit 10 Merge branch 'topic'", @commit.message
|
47
48
|
end
|
@@ -26,17 +26,20 @@ class LogParserTest < MiniTest::Spec
|
|
26
26
|
branches[num].collect { |c| c.id[0...7] }
|
27
27
|
end
|
28
28
|
|
29
|
-
def load_fixture(fixture)
|
30
|
-
parse_log(fixture(fixture))
|
29
|
+
def load_fixture(fixture, num = -1)
|
30
|
+
parse_log(fixture(fixture), num)
|
31
31
|
end
|
32
32
|
|
33
|
-
def parse_log(log)
|
33
|
+
def parse_log(log, num = -1)
|
34
34
|
@log_parser = Capillary::LogParser.new
|
35
35
|
@lines = []
|
36
|
+
i = 0
|
36
37
|
|
37
38
|
log.split("\n").reject { |f| f.strip == "" }.each do |log|
|
39
|
+
return if num >= 0 && i == num
|
38
40
|
@lines << Capillary::Commit.parse(log)
|
39
41
|
@log_parser << @lines.last
|
42
|
+
i += 1
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
@@ -634,6 +637,34 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
|
|
634
637
|
end
|
635
638
|
end
|
636
639
|
|
640
|
+
# 8ff4eb2
|
641
|
+
# |
|
642
|
+
# db060ee
|
643
|
+
# | \
|
644
|
+
# | 0bca89d
|
645
|
+
# | |
|
646
|
+
# | 1793145
|
647
|
+
# | |
|
648
|
+
# | f9e1735
|
649
|
+
# | |
|
650
|
+
# 4aee02f |
|
651
|
+
# | |
|
652
|
+
# | 07b25c9
|
653
|
+
# | |
|
654
|
+
context "Axis log" do
|
655
|
+
setup do
|
656
|
+
load_fixture("axis.txt", 50)
|
657
|
+
end
|
658
|
+
|
659
|
+
should "include correct commits in second branch" do
|
660
|
+
assert_equal %w[db060ee 0bca89d 1793145 f9e1735], commits_for_branch(1)
|
661
|
+
end
|
662
|
+
|
663
|
+
should "include correct commits in fifth branch" do
|
664
|
+
assert_equal %w[e2f706e 02edff1 3e54c31], commits_for_branch(5)
|
665
|
+
end
|
666
|
+
end
|
667
|
+
|
637
668
|
context "Streaming parser" do
|
638
669
|
setup do
|
639
670
|
@lines = fixture("complex_graph_no_ff.txt").split("\n")
|
@@ -1 +1 @@
|
|
1
|
-
a7cf78bfff06d52b5b0aa021508b44c00cad067a§db75ad82d678d51b29709d26af64d4a85b6f8071§2011-07-13 07:55:47 +0200§chris@example.com§(master, refactor)§And this is commit 10 Merge branch 'topic'§
|
1
|
+
a7cf78bfff06d52b5b0aa021508b44c00cad067a§db75ad82d678d51b29709d26af64d4a85b6f8071§2011-07-13 07:55:47 +0200§chris@example.com§ (master, refactor)§And this is commit 10 Merge branch 'topic'§
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capillary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marius Mathiesen
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-08-
|
19
|
+
date: 2011-08-30 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|