Class: Ghq::Cache::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/ghq/cache/logger.rb

Constant Summary collapse

LOG_PATH =
File.expand_path('~/.ghq-cache.log')

Class Method Summary collapse

Class Method Details

.log(path) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/ghq/cache/logger.rb', line 9

def log(path)
  initialize_log! unless initialized?

  root = resume
  root.count_path(path)
  save_log(root)
end

.resumeObject



17
18
19
20
21
22
# File 'lib/ghq/cache/logger.rb', line 17

def resume
  initialize_log! unless initialized?

  yaml = File.read(LOG_PATH)
  YAML.load(yaml)
end