From f02859abaf1397d4df37c23b12646d47a55e5b46 Mon Sep 17 00:00:00 2001 From: Brad Gessler Date: Thu, 7 Nov 2024 16:21:47 -0800 Subject: [PATCH] Renames BlackHole to Vanish for consistency (#820) This commit tidies up the API by making the naming consistent with https://github.com/phlex-ruby/phlex/pull/805 --- lib/phlex.rb | 2 +- lib/phlex/sgml.rb | 4 ++-- lib/phlex/{black_hole.rb => vanish.rb} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename lib/phlex/{black_hole.rb => vanish.rb} (87%) diff --git a/lib/phlex.rb b/lib/phlex.rb index a795a452..29b931a5 100644 --- a/lib/phlex.rb +++ b/lib/phlex.rb @@ -5,7 +5,7 @@ module Phlex autoload :ArgumentError, "phlex/errors/argument_error" - autoload :BlackHole, "phlex/black_hole" + autoload :Vanish, "phlex/vanish" autoload :CSV, "phlex/csv" autoload :Callable, "phlex/callable" autoload :Context, "phlex/context" diff --git a/lib/phlex/sgml.rb b/lib/phlex/sgml.rb index 4d686171..33c9cfa6 100644 --- a/lib/phlex/sgml.rb +++ b/lib/phlex/sgml.rb @@ -235,9 +235,9 @@ def vanish(*args) return unless block_given? if args.length > 0 - @_context.capturing_into(Phlex::BlackHole) { yield(*args) } + @_context.capturing_into(Phlex::Vanish) { yield(*args) } else - @_context.capturing_into(Phlex::BlackHole) { yield(self) } + @_context.capturing_into(Phlex::Vanish) { yield(self) } end nil diff --git a/lib/phlex/black_hole.rb b/lib/phlex/vanish.rb similarity index 87% rename from lib/phlex/black_hole.rb rename to lib/phlex/vanish.rb index 1dd6737e..23579fd9 100644 --- a/lib/phlex/black_hole.rb +++ b/lib/phlex/vanish.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # @api private -module Phlex::BlackHole +module Phlex::Vanish extend self def <<(anything)