Skip to content

Commit

Permalink
hoptoad
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorturk committed Oct 22, 2010
1 parent f041ee7 commit 86ef77b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
7 changes: 7 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@
end
end
end


Dir[File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
$: << File.join(vendored_notifier, 'lib')
end

require 'hoptoad_notifier/capistrano'
28 changes: 24 additions & 4 deletions lib/tasks/hoptoad_notifier_tasks.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
Dir[File.join(RAILS_ROOT, 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
$: << File.join(vendored_notifier, 'lib')
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

require 'hoptoad_notifier/tasks'
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

0 comments on commit 86ef77b

Please sign in to comment.