Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created January 21, 2011 18:39
Show Gist options
  • Save deadprogram/790152 to your computer and use it in GitHub Desktop.
Save deadprogram/790152 to your computer and use it in GitHub Desktop.
hoptoad_deploy_environments = %w(staging production)
if hoptoad_deploy_environments.include?(@configuration[:environment])
# Notify Hoptoad of deploy
run "cd #{current_path} && rake hoptoad:deploy TO=#{@configuration[:environment]} REVISION=#{@configuration[:revision]} REPO=#{@configuration[:repository]}"
end
# Don't load anything when running the gems:* tasks.
# Otherwise, hoptoad_notifier will be considered a framework gem.
# https://thoughtbot.lighthouseapp.com/projects/14221/tickets/629
unless ARGV.any? {|a| a =~ /^gems/}
Dir[File.join(RAILS_ROOT, 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
$: << File.join(vendored_notifier, 'lib')
end
begin
require 'hoptoad_notifier/tasks'
rescue LoadError => exception
namespace :hoptoad do
%w(deploy test log_stdout).each do |task_name|
desc "Missing dependency for hoptoad:#{task_name}"
task task_name do
$stderr.puts "Failed to run hoptoad:#{task_name} because of missing dependency."
$stderr.puts "You probably need to run `rake gems:install` to install the hoptoad_notifier gem"
abort exception.inspect
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment