Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #118 from exviva/load_initializer_conditionally

Fallback to loading whole environment if initializer does not exist
  • Loading branch information...
commit ec07ea7c32b3b78a80cb851ded1e1dcbd6a4b606 2 parents a3a1a92 + fff8cf8
@shime shime authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 lib/airbrake/shared_tasks.rb
View
12 lib/airbrake/shared_tasks.rb
@@ -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'],
Please sign in to comment.
Something went wrong with that request. Please try again.