diff options
| -rw-r--r-- | lib/hcl/task.rb | 9 |
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 |
