Class: Omnibus::Cleaner
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Omnibus::Cleaner
- Includes:
- Thor::Actions
- Defined in:
- lib/omnibus/cleaner.rb
Instance Method Summary collapse
- #clean_build_dir ⇒ Object
- #clean_cache_dir ⇒ Object
- #clean_install_dir ⇒ Object
- #clean_package_dir ⇒ Object
- #clean_source_dir ⇒ Object
-
#initialize ⇒ Cleaner
constructor
A new instance of Cleaner.
Constructor Details
#initialize ⇒ Cleaner
36 37 38 39 |
# File 'lib/omnibus/cleaner.rb', line 36 def initialize(*) super @project = Project.load(name) end |
Instance Method Details
#clean_build_dir ⇒ Object
45 46 47 |
# File 'lib/omnibus/cleaner.rb', line 45 def clean_build_dir FileSyncer.glob("#{Config.build_dir}/**/*").each(&method(:remove_file)) end |
#clean_cache_dir ⇒ Object
54 55 56 57 |
# File 'lib/omnibus/cleaner.rb', line 54 def clean_cache_dir return unless purge? FileSyncer.glob("#{Config.cache_dir}/**/*").each(&method(:remove_file)) end |
#clean_install_dir ⇒ Object
59 60 61 62 |
# File 'lib/omnibus/cleaner.rb', line 59 def clean_install_dir return unless purge? remove_file(@project.install_dir) end |
#clean_package_dir ⇒ Object
49 50 51 52 |
# File 'lib/omnibus/cleaner.rb', line 49 def clean_package_dir return unless purge? FileSyncer.glob("#{Config.package_dir}/**/*").each(&method(:remove_file)) end |
#clean_source_dir ⇒ Object
41 42 43 |
# File 'lib/omnibus/cleaner.rb', line 41 def clean_source_dir FileSyncer.glob("#{Config.source_dir}/**/*").each(&method(:remove_file)) end |