Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add preflight check for Toolbelt (CLI)

  • Loading branch information...
commit e5b537f4c2a0eb9cc91e3579d25b68ac11895cc8 1 parent af68e72
@kmayer kmayer authored
View
1  .gitignore
@@ -5,3 +5,4 @@ Thumbs.db
tmp
.idea/**
*.swp
+.rspec
View
6 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- heroku_san (4.0.1)
+ heroku_san (4.0.2)
activesupport
heroku-api (>= 0.1.2)
rake
@@ -60,8 +60,8 @@ GEM
git-smart (0.1.9)
colorize
godot (0.1.0)
- heroku-api (0.3.5)
- excon (~> 0.16.1)
+ heroku-api (0.3.6)
+ excon (~> 0.16.7)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
View
1  Rakefile
@@ -10,5 +10,4 @@ task :default => :spec
desc "Run all specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = 'spec/**/*_spec.rb'
- t.rspec_opts = ["-c", "-f progress"]
end
View
5 lib/heroku_san/stage.rb
@@ -139,6 +139,7 @@ def auth_token
end
def sh_heroku(*command)
+ preflight_check_for_cli
cmd = (command + ['--app', app]).compact
show_command = cmd.join(' ')
$stderr.puts show_command if @debug
@@ -146,5 +147,9 @@ def sh_heroku(*command)
status = $?
ok or fail "Command failed with status (#{status.exitstatus}): [heroku #{show_command}]"
end
+
+ def preflight_check_for_cli
+ raise "The Heroku Toolbelt is required for this action. http://toolbelt.heroku.com" if system('heroku version') == nil
+ end
end
end
View
3  spec/heroku_san/stage_spec.rb
@@ -4,6 +4,9 @@
include Git
subject { HerokuSan::Stage.new('production', {"app" => "awesomeapp", "stack" => "cedar"})}
STOCK_CONFIG = {"BUNDLE_WITHOUT"=>"development:test", "LANG"=>"en_US.UTF-8", "RACK_ENV"=>"production"}
+ before do
+ HerokuSan::Stage.any_instance.stub(:preflight_check_for_cli)
+ end
context "initializes" do
subject { HerokuSan::Stage.new('production',
Please sign in to comment.
Something went wrong with that request. Please try again.