cleaner: use ObserverPathnameExtension
This commit is contained in:
parent
095d83d10b
commit
3cec3e36e9
@ -8,6 +8,8 @@ class Cleaner
|
|||||||
|
|
||||||
# Create a cleaner for the given formula and clean its keg
|
# Create a cleaner for the given formula and clean its keg
|
||||||
def initialize f
|
def initialize f
|
||||||
|
ObserverPathnameExtension.reset_counts!
|
||||||
|
|
||||||
@f = f
|
@f = f
|
||||||
[f.bin, f.sbin, f.lib].select{ |d| d.exist? }.each{ |d| clean_dir d }
|
[f.bin, f.sbin, f.lib].select{ |d| d.exist? }.each{ |d| clean_dir d }
|
||||||
|
|
||||||
@ -72,7 +74,7 @@ class Cleaner
|
|||||||
# Clean a single folder (non-recursively)
|
# Clean a single folder (non-recursively)
|
||||||
def clean_dir d
|
def clean_dir d
|
||||||
d.find do |path|
|
d.find do |path|
|
||||||
path.extend(NoisyPathname) if ARGV.verbose?
|
path.extend(ObserverPathnameExtension)
|
||||||
|
|
||||||
Find.prune if @f.skip_clean? path
|
Find.prune if @f.skip_clean? path
|
||||||
|
|
||||||
@ -90,10 +92,3 @@ class Cleaner
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module NoisyPathname
|
|
||||||
def unlink
|
|
||||||
puts "rm: #{self}"
|
|
||||||
super
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user