Module: LogListener::ActionModule

Defined in:
lib/log-listener/modules/action_module.rb

Constant Summary collapse

FILE_NAME =
"spec_default_log"

Class Method Summary collapse

Class Method Details

.delete_existing_files(name) ⇒ Object



5
6
7
# File 'lib/log-listener/modules/action_module.rb', line 5

def self.delete_existing_files(name)
	File.delete("#{name}") if File.exists?("#{name}")
end

.save_to_archive(path = FILE_NAME, write_this) ⇒ Object



9
10
11
12
13
14
# File 'lib/log-listener/modules/action_module.rb', line 9

def self.save_to_archive(path=FILE_NAME,write_this)
  delete_existing_files("#{path}.log")
  log_file = File.new("#{path}.log", "w+")
	log_file.write "****Start of Line********\n#{write_this.to_s}\n*********End of Line********" 
  log_file.close
end