diff --git a/Library/Homebrew/extend/module.rb b/Library/Homebrew/extend/module.rb index 173bfcc385..8ce9075149 100644 --- a/Library/Homebrew/extend/module.rb +++ b/Library/Homebrew/extend/module.rb @@ -8,11 +8,11 @@ class Module attrs.each do |attr| module_eval <<-EOS, file, line - def #{attr}(val=nil) - @#{attr} ||= nil - return @#{attr} if val.nil? - @#{attr} = val - end + def #{attr}(val=nil) # def prefix(val=nil) + @#{attr} ||= nil # @prefix ||= nil + return @#{attr} if val.nil? # return @prefix if val.nil? + @#{attr} = val # @prefix = val + end # end EOS end end diff --git a/Library/Homebrew/rubocops/cask/ast/stanza.rb b/Library/Homebrew/rubocops/cask/ast/stanza.rb index 85f0de5cc3..e17e849e74 100644 --- a/Library/Homebrew/rubocops/cask/ast/stanza.rb +++ b/Library/Homebrew/rubocops/cask/ast/stanza.rb @@ -58,9 +58,9 @@ module RuboCop Constants::STANZA_ORDER.each do |stanza_name| class_eval <<-RUBY, __FILE__, __LINE__ + 1 - def #{stanza_name}? - stanza_name == :#{stanza_name} - end + def #{stanza_name}? # def url? + stanza_name == :#{stanza_name} # stanza_name == :url + end # end RUBY end end diff --git a/Library/Homebrew/test/support/helper/output_as_tty.rb b/Library/Homebrew/test/support/helper/output_as_tty.rb index 24b25fd89f..1e1dea10da 100644 --- a/Library/Homebrew/test/support/helper/output_as_tty.rb +++ b/Library/Homebrew/test/support/helper/output_as_tty.rb @@ -22,7 +22,7 @@ module Test return super(block) unless @tty colored_tty_block = lambda do - instance_eval("$#{@output}", __FILE__, __LINE__).extend(Module.new do + instance_eval("$#{@output} # $stdout", __FILE__, __LINE__).extend(Module.new do def tty? true end @@ -36,17 +36,17 @@ module Test uncolored_tty_block = lambda do instance_eval <<-EOS, __FILE__, __LINE__ + 1 - begin - captured_stream = StringIO.new + begin # begin + captured_stream = StringIO.new # captured_stream = StringIO.new - original_stream = $#{@output} - $#{@output} = captured_stream + original_stream = $#{@output} # original_stream = $stdout + $#{@output} = captured_stream # $stdout = captured_stream - colored_tty_block.call - ensure - $#{@output} = original_stream - $#{@output}.print Tty.strip_ansi(captured_stream.string) - end + colored_tty_block.call # colored_tty_block.call + ensure # ensure + $#{@output} = original_stream # $stdout = original_stream + $#{@output}.print Tty.strip_ansi(captured_stream.string) # $stdout.print Tty.strip_ansi(captured_stream.string) + end # end EOS end