Class: Omnibus::Cleaner

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/omnibus/cleaner.rb

Instance Method Summary collapse

Constructor Details

#initializeCleaner

Returns a new instance of 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_dirObject



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_dirObject



55
56
57
58
59
# File 'lib/omnibus/cleaner.rb', line 55

def clean_cache_dir
  return unless purge?

  FileSyncer.glob("#{Config.cache_dir}/**/*").each(&method(:remove_file))
end

#clean_install_dirObject



61
62
63
64
65
# File 'lib/omnibus/cleaner.rb', line 61

def clean_install_dir
  return unless purge?

  remove_file(@project.install_dir)
end

#clean_package_dirObject



49
50
51
52
53
# 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_dirObject



41
42
43
# File 'lib/omnibus/cleaner.rb', line 41

def clean_source_dir
  FileSyncer.glob("#{Config.source_dir}/**/*").each(&method(:remove_file))
end