heroku_san 4.0.6 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +5 -0
- data/lib/git.rb +3 -1
- data/lib/heroku_san.rb +1 -1
- data/lib/heroku_san/version.rb +1 -1
- data/spec/git_spec.rb +5 -3
- data/spec/heroku_san/stage_spec.rb +4 -2
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/git.rb
CHANGED
@@ -2,6 +2,8 @@ require 'rake'
|
|
2
2
|
require 'rake/dsl_definition'
|
3
3
|
|
4
4
|
module Git
|
5
|
+
class NoTagFoundError < Exception; end
|
6
|
+
|
5
7
|
include Rake::DSL
|
6
8
|
|
7
9
|
def git_clone(repos, dir)
|
@@ -34,7 +36,7 @@ module Git
|
|
34
36
|
|
35
37
|
def git_tag(glob)
|
36
38
|
return nil if glob.nil?
|
37
|
-
%x{git tag -l '#{glob}'}.split("\n").last
|
39
|
+
%x{git tag -l '#{glob}'}.split("\n").last || (raise NoTagFoundError, "No tag found [#{glob}]")
|
38
40
|
end
|
39
41
|
|
40
42
|
def git_revision(repo)
|
data/lib/heroku_san.rb
CHANGED
data/lib/heroku_san/version.rb
CHANGED
data/spec/git_spec.rb
CHANGED
@@ -32,11 +32,13 @@ describe GitTest do
|
|
32
32
|
subject.should_receive("`").with("git tag -l 'pattern*'") { "x\n\y\n\z\n" }
|
33
33
|
subject.git_tag('pattern*').should == "z"
|
34
34
|
end
|
35
|
-
it "
|
35
|
+
it "raises exception if no tags match the pattern" do
|
36
36
|
subject.should_receive("`").with("git tag -l 'pattern*'") { "\n" }
|
37
|
-
|
37
|
+
expect {
|
38
|
+
subject.git_tag('pattern*')
|
39
|
+
}.to raise_error(Git::NoTagFoundError)
|
38
40
|
end
|
39
|
-
it "returns nil for a nil
|
41
|
+
it "returns nil for a nil glob" do
|
40
42
|
subject.should_not_receive("`").with("git tag -l ''") { "\n" }
|
41
43
|
subject.git_tag(nil).should == nil
|
42
44
|
end
|
@@ -79,7 +79,8 @@ describe HerokuSan::Stage do
|
|
79
79
|
|
80
80
|
describe "#push" do
|
81
81
|
it "deploys to heroku" do
|
82
|
-
subject.should_receive(:
|
82
|
+
subject.should_receive(:git_parsed_tag).with(nil) {'tag'}
|
83
|
+
subject.should_receive(:git_push).with('tag', subject.repo, [])
|
83
84
|
subject.push
|
84
85
|
end
|
85
86
|
|
@@ -89,7 +90,8 @@ describe HerokuSan::Stage do
|
|
89
90
|
end
|
90
91
|
|
91
92
|
it "deploys with --force" do
|
92
|
-
subject.should_receive(:
|
93
|
+
subject.should_receive(:git_parsed_tag).with(nil) {'tag'}
|
94
|
+
subject.should_receive(:git_push).with('tag', subject.repo, %w[--force])
|
93
95
|
subject.push(nil, :force)
|
94
96
|
end
|
95
97
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_san
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
239
|
version: '0'
|
240
240
|
segments:
|
241
241
|
- 0
|
242
|
-
hash:
|
242
|
+
hash: 3672813808786714588
|
243
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
244
|
none: false
|
245
245
|
requirements:
|