diff --git a/lib/raven/base.rb b/lib/raven/base.rb index b70ded15e..b59b680f7 100644 --- a/lib/raven/base.rb +++ b/lib/raven/base.rb @@ -50,7 +50,7 @@ def client # Tell the log that the client is good to go def report_ready - self.logger.info "Raven #{VERSION} ready to catch errors" + logger.info "Raven #{VERSION} ready to catch errors" end # Call this method to modify defaults in your initializers. @@ -59,11 +59,11 @@ def report_ready # Raven.configure do |config| # config.server = 'http://...' # end - def configure(silent = false) + def configure yield(configuration) if block_given? self.client = Client.new(configuration) - report_ready unless silent + report_ready unless client.configuration.silence_ready self.client end diff --git a/lib/raven/configuration.rb b/lib/raven/configuration.rb index 01fb3d065..7955f9773 100644 --- a/lib/raven/configuration.rb +++ b/lib/raven/configuration.rb @@ -31,6 +31,9 @@ class Configuration # Logger to use internally attr_accessor :logger + # Silence ready message + attr_accessor :silence_ready + # Number of lines of code context to capture, or nil for none attr_accessor :context_lines diff --git a/spec/raven/event_spec.rb b/spec/raven/event_spec.rb index 4b865f22a..161b3b990 100644 --- a/spec/raven/event_spec.rb +++ b/spec/raven/event_spec.rb @@ -227,7 +227,7 @@ describe '.initialize' do it 'should not touch the env object for an ignored environment' do - Raven.configure(true) do |config| + Raven.configure do |config| config.current_environment = 'test' end Raven.rack_context({}) @@ -373,7 +373,7 @@ class SubExc < BaseExc; end rails = double('Rails') allow(rails).to receive(:root) { '/rails/root' } stub_const('Rails', rails) - Raven.configure(true) do |config| + Raven.configure do |config| config.project_root ||= ::Rails.root end end