Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/raven/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
3 changes: 3 additions & 0 deletions lib/raven/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/raven/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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({})
Expand Down Expand Up @@ -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
Expand Down