Permalink
Browse files

cleaner: simplify verbose pathname extension

  • Loading branch information...
1 parent f7c73bf commit 5471e790ec0cfc300a2de6ef139ee4086224119e @jacknagel jacknagel committed Mar 18, 2013
Showing with 3 additions and 8 deletions.
  1. +3 −8 Library/Homebrew/cleaner.rb
@@ -64,7 +64,7 @@ def clean_file_permissions path
# Clean a single folder (non-recursively)
def clean_dir d
d.find do |path|
- path.extend(NoiseyPathname) if ARGV.verbose?
+ path.extend(NoisyPathname) if ARGV.verbose?
if path.directory?
# Stop cleaning this subtree if protected
@@ -87,14 +87,9 @@ def clean_dir d
end
-
-class Pathname
- alias_method :orig_unlink, :unlink
-end
-
-module NoiseyPathname
+module NoisyPathname
def unlink
puts "rm: #{self}"
- orig_unlink
+ super
end
end

0 comments on commit 5471e79

Please sign in to comment.