Skip to content

Commit

Permalink
Move Airbrake::Notice::NOTIFIER to Airbrake::NOTIFIER_INFO
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrylo committed Jul 20, 2020
1 parent 6a48d9c commit 58b4729
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 1 addition & 8 deletions lib/airbrake-ruby/notice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,12 @@ module Airbrake
#
# @since v1.0.0
class Notice
# @return [Hash{Symbol=>String}] the information about the notifier library
NOTIFIER = {
name: 'airbrake-ruby'.freeze,
version: Airbrake::AIRBRAKE_RUBY_VERSION,
url: 'https://github.com/airbrake/airbrake-ruby'.freeze,
}.freeze

# @return [Hash{Symbol=>String,Hash}] the information to be displayed in the
# Context tab in the dashboard
CONTEXT = {
os: RUBY_PLATFORM,
language: "#{RUBY_ENGINE}/#{RUBY_VERSION}".freeze,
notifier: NOTIFIER,
notifier: Airbrake::NOTIFIER_INFO,
}.freeze

# @return [Integer] the maxium size of the JSON payload in bytes
Expand Down
2 changes: 1 addition & 1 deletion lib/airbrake-ruby/sync_sender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def build_request_body(req, data)
req['Authorization'] = "Bearer #{@config.project_key}"
req['Content-Type'] = CONTENT_TYPE
req['User-Agent'] =
"#{Airbrake::Notice::NOTIFIER[:name]}/#{Airbrake::AIRBRAKE_RUBY_VERSION}" \
"#{Airbrake::NOTIFIER_INFO[:name]}/#{Airbrake::AIRBRAKE_RUBY_VERSION}" \
" Ruby/#{RUBY_VERSION}"

req
Expand Down
10 changes: 10 additions & 0 deletions lib/airbrake-ruby/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@
# More information: http://semver.org/
module Airbrake
# @return [String] the library version
# @api public
AIRBRAKE_RUBY_VERSION = '5.0.0.rc.1'.freeze

# @return [Hash{Symbol=>String}] the information about the notifier library
# @since ?.?.?
# @api public
NOTIFIER_INFO = {
name: 'airbrake-ruby'.freeze,
version: Airbrake::AIRBRAKE_RUBY_VERSION,
url: 'https://github.com/airbrake/airbrake-ruby'.freeze,
}.freeze
end

0 comments on commit 58b4729

Please sign in to comment.