summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorbricooke2010-09-21 14:56:01 -0600
committerbricooke2010-09-21 14:56:01 -0600
commitf83c66059c180c5550dce33a6dfef1af9be6b139 (patch)
tree6a2059edb6082a302ded9523fdfc3393d1c4524b /lib
parent5ec73dbf96e51a8ed918527d79df6081ca6f4eb6 (diff)
downloadhcl-f83c66059c180c5550dce33a6dfef1af9be6b139.tar.bz2
sort tasks before viewing tasks
Diffstat (limited to 'lib')
-rw-r--r--lib/hcl/task.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/hcl/task.rb b/lib/hcl/task.rb
index c2d2ff3..fef3a11 100644
--- a/lib/hcl/task.rb
+++ b/lib/hcl/task.rb
@@ -20,7 +20,14 @@ module HCl
end
def self.all
- File.exists?(cache_file) ? YAML.load(File.read(cache_file)) : []
+ tasks = File.exists?(cache_file) ? YAML.load(File.read(cache_file)) : []
+ tasks = tasks.sort do |a,b|
+ r = a.project.client <=> b.project.client
+ r = a.project.name <=> b.project.name if r == 0
+ r = a.name <=> b.name if r == 0
+ r
+ end
+ tasks
end
def self.find project_id, id