From 9e208734bbe38f7702f34ff55fd28d49ef6f8a0f Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Wed, 12 Aug 2020 17:20:52 +0800 Subject: [PATCH] config: drop support for `blacklist_keys` & `whitelist_keys` Fixes #602 --- CHANGELOG.md | 2 ++ lib/airbrake-ruby/config.rb | 26 -------------------------- spec/config_spec.rb | 28 ---------------------------- 3 files changed, 2 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bfc8a46..1f529dde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Airbrake Ruby Changelog * Dropped support for `:start_time` & `:end_time` params for APM methods such as `Airbrake.notify_request` ([#609](https://github.com/airbrake/airbrake-ruby/pull/609)) +* Dropped support for `blacklist_keys` & `whitelit_keys` + ([#610](https://github.com/airbrake/airbrake-ruby/pull/610)) ### [v5.0.0.rc.2][v5.0.0.rc.2] (July 29, 2020) diff --git a/lib/airbrake-ruby/config.rb b/lib/airbrake-ruby/config.rb index 01dc47b2..6f317b65 100644 --- a/lib/airbrake-ruby/config.rb +++ b/lib/airbrake-ruby/config.rb @@ -4,7 +4,6 @@ module Airbrake # # @api public # @since v1.0.0 - # rubocop:disable Metrics/ClassLength class Config # @return [Integer] the project identificator. This value *must* be set. # @api public @@ -83,18 +82,12 @@ class Config # @since v4.15.0 attr_accessor :allowlist_keys - # @deprecated Use allowlist_keys instead - alias whitelist_keys allowlist_keys - # @return [Array] the keys, which should be # filtered # @api public # @since v4.15.0 attr_accessor :blocklist_keys - # @deprecated Use blocklist_keys instead - alias blacklist_keys blocklist_keys - # @return [Boolean] true if the library should attach code hunks to each # frame in a backtrace, false otherwise # @api public @@ -185,24 +178,6 @@ def initialize(user_config = {}) end # rubocop:enable Metrics/AbcSize - def blacklist_keys=(keys) - loc = caller_locations(1..1).first - Kernel.warn( - "#{loc.path}:#{loc.lineno}: warning: blacklist_keys= is deprecated " \ - "use blocklist_keys= instead", - ) - self.blocklist_keys = keys - end - - def whitelist_keys=(keys) - loc = caller_locations(1..1).first - Kernel.warn( - "#{loc.path}:#{loc.lineno}: warning: whitelist_keys= is deprecated " \ - "use allowlist_keys= instead", - ) - self.allowlist_keys = keys - end - # The full URL to the Airbrake Notice API. Based on the +:error_host+ option. # @return [URI] the endpoint address def error_endpoint @@ -288,5 +263,4 @@ def set_option(option, value) raise Airbrake::Error, "unknown option '#{option}'" end end - # rubocop:enable Metrics/ClassLength end diff --git a/spec/config_spec.rb b/spec/config_spec.rb index a9e05a89..0576ea48 100644 --- a/spec/config_spec.rb +++ b/spec/config_spec.rb @@ -173,32 +173,4 @@ expect(subject.logger.level).to eq(Logger::WARN) end end - - describe "#blacklist_keys=" do - before { allow(Kernel).to receive(:warn) } - - it "sets blocklist_keys instead" do - subject.blacklist_keys = [1, 2, 3] - expect(subject.blocklist_keys).to eq([1, 2, 3]) - end - - it "prints a warning" do - expect(Kernel).to receive(:warn).with(/use blocklist_keys= instead/) - subject.blacklist_keys = [1, 2, 3] - end - end - - describe "#whitelist_keys=" do - before { allow(Kernel).to receive(:warn) } - - it "sets allowlist_keys instead" do - subject.whitelist_keys = [1, 2, 3] - expect(subject.allowlist_keys).to eq([1, 2, 3]) - end - - it "prints a warning" do - expect(Kernel).to receive(:warn).with(/use allowlist_keys= instead/) - subject.whitelist_keys = [1, 2, 3] - end - end end