Skip to content

Instantly share code, notes, and snippets.

@archaelus
Created October 7, 2009 23:09
Show Gist options
  • Select an option

  • Save archaelus/204537 to your computer and use it in GitHub Desktop.

Select an option

Save archaelus/204537 to your computer and use it in GitHub Desktop.
class Cleaner
def initialize f
@f=f
# correct common issues
share=f.prefix+'share'
(f.prefix+'man').mv share rescue nil
[f.bin, f.sbin, f.lib].each {|d| clean_dir d}
# you can read all of this stuff online nowadays, save the space
# info pages are pants, everyone agrees apart from Richard Stallman
# feel free to ask for build options though! http://bit.ly/Homebrew
[(f.prefix+'share'+'doc'),
(f.prefix+'share'+'info'),
(f.prefix+'doc'),
(f.prefix+'docs'),
(f.prefix+'info')
].each {|dir|
unless f.skip_clean? dir
dir.rmtree rescue nil
end
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment