Skip to content

Commit

Permalink
Fallback to loading whole environment if initializer does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
exviva committed Sep 7, 2012
1 parent f04686d commit fff8cf8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/airbrake/shared_tasks.rb
Expand Up @@ -2,7 +2,17 @@
desc "Notify Airbrake of a new deploy."
task :deploy do
require 'airbrake_tasks'
load File.join(Rails.root, 'config', 'initializers','airbrake.rb') if defined?(Rails.root)

if defined?(Rails.root)
initializer_file = Rails.root.join('config', 'initializers','airbrake.rb')

if initializer_file.exist?
load initializer_file
else
Rake::Task[:environment].invoke
end
end

AirbrakeTasks.deploy(:rails_env => ENV['TO'],
:scm_revision => ENV['REVISION'],
:scm_repository => ENV['REPO'],
Expand Down

0 comments on commit fff8cf8

Please sign in to comment.