git_statistics 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/git-statistics +1 -1
- data/bin/git_statistics +1 -1
- data/lib/git_statistics.rb +48 -32
- data/lib/git_statistics/collector.rb +40 -187
- data/lib/git_statistics/commit_summary.rb +86 -0
- data/lib/git_statistics/commits.rb +18 -14
- data/lib/git_statistics/diff_summary.rb +79 -0
- data/lib/git_statistics/formatters/console.rb +31 -26
- data/lib/git_statistics/initialize.rb +7 -6
- data/lib/git_statistics/pipe.rb +1 -1
- data/lib/git_statistics/utilities.rb +28 -91
- data/lib/git_statistics/version.rb +1 -1
- data/spec/collector_spec.rb +41 -235
- data/spec/commit_summary_spec.rb +126 -0
- data/spec/commits_spec.rb +52 -58
- data/spec/formatters/console_spec.rb +11 -10
- data/spec/utilities_spec.rb +15 -128
- metadata +22 -75
- data/lib/git_statistics/blob.rb +0 -5
- data/lib/git_statistics/branches.rb +0 -35
- data/lib/git_statistics/commit_line_extractor.rb +0 -50
- data/lib/git_statistics/regex_matcher.rb +0 -23
- data/spec/branches_spec.rb +0 -44
- data/spec/commit_line_extractor_spec.rb +0 -70
- data/spec/regex_matcher_spec.rb +0 -35
data/spec/regex_matcher_spec.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
include GitStatistics
|
3
|
-
|
4
|
-
describe RegexMatcher do
|
5
|
-
let(:change_info) { RegexMatcher.new(/(match)/i, 1) }
|
6
|
-
let(:text) { 'matching string' }
|
7
|
-
|
8
|
-
describe "#scan" do
|
9
|
-
subject { change_info.scan(text) }
|
10
|
-
context "with matching string" do
|
11
|
-
its(:size) { should == 1 }
|
12
|
-
end
|
13
|
-
context "without matching string" do
|
14
|
-
let(:text) { 'does not matter' }
|
15
|
-
its(:size) { should == 0 }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
describe "#if_matches" do
|
19
|
-
it "should yield the result with matching string" do
|
20
|
-
original = :original
|
21
|
-
change_info.if_matches(text) do |changes|
|
22
|
-
original = :new_value
|
23
|
-
end
|
24
|
-
original.should == :new_value
|
25
|
-
end
|
26
|
-
it "should not yield the result without a matching string" do
|
27
|
-
text = 'does not yield'
|
28
|
-
original = :original
|
29
|
-
change_info.if_matches(text) do |changes|
|
30
|
-
original = :new_value
|
31
|
-
end
|
32
|
-
original.should == :original
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|