Skip to content

Commit

Permalink
set a default root_directory so source code highlighting works out of…
Browse files Browse the repository at this point in the history
… the box
  • Loading branch information
grosser committed Feb 20, 2017
1 parent 731796a commit 1eec183
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/airbrake-ruby/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def initialize(user_config = {})
self.blacklist_keys = []
self.whitelist_keys = []

self.root_directory = (defined?(Bundler) && Bundler.root) || File.expand_path(Dir.pwd)

merge(user_config)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
expect(config.queue_size).to eq(100)
end

it "doesn't set the default root_directory" do
expect(config.root_directory).to be_nil
it "sets the default root_directory" do
expect(config.root_directory).to eq Bundler.root
end

it "doesn't set the default environment" do
Expand Down

0 comments on commit 1eec183

Please sign in to comment.