Permalink
Browse files

Works outside Rails

  • Loading branch information...
1 parent 291f7ff commit 6beaf4c5bdcc133b93d0d1b3fc89666cda4e3e02 @dvdplm dvdplm committed Feb 13, 2012
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/airbrake/rails.rb
View
@@ -28,14 +28,13 @@ def self.initialize
end
Airbrake.configure(true) do |config|
- config.logger = rails_logger
- config.environment_name = if defined?(Rails.env) ? Rails.env : RAILS_ENV
- config.project_root = if defined?(Rails.root) ? Rails.root : RAILS_ROOT
- config.framework = if defined?(Rails.version) ? "Rails: #{Rails.version}" : "Rails: #{Rails::VERSION::STRING}"
+ config.logger = rails_logger
+ config.environment_name = defined?(Rails.env) && Rails.env || defined?(RAILS_ENV) && RAILS_ENV
+ config.project_root = defined?(Rails.root) && Rails.root || defined?(RAILS_ROOT) && RAILS_ROOT
+ config.framework = defined?(Rails.version) && "Rails: #{Rails.version}" || defined?(Rails::VERSION::STRING) && "Rails: #{Rails::VERSION::STRING}"
end
end
end
end
-Airbrake::Rails.initialize
-
+Airbrake::Rails.initialize

0 comments on commit 6beaf4c

Please sign in to comment.