gwtf 0.4.5 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,10 @@ command [:list, :ls, :l] do |c|
12
12
  c.default_value false
13
13
  c.switch [:overview, :o]
14
14
 
15
+ c.desc 'Show due and overdue items for all projects'
16
+ c.default_value false
17
+ c.switch [:due]
18
+
15
19
  c.action do |global_options,options,args|
16
20
  if options[:summary]
17
21
  projects = Gwtf.projects(global_options[:data])
@@ -37,15 +41,27 @@ command [:list, :ls, :l] do |c|
37
41
  end
38
42
  puts
39
43
 
44
+ elsif options[:due]
45
+ Gwtf.projects(global_options[:data]).each do |project|
46
+ items = Gwtf::Items.new(File.join(global_options[:data], project), project)
47
+
48
+ items.each_item do |item|
49
+ puts "%s: %s" % [ project, item.to_s ] if item.due?
50
+ end
51
+ end
52
+
40
53
  elsif options[:overview]
41
54
  Gwtf.projects(global_options[:data]).each do |project|
42
55
  items = Gwtf::Items.new(File.join(global_options[:data], project), project)
43
56
 
44
57
  if items.item_ids.size > 0
45
- text = items.list_text(options[:all], true)
46
- puts text if text
58
+ if text = items.list_text(options[:all], true)
59
+ puts text
60
+ puts
61
+ end
47
62
  end
48
63
  end
64
+
49
65
  else
50
66
  puts
51
67
  puts @items.list_text(options[:all])
@@ -36,6 +36,14 @@ module Gwtf
36
36
  end
37
37
  end
38
38
 
39
+ def due?
40
+ if has_due_date? && open?
41
+ return !!(days_till_due <= 1)
42
+ else
43
+ return false
44
+ end
45
+ end
46
+
39
47
  def days_till_due
40
48
  return 1000 unless has_due_date?
41
49
 
@@ -1,3 +1,3 @@
1
1
  module Gwtf
2
- VERSION = '0.4.5'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gwtf
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
9
8
  - 5
10
- version: 0.4.5
9
+ - 0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - R.I.Pienaar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-07 00:00:00 +01:00
18
+ date: 2012-04-08 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency