Class: Terraspace::CLI::Clean::All

Inherits:
Base
  • Object
show all
Defined in:
lib/terraspace/cli/clean/all.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Util::Pretty

#pretty_path, #pretty_time

Methods included from Util::Sure

#sure?

Methods included from Util::Logging

#logger

Constructor Details

This class inherits a constructor from Terraspace::CLI::Base

Instance Method Details

#are_you_sure?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'lib/terraspace/cli/clean/all.rb', line 10

def are_you_sure?
  message = <<~EOL.chomp
    Will remove Terraspace cache and logs.
    Are you sure?
  EOL
  sure?(message) # from Util::Sure
end

#runObject



3
4
5
6
7
8
# File 'lib/terraspace/cli/clean/all.rb', line 3

def run
  are_you_sure?
  o = @options.merge(yes: true) # override to avoid double prompt
  Cache.new(o).run
  Logs.new(o).run
end