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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change log (curated)
2
2
 
3
+ ## v4.0.7
4
+
5
+ * Closes #114 & #111
6
+ * Closes #115
7
+
3
8
  ## v4.0.5
4
9
 
5
10
  * Remove ActiveSupport dependency
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
@@ -1,4 +1,4 @@
1
- require 'railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3
1
+ require File.join(File.dirname(__FILE__), 'railtie.rb') if defined?(Rails) && Rails::VERSION::MAJOR >= 3
2
2
  require 'git'
3
3
  require 'heroku_san/stage'
4
4
  require 'heroku_san/project'
@@ -1,3 +1,3 @@
1
1
  module HerokuSan
2
- VERSION = "4.0.6"
2
+ VERSION = "4.0.7"
3
3
  end
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 "returns nil if no tags match the pattern" do
35
+ it "raises exception if no tags match the pattern" do
36
36
  subject.should_receive("`").with("git tag -l 'pattern*'") { "\n" }
37
- subject.git_tag('pattern*').should == nil
37
+ expect {
38
+ subject.git_tag('pattern*')
39
+ }.to raise_error(Git::NoTagFoundError)
38
40
  end
39
- it "returns nil for a nil tag" do
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(:git_push).with(git_parsed_tag(subject.tag), subject.repo, [])
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(:git_push).with(git_parsed_tag(subject.tag), subject.repo, %w[--force])
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.6
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: 2142218432852007923
242
+ hash: 3672813808786714588
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  none: false
245
245
  requirements: