Class: Wloger::PastLogFile

Inherits:
Base::LogFile show all
Defined in:
lib/wloger/past_log_file.rb

Overview

past log file class In case, this class operate today log file.

Constant Summary

Constants inherited from Base::LogFile

Base::LogFile::DIR_NAME, Base::LogFile::EDITOR_NAME, Base::LogFile::LOG_DIR_NAME, Base::LogFile::LOG_EXTENTION, Base::LogFile::LOG_NAME, Base::LogFile::PARENT_DIR_NAME

Instance Method Summary collapse

Methods inherited from Base::LogFile

#initialize

Constructor Details

This class inherits a constructor from Wloger::Base::LogFile

Instance Method Details

#grep(key) ⇒ Object



10
11
12
13
# File 'lib/wloger/past_log_file.rb', line 10

def grep(key)
  array = File.readlines(@log_path).grep(/#{key}/)
  [@date].product(array)
end

#viewObject



5
6
7
8
# File 'lib/wloger/past_log_file.rb', line 5

def view
  Wloger::Error.no_log_file(@date) unless File.exist?(@log_path)
  system("#{EDITOR_NAME} #{@log_path}")
end