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

Returns a new instance of Script.



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

def initialize(config_dir)
  @config_dir = config_dir
end

Instance Method Details

#billableObject



16
17
18
# File 'lib/ptimelog/script.rb', line 16

def billable
  @config_dir.join('billable').expand_path
end

#parser(parser_name) ⇒ Object



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

def parser(parser_name)
  @config_dir.join("parsers/#{parser_name}") # FIXME: security-hole, prevent relative paths!
             .expand_path
end