Class: Ptimelog::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/ptimelog/script.rb

Overview

Wrapper around all external scripts that might be called to get more information about the time-entries

Instance Method Summary collapse

Constructor Details

#initialize(config_dir) ⇒ Script



7
8
9
# File 'lib/ptimelog/script.rb', line 7

def initialize(config_dir)
  @config_dir = config_dir
end

Instance Method Details

#inferer(name) ⇒ Object



11
12
13
14
15
16
# File 'lib/ptimelog/script.rb', line 11

def inferer(name)
  return NullPathname.new if name.to_s.empty?
  raise if name =~ %r{[\\/]} # prevent relavtive paths, stupidly, FIXME: really check FS

  @config_dir.join('inferers').join(name).expand_path
end