diff options
| -rwxr-xr-x | bin/hcl | 2 | ||||
| -rw-r--r-- | lib/hcl/day_entry.rb | 2 | ||||
| -rw-r--r-- | lib/hcl/task.rb | 10 | 
3 files changed, 9 insertions, 5 deletions
| @@ -1,6 +1,6 @@  #!/usr/bin/env ruby +$:.unshift(File.join(File.dirname(__FILE__), "../lib"))  require 'hcl/app' -  HCl::App.command *ARGV diff --git a/lib/hcl/day_entry.rb b/lib/hcl/day_entry.rb index 3405108..b77d597 100644 --- a/lib/hcl/day_entry.rb +++ b/lib/hcl/day_entry.rb @@ -11,7 +11,7 @@ module HCl      end      def to_s -      "#{client} #{project} #{task} (#{formatted_hours})" +      "#{client} - #{project} - #{task} (#{formatted_hours})"      end      def self.from_xml xml diff --git a/lib/hcl/task.rb b/lib/hcl/task.rb index abd62a7..c2d2ff3 100644 --- a/lib/hcl/task.rb +++ b/lib/hcl/task.rb @@ -9,14 +9,18 @@ module HCl          end)        end        unless tasks.empty? -        File.open(File.join(ENV['HOME'],'.hcl_tasks'), 'w') do |f| +        File.open(cache_file, 'w') do |f|            f.write tasks.uniq.to_yaml          end        end      end +     +    def self.cache_file +      File.join(ENV['HOME'],'.hcl_tasks') +    end      def self.all -      YAML.load File.read(File.join(ENV['HOME'],'.hcl_tasks')) +      File.exists?(cache_file) ? YAML.load(File.read(cache_file)) : []      end      def self.find project_id, id @@ -26,7 +30,7 @@ module HCl      end      def to_s -      "#{project.name} #{name}" +      "#{project.client} - #{project.name} - #{name}"      end      def add opts | 
