inline this method

This commit is contained in:
Adam Vandenberg 2014-02-23 16:46:44 -08:00
parent 88865416e9
commit a78b906389

View File

@ -64,8 +64,19 @@ class Cleaner
end
end
# Clean a single folder (non-recursively)
def clean_dir d
d.find do |path|
path.extend(ObserverPathnameExtension)
Find.prune if @f.skip_clean? path
if path.symlink? or path.directory?
next
elsif path.extname == '.la'
path.unlink
else
# Set permissions for executables and non-executables
def clean_file_permissions path
perms = if path.mach_o_executable? || path.text_executable?
0555
else
@ -79,22 +90,6 @@ class Cleaner
end
path.chmod perms
end
# Removes .la files and fixes file permissions for a directory tree, keeping
# existing files and permissions if instructed to by the formula
def clean_dir d
d.find do |path|
path.extend(ObserverPathnameExtension)
Find.prune if @f.skip_clean? path
if path.symlink? or path.directory?
next
elsif path.extname == '.la'
path.unlink
else
clean_file_permissions(path)
end
end
end