git-graph 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/bin/git-graph CHANGED
@@ -82,8 +82,8 @@ begin
82
82
  ARGV.first
83
83
  ].compact
84
84
  success, output = without_bundler { run(command.map { |c| "(#{c})" }.join(" && ")) }
85
- data[date] = if success
86
- value = output.split("\n").last.to_s.strip
85
+ value = output.split("\n").last.to_s.strip
86
+ data[date] = if success && value =~ /^\d/
87
87
  value =~ /^\d+\.\d+$/ ? value.to_f : value.to_i
88
88
  else
89
89
  data.values.last || 0
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Graph
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@ describe Git::Graph do
19
19
 
20
20
  before :all do
21
21
  run("rm -rf #{Bundler.root.join("tmp/parallel")}")
22
- run("cd #{Bundler.root.join("tmp")} && git clone git@github.com:grosser/parallel.git 2>&1")
22
+ run("cd #{Bundler.root.join("tmp")} && git clone git://github.com/grosser/parallel.git 2>&1")
23
23
  end
24
24
 
25
25
  around do |example|
@@ -75,7 +75,16 @@ describe Git::Graph do
75
75
  EXPECTED
76
76
  end
77
77
 
78
- it "fills in missing values with the last value" do
78
+ it "shows script without output as all 0" do
79
+ result = graph("--start 2011-01-01 'test' 2>/dev/null")
80
+ result.should == <<-EXPECTED.gsub(/^\s+/, "")
81
+ Date,value
82
+ 2011-01-01,0
83
+ 2010-01-01,0
84
+ EXPECTED
85
+ end
86
+
87
+ it "fills in failed values with the last value" do
79
88
  # this file is not present pre 2011 -> error
80
89
  result = graph("--start 2013-01-01 'wc -l lib/parallel/version.rb' 2>/dev/null")
81
90
  result.should == <<-EXPECTED.gsub(/^\s+/, "")
@@ -87,6 +96,18 @@ describe Git::Graph do
87
96
  EXPECTED
88
97
  end
89
98
 
99
+ it "fills in missing values with the last value" do
100
+ # this file is not present pre 2011 -> no output
101
+ result = graph("--start 2013-01-01 'test -e lib/parallel/version.rb && echo 123' 2>/dev/null")
102
+ result.should == <<-EXPECTED.gsub(/^\s+/, "")
103
+ Date,value
104
+ 2013-01-01,123
105
+ 2012-01-02,123
106
+ 2011-01-02,123
107
+ 2010-01-02,123
108
+ EXPECTED
109
+ end
110
+
90
111
  it "generates a chart" do
91
112
  result = graph("--start 2013-01-01 --output chart 'cat lib/parallel.rb | wc -l' 2>/dev/null")
92
113
  result.should include("http://chart.apis.google.com/chart?")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -87,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  segments:
89
89
  - 0
90
- hash: -3227504656897889005
90
+ hash: 2178104070771132017
91
91
  required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  none: false
93
93
  requirements:
@@ -96,10 +96,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: -3227504656897889005
99
+ hash: 2178104070771132017
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 1.8.24
102
+ rubygems_version: 1.8.25
103
103
  signing_key:
104
104
  specification_version: 3
105
105
  summary: Make graphs from your git history
metadata.gz.sig CHANGED
Binary file