diff options
| author | Zack Hobson | 2009-07-16 13:48:33 -0700 | 
|---|---|---|
| committer | Zack Hobson | 2009-07-16 13:48:33 -0700 | 
| commit | c29b21602ca10aaf98f6aea296d4b9235ae6d291 (patch) | |
| tree | 8900efbe0a3433a6d81e68cb78be3c959af6d60d | |
| parent | 746fec8bc40bb936a86f56b09a49689e7e417021 (diff) | |
| download | hcl-c29b21602ca10aaf98f6aea296d4b9235ae6d291.tar.bz2 | |
allow calls from outside the dev dir
| -rwxr-xr-x | bin/hcl | 1 | ||||
| -rw-r--r-- | lib/hcl.rb | 10 | 
2 files changed, 8 insertions, 3 deletions
| @@ -5,5 +5,6 @@ $:.unshift File.dirname(__FILE__) + '/../ext/harvest/lib'  require 'hcl' +HCl.conf_file = File.dirname(__FILE__) + '/../hcl_conf.yml'  HCl.command *ARGV @@ -8,13 +8,17 @@ require 'hcl/day_entry'  class HCl    class UnknownCommand < StandardError; end +  def self.conf_file= filename +    @@conf_file = filename +  end +    def self.command *args      command = args.shift      unless command        help        return      end -    hcl = new.process_args *args +    hcl = new(@@conf_file).process_args *args      if hcl.respond_to? command        hcl.send command      else @@ -22,8 +26,8 @@ class HCl      end    end -  def initialize -    config = YAML::load(File.read('hcl_conf.yml')) +  def initialize conf_file +    config = YAML::load File.read(conf_file)      TimesheetResource.configure config    end | 
