yolo 1.1.15 → 1.1.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -120,11 +120,18 @@ module Yolo
120
120
  #
121
121
  # @return [String] The tag
122
122
  def latest_tag
123
- match = log.scan(/tag:\s(.+?),\s/).first
124
- if match.nil?
123
+ match = ""
124
+ matches = log.scan(/tag:\s(.+?),\s/)
125
+ if matches.nil?
125
126
  ""
126
127
  else
127
- match.first
128
+ matches.each do |tag|
129
+ if !tag.first.include? "jenkins"
130
+ match = tag.first
131
+ break
132
+ end
133
+ end
134
+ return match
128
135
  end
129
136
  end
130
137
 
@@ -94,10 +94,16 @@ describe Yolo::Tools::Git do
94
94
  end
95
95
 
96
96
  it "should get the latest tag" do
97
- @git.stub(:log){"tag: v1.0, head, tag: v1.3.1"}
97
+ @git.stub(:log){"tag: v1.0, head, tag: v1.3.1, master"}
98
98
  @git.instance_eval{latest_tag}.should eq("v1.0")
99
99
  end
100
100
 
101
+ it "should ignore jenkins tags" do
102
+ @git.stub(:log){"tag: jenkins-tag, head, tag: v1.3.1, master"}
103
+ @git.instance_eval{latest_tag}.should_not eq("jenkins-tag")
104
+ @git.instance_eval{latest_tag}.should eq("v1.3.1")
105
+ end
106
+
101
107
  it "should recognise invalid tags" do
102
108
  @git.stub(:log){"junk"}
103
109
  @git.instance_eval{latest_tag}.should eq("")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.15
4
+ version: 1.1.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -155,3 +155,4 @@ signing_key:
155
155
  specification_version: 3
156
156
  summary: YOLO!
157
157
  test_files: []
158
+ has_rdoc: