Skip to content

Commit

Permalink
Merge pull request #311 from airbrake/project-root-prefix-replacement
Browse files Browse the repository at this point in the history
Replace [PROJECT/GEM_ROOT] with /PROJECT/GEM_ROOT
  • Loading branch information
kyrylo authored Mar 20, 2018
2 parents b00a2e5 + 2e82f1d commit 5af1ce9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/airbrake-ruby/filters/gem_root_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Filters
class GemRootFilter
##
# @return [String]
GEM_ROOT_LABEL = '[GEM_ROOT]'.freeze
GEM_ROOT_LABEL = '/GEM_ROOT'.freeze

##
# @return [Integer]
Expand Down
2 changes: 1 addition & 1 deletion lib/airbrake-ruby/filters/root_directory_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Filters
class RootDirectoryFilter
##
# @return [String]
PROJECT_ROOT_LABEL = '[PROJECT_ROOT]'.freeze
PROJECT_ROOT_LABEL = '/PROJECT_ROOT'.freeze

##
# @return [Integer]
Expand Down
4 changes: 2 additions & 2 deletions spec/airbrake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/filters/gem_root_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
)
)
Expand Down
4 changes: 2 additions & 2 deletions spec/filters/root_directory_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
)
)
Expand Down
2 changes: 1 addition & 1 deletion spec/notifier_spec/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5af1ce9

Please sign in to comment.