Class: Recot::Commands::CurrentClear

Inherits:
Object
  • Object
show all
Defined in:
lib/recot/commands/current_clear.rb

Class Method Summary collapse

Class Method Details

.clearObject

Clear current test no resources.

Set nil to cache after delete resources.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/recot/commands/current_clear.rb', line 13

def self.clear
  # Get current test no.
  test_no = Recot::Cache::StateCache.restore_no
  if test_no
    # Delete resource directory.
    FileUtils.rm_r("#{Recot.resources_dir}/#{test_no}")

    # Delete resource html file.
    FileUtils.rm("#{Recot.resources_dir}/#{test_no}.html")

    # Update index html file.
    Recot::Tasks::IndexdocTask.new.run

    Recot::Cache::StateCache.store_no(nil)
  end
end