Class: Generamba::CatalogTerminator
- Inherits:
-
Object
- Object
- Generamba::CatalogTerminator
- Defined in:
- lib/generamba/template/helpers/catalog_terminator.rb
Overview
Provides a functionality to terminate all previously installed catalogs
Instance Method Summary collapse
Instance Method Details
#remove_all_catalogs ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/generamba/template/helpers/catalog_terminator.rb', line 7 def remove_all_catalogs catalogs_path = Pathname.new(ENV['HOME']) .join(GENERAMBA_HOME_DIR) .join(CATALOGS_DIR) if Dir.exist?(catalogs_path) == false FileUtils.mkdir_p catalogs_path end catalogs_path.children.select { |child| child.directory? && child.split.last.to_s[0] != '.' }.each { |catalog_path| FileUtils.rm_rf(catalog_path) } end |