class Librarian::Action::Clean

Public Instance Methods

run() click to toggle source
# File lib/librarian/action/clean.rb, line 7
def run
  clean_cache_path
  clean_install_path
end

Private Instance Methods

cache_path() click to toggle source
# File lib/librarian/action/clean.rb, line 30
def cache_path
  environment.cache_path
end
clean_cache_path() click to toggle source
# File lib/librarian/action/clean.rb, line 14
def clean_cache_path
  if cache_path.exist?
    debug { "Deleting #{project_relative_path_to(cache_path)}" }
    cache_path.rmtree
  end
end
clean_install_path() click to toggle source
# File lib/librarian/action/clean.rb, line 21
def clean_install_path
  if install_path.exist?
    install_path.children.each do |c|
      debug { "Deleting #{project_relative_path_to(c)}" }
      c.rmtree unless c.file?
    end
  end
end
install_path() click to toggle source
# File lib/librarian/action/clean.rb, line 34
def install_path
  environment.install_path
end
project_relative_path_to(path) click to toggle source
# File lib/librarian/action/clean.rb, line 38
def project_relative_path_to(path)
  environment.project_relative_path_to(path)
end