ruby-wunderlist 0.2.pre2 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,17 +41,46 @@ module Wunderlist
41
41
  end)
42
42
  end
43
43
 
44
+ def not_priority
45
+ FilterableList.new(tasks.clone.keep_if do |t|
46
+ !t.important && !t.done
47
+ end)
48
+ end
49
+
44
50
  def done
45
51
  FilterableList.new(tasks.clone.keep_if do |t|
46
52
  t.done == true
47
53
  end)
48
54
  end
49
55
 
56
+ def not_done
57
+ FilterableList.new(tasks.clone.keep_if do |t|
58
+ t.done != true
59
+ end)
60
+ end
61
+
50
62
  def overdue
51
63
  FilterableList.new(tasks.clone.keep_if do |t|
52
64
  t.date && t.date < Date.today && !t.done
53
65
  end)
54
66
  end
67
+
68
+ def not_overdue
69
+ FilterableList.new(tasks.clone.keep_if do |t|
70
+ (!t.date || t.date < Date.today) && !t.done
71
+ end)
72
+ end
73
+
74
+ def to_s
75
+ lines = []
76
+ lines << "[List] [Filtered] #{tasks.count != 1 ? "#{tasks.count} tasks" : "#{tasks.count} task"}"
77
+
78
+ tasks.each do |task|
79
+ lines << " #{task}"
80
+ end
81
+
82
+ lines.join "\n"
83
+ end
55
84
  end
56
85
 
57
86
  class List < FilterableList
@@ -85,5 +114,16 @@ module Wunderlist
85
114
  def flush
86
115
  @tasks = nil
87
116
  end
117
+
118
+ def to_s
119
+ lines = []
120
+ lines << "[List]#{inbox ? " [INBOX]" : ""} #{name} - #{tasks.count != 1 ? (tasks.count.to_s + " tasks") : tasks.count.to_s + " task"}"
121
+
122
+ tasks.each do |task|
123
+ lines << " #{task}"
124
+ end
125
+
126
+ lines.join "\n"
127
+ end
88
128
  end
89
129
  end
@@ -37,4 +37,8 @@ class Wunderlist::Task
37
37
  @api ||= api
38
38
  @api.save self
39
39
  end
40
+
41
+ def to_s
42
+ "[Task]#{done ? " [Done]" : ""}#{important ? " [PRIORITY]" : ""}#{date ? " #{date.to_s}" : ""} - #{name}"
43
+ end
40
44
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-wunderlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.pre2
5
- prerelease: 4
4
+ version: '0.2'
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Fritz Grimpen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-07 00:00:00.000000000 Z
12
+ date: 2011-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &73011030 !ruby/object:Gem::Requirement
16
+ requirement: &71069830 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *73011030
24
+ version_requirements: *71069830
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &73010480 !ruby/object:Gem::Requirement
27
+ requirement: &71069180 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,17 +32,17 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *73010480
35
+ version_requirements: *71069180
36
36
  description:
37
37
  email: fritz+wunderlist@grimpen.net
38
38
  executables: []
39
39
  extensions: []
40
40
  extra_rdoc_files: []
41
41
  files:
42
- - lib/wunderlist.rb
43
- - lib/wunderlist/task.rb
44
42
  - lib/wunderlist/list.rb
43
+ - lib/wunderlist/task.rb
45
44
  - lib/wunderlist/api.rb
45
+ - lib/wunderlist.rb
46
46
  homepage: http://grimpen.net/wunderlist
47
47
  licenses:
48
48
  - MIT
@@ -59,9 +59,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  none: false
61
61
  requirements:
62
- - - ! '>'
62
+ - - ! '>='
63
63
  - !ruby/object:Gem::Version
64
- version: 1.3.1
64
+ version: '0'
65
65
  requirements: []
66
66
  rubyforge_project:
67
67
  rubygems_version: 1.8.11