From 49f48d642915cdd478a28fcf6b57f305f71bbdfd Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 30 Apr 2024 17:29:34 +0200 Subject: [PATCH] vale --- Library/Homebrew/extend/object/duplicable.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/extend/object/duplicable.rb b/Library/Homebrew/extend/object/duplicable.rb index 75a8edfd7aa574..7cb3f4818e721a 100644 --- a/Library/Homebrew/extend/object/duplicable.rb +++ b/Library/Homebrew/extend/object/duplicable.rb @@ -21,8 +21,10 @@ # # That's why we hardcode the following cases and check duplicable? instead of # using that rescue idiom. +# rubocop:disable Layout/EmptyLines +# rubocop:enable Layout/EmptyLines class Object # Can you safely dup this object? # @@ -35,8 +37,10 @@ def duplicable? = true class Method # Methods are not duplicable: # - # method(:puts).duplicable? # => false - # method(:puts).dup # => TypeError: allocator undefined for Method + # ```ruby + # method(:puts).duplicable? # => false + # method(:puts).dup # => TypeError: allocator undefined for Method + # ``` sig { returns(FalseClass) } def duplicable? = false end @@ -44,8 +48,10 @@ def duplicable? = false class UnboundMethod # Unbound methods are not duplicable: # - # method(:puts).unbind.duplicable? # => false - # method(:puts).unbind.dup # => TypeError: allocator undefined for UnboundMethod + # ``ruby + # method(:puts).unbind.duplicable? # => false + # method(:puts).unbind.dup # => TypeError: allocator undefined for UnboundMethod + # ``` sig { returns(FalseClass) } def duplicable? = false end @@ -55,7 +61,9 @@ def duplicable? = false module Singleton # Singleton instances are not duplicable: # - # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton + # ```ruby + # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton + # ``` sig { returns(FalseClass) } def duplicable? = false end