diff --git a/CHANGELOG.md b/CHANGELOG.md index f11866a2..3ca08f88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ Airbrake Ruby Changelog ### master +* Changed format for `[GEM_ROOT]` & `[PROJECT_ROOT]` placeholders to + `/GEM_ROOT` & `/PROJECT_ROOT` respectively. This improves searching + capabilities in the Airbrake + dashboard. ([#311](https://github.com/airbrake/airbrake-ruby/pull/311)) + ### [v2.8.3][v2.8.3] (March 12, 2018) * Fixed bug introduced in v2.8.2 in blacklist/whitelist filtering. All diff --git a/lib/airbrake-ruby/filters/gem_root_filter.rb b/lib/airbrake-ruby/filters/gem_root_filter.rb index 7de4e874..d9b54025 100644 --- a/lib/airbrake-ruby/filters/gem_root_filter.rb +++ b/lib/airbrake-ruby/filters/gem_root_filter.rb @@ -5,7 +5,7 @@ module Filters class GemRootFilter ## # @return [String] - GEM_ROOT_LABEL = '[GEM_ROOT]'.freeze + GEM_ROOT_LABEL = '/GEM_ROOT'.freeze ## # @return [Integer] diff --git a/lib/airbrake-ruby/filters/root_directory_filter.rb b/lib/airbrake-ruby/filters/root_directory_filter.rb index 6d1d158a..6444c356 100644 --- a/lib/airbrake-ruby/filters/root_directory_filter.rb +++ b/lib/airbrake-ruby/filters/root_directory_filter.rb @@ -5,7 +5,7 @@ module Filters class RootDirectoryFilter ## # @return [String] - PROJECT_ROOT_LABEL = '[PROJECT_ROOT]'.freeze + PROJECT_ROOT_LABEL = '/PROJECT_ROOT'.freeze ## # @return [Integer] diff --git a/spec/airbrake_spec.rb b/spec/airbrake_spec.rb index 418fa175..722c4182 100644 --- a/spec/airbrake_spec.rb +++ b/spec/airbrake_spec.rb @@ -81,8 +81,8 @@ # rubocop:disable Metrics/LineLength expected_body = %r| {"errors":\[{"type":"RuntimeError","message":"bingo","backtrace":\[ - {"file":"\[PROJECT_ROOT\]/spec/airbrake_spec.rb","line":\d+,"function":"[\w/\s\(\)<>]+","code".+}, - {"file":"\[GEM_ROOT\]/gems/rspec-core-.+/.+","line":\d+,"function":"[\w/\s\(\)<>]+".+ + {"file":"/PROJECT_ROOT/spec/airbrake_spec.rb","line":\d+,"function":"[\w/\s\(\)<>]+","code".+}, + {"file":"/GEM_ROOT/gems/rspec-core-.+/.+","line":\d+,"function":"[\w/\s\(\)<>]+".+ |x # rubocop:enable Metrics/LineLength diff --git a/spec/filters/gem_root_filter_spec.rb b/spec/filters/gem_root_filter_spec.rb index 356b7ad2..0f37872b 100644 --- a/spec/filters/gem_root_filter_spec.rb +++ b/spec/filters/gem_root_filter_spec.rb @@ -28,9 +28,9 @@ eq( [ { file: "/home/kyrylo/code/airbrake/ruby/spec/spec_helper.rb" }, - { file: "[GEM_ROOT]/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb" }, + { file: "/GEM_ROOT/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb" }, { file: "/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb" }, - { file: "[GEM_ROOT]/gems/rspec-core-3.3.2/exe/rspec" } + { file: "/GEM_ROOT/gems/rspec-core-3.3.2/exe/rspec" } ] ) ) diff --git a/spec/filters/root_directory_filter_spec.rb b/spec/filters/root_directory_filter_spec.rb index a0c4f523..6345156f 100644 --- a/spec/filters/root_directory_filter_spec.rb +++ b/spec/filters/root_directory_filter_spec.rb @@ -26,9 +26,9 @@ eq( [ { file: "/home/kyrylo/code/airbrake/ruby/spec/spec_helper.rb" }, - { file: "[PROJECT_ROOT]/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb " }, + { file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb " }, { file: "/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb" }, - { file: "[PROJECT_ROOT]/gems/rspec-core-3.3.2/exe/rspec" } + { file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/exe/rspec" } ] ) ) diff --git a/spec/notifier_spec/options_spec.rb b/spec/notifier_spec/options_spec.rb index 2a1bbd5d..36fc4c34 100644 --- a/spec/notifier_spec/options_spec.rb +++ b/spec/notifier_spec/options_spec.rb @@ -75,7 +75,7 @@ def expect_a_request_with_body(body) expect( a_request(:post, endpoint). - with(body: %r|{"file":"\[PROJECT_ROOT\]/airbrake/ruby/spec/airbrake_spec.+|) + with(body: %r|{"file":"/PROJECT_ROOT/airbrake/ruby/spec/airbrake_spec.+|) ).to have_been_made.once end