gyunyu 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,15 +29,15 @@ simple RTM app for CLI made with Ruby
29
29
  == Filter Howto
30
30
 
31
31
  $ gyunyu -l 仕事 -l 個人
32
- # => list:仕事 and list:個人
32
+ # => (list:仕事 or list:個人)
33
33
 
34
34
  $ gyunyu -l 仕事 -f due:today
35
- # => list:仕事 and due:today
35
+ # => (list:仕事) and (due:today)
36
36
 
37
37
  On 2012-01-05,
38
38
 
39
39
  $ gyunyu -l 個人 -c today
40
- # => list:個人 and dueAfter:2012-01-04T23:59:59Z and dueBefore:2012-01-05T24:00:00Z
40
+ # => (list:個人) and (dueAfter:2012-01-04T23:59:59Z and dueBefore:2012-01-05T24:00:00Z)
41
41
 
42
42
  Even if you live in a timezone other than UTC, you get true today's task list !
43
43
 
@@ -57,6 +57,7 @@ same above
57
57
 
58
58
  * store API token ( and reuse )
59
59
  * only `export' command. supported formats are CSV, JSON, YAML. ( default is CSV )
60
+ * custom filter mainly for short hand of localtime
60
61
 
61
62
  == Not Supported
62
63
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gyunyu}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{wtnabe}]
12
- s.date = %q{2012-01-06}
12
+ s.date = %q{2012-01-08}
13
13
  s.description = %q{now available export command}
14
14
  s.email = %q{wtnabe@gmail.com}
15
15
  s.executables = [%q{gyunyu}]
@@ -39,11 +39,13 @@ Gem::Specification.new do |s|
39
39
  "lib/gyunyu/expander.rb",
40
40
  "lib/gyunyu/token.rb",
41
41
  "spec/app/.gitkeep",
42
+ "spec/app/command/export/app_spec.rb",
42
43
  "spec/app/command/export/custom_filter_spec.rb",
43
44
  "spec/app/command/export/option_spec.rb",
44
45
  "spec/app/command_spec.rb",
45
46
  "spec/app/expander_spec.rb",
46
47
  "spec/spec_helper.rb",
48
+ "spec/support/task_raw_data.rb",
47
49
  "spec/token/token_spec.rb",
48
50
  "tasks/git.rake",
49
51
  "tasks/spec.rake",
@@ -63,7 +63,7 @@ module Gyunyu
63
63
  def build_filter( filter = nil )
64
64
  filters = []
65
65
 
66
- filters << option.lists.map { |l| "list:#{l}" }.join(' and ') if option.lists.size > 0
66
+ filters << option.lists.map { |l| "list:#{l}" }.join(' or ') if option.lists.size > 0
67
67
  filters << CustomFilter.filter[option.custom_filter] if option.custom_filter
68
68
  filters << option.filter if option.filter
69
69
  filters << filter if filter
@@ -0,0 +1,42 @@
1
+ # -*- coding: utf-8 -*-
2
+ require File.dirname(__FILE__) + '/../../../spec_helper'
3
+
4
+ describe Gyunyu::Command::Export::App do
5
+ let(:app) { Gyunyu::Command::Export::App.new }
6
+
7
+ describe 'build_filter' do
8
+ subject {
9
+ app.build_filter
10
+ }
11
+
12
+ context 'multiple list' do
13
+ before {
14
+ app._init_option( %w( -l 仕事 -l 個人 ) )
15
+ }
16
+ it {
17
+ should == '(list:仕事 or list:個人)'
18
+ }
19
+ end
20
+ context 'custom filter and list' do
21
+ before {
22
+ Gyunyu::Command::Export::CustomFilter.class_eval {
23
+ def self.today
24
+ Date.parse('2012-01-05')
25
+ end
26
+ }
27
+ app._init_option( %w( -l 仕事 -c this_week ) )
28
+ }
29
+ it {
30
+ should == '(list:仕事) and (dueAfter:2011-12-31T23:59:59Z and dueBefore:2012-01-07T24:00:00Z)'
31
+ }
32
+ end
33
+ context 'multiple list and filter' do
34
+ before {
35
+ app._init_option( %w( -l 仕事 -l 個人 -f status:completed ) )
36
+ }
37
+ it {
38
+ should == '(list:仕事 or list:個人) and (status:completed)'
39
+ }
40
+ end
41
+ end
42
+ end
@@ -62,79 +62,3 @@ describe Gyunyu::Expander do
62
62
  }
63
63
  end
64
64
  end
65
-
66
- def task_raw_data
67
- # [{'id' => list id,
68
- # 'taskseries' =>
69
- # []
70
- # }]
71
- [{"id"=>"135243",
72
- "taskseries"=>
73
- [{"id"=>"118872028",
74
- "created"=>"2011-05-28T01:04:49Z",
75
- "modified"=>"2011-10-10T22:00:53Z",
76
- "name"=>"jsのlintについて",
77
- "source"=>"js",
78
- "url"=>"",
79
- "location_id"=>"",
80
- "tags"=>[{"tag"=>["research", "writing"]}],
81
- "participants"=>[{}],
82
- "notes"=>
83
- [{"note"=>
84
- [{"id"=>"26111105",
85
- "created"=>"2011-10-10T22:00:53Z",
86
- "modified"=>"2011-10-10T22:00:53Z",
87
- "title"=>"",
88
- "content"=>"意図が分かんないな、このメモ。結局何をしたかった?"}]}],
89
- "task"=>
90
- [{"id"=>"181820465",
91
- "due"=>"",
92
- "has_due_time"=>"0",
93
- "added"=>"2011-05-28T01:04:49Z",
94
- "completed"=>"",
95
- "deleted"=>"",
96
- "priority"=>"1",
97
- "postponed"=>"0",
98
- "estimate"=>""}]},
99
- {"id"=>"46116936",
100
- "created"=>"2009-08-01T08:35:30Z",
101
- "modified"=>"2010-05-10T03:18:43Z",
102
- "name"=>"あの本読む",
103
- "source"=>"js",
104
- "url"=>"",
105
- "location_id"=>"",
106
- "tags"=>[{"tag"=>["reading"]}],
107
- "participants"=>[{}],
108
- "notes"=>[{}],
109
- "task"=>
110
- [{"id"=>"65881131",
111
- "due"=>"",
112
- "has_due_time"=>"0",
113
- "added"=>"2009-08-01T08:35:30Z",
114
- "completed"=>"",
115
- "deleted"=>"",
116
- "priority"=>"N",
117
- "postponed"=>"0",
118
- "estimate"=>"1時間"}]},
119
- {"id"=>"115609158",
120
- "created"=>"2011-05-02T10:13:47Z",
121
- "modified"=>"2011-05-07T12:26:43Z",
122
- "name"=>"この本読む",
123
- "source"=>"js",
124
- "url"=>"",
125
- "location_id"=>"",
126
- "tags"=>[{"tag"=>["reading"]}],
127
- "participants"=>[{}],
128
- "notes"=>[{}],
129
- "task"=>
130
- [{"id"=>"176273444",
131
- "due"=>"",
132
- "has_due_time"=>"0",
133
- "added"=>"2011-05-02T10:13:47Z",
134
- "completed"=>"",
135
- "deleted"=>"",
136
- "priority"=>"1",
137
- "postponed"=>"0",
138
- "estimate"=>"8h"}]}
139
- ]}]
140
- end
@@ -0,0 +1,76 @@
1
+ # -*- coding: utf-8 -*-
2
+ def task_raw_data
3
+ # [{'id' => list id,
4
+ # 'taskseries' =>
5
+ # []
6
+ # }]
7
+ [{"id"=>"135243",
8
+ "taskseries"=>
9
+ [{"id"=>"118872028",
10
+ "created"=>"2011-05-28T01:04:49Z",
11
+ "modified"=>"2011-10-10T22:00:53Z",
12
+ "name"=>"jsのlintについて",
13
+ "source"=>"js",
14
+ "url"=>"",
15
+ "location_id"=>"",
16
+ "tags"=>[{"tag"=>["research", "writing"]}],
17
+ "participants"=>[{}],
18
+ "notes"=>
19
+ [{"note"=>
20
+ [{"id"=>"26111105",
21
+ "created"=>"2011-10-10T22:00:53Z",
22
+ "modified"=>"2011-10-10T22:00:53Z",
23
+ "title"=>"",
24
+ "content"=>"意図が分かんないな、このメモ。結局何をしたかった?"}]}],
25
+ "task"=>
26
+ [{"id"=>"181820465",
27
+ "due"=>"",
28
+ "has_due_time"=>"0",
29
+ "added"=>"2011-05-28T01:04:49Z",
30
+ "completed"=>"",
31
+ "deleted"=>"",
32
+ "priority"=>"1",
33
+ "postponed"=>"0",
34
+ "estimate"=>""}]},
35
+ {"id"=>"46116936",
36
+ "created"=>"2009-08-01T08:35:30Z",
37
+ "modified"=>"2010-05-10T03:18:43Z",
38
+ "name"=>"あの本読む",
39
+ "source"=>"js",
40
+ "url"=>"",
41
+ "location_id"=>"",
42
+ "tags"=>[{"tag"=>["reading"]}],
43
+ "participants"=>[{}],
44
+ "notes"=>[{}],
45
+ "task"=>
46
+ [{"id"=>"65881131",
47
+ "due"=>"",
48
+ "has_due_time"=>"0",
49
+ "added"=>"2009-08-01T08:35:30Z",
50
+ "completed"=>"",
51
+ "deleted"=>"",
52
+ "priority"=>"N",
53
+ "postponed"=>"0",
54
+ "estimate"=>"1時間"}]},
55
+ {"id"=>"115609158",
56
+ "created"=>"2011-05-02T10:13:47Z",
57
+ "modified"=>"2011-05-07T12:26:43Z",
58
+ "name"=>"この本読む",
59
+ "source"=>"js",
60
+ "url"=>"",
61
+ "location_id"=>"",
62
+ "tags"=>[{"tag"=>["reading"]}],
63
+ "participants"=>[{}],
64
+ "notes"=>[{}],
65
+ "task"=>
66
+ [{"id"=>"176273444",
67
+ "due"=>"",
68
+ "has_due_time"=>"0",
69
+ "added"=>"2011-05-02T10:13:47Z",
70
+ "completed"=>"",
71
+ "deleted"=>"",
72
+ "priority"=>"1",
73
+ "postponed"=>"0",
74
+ "estimate"=>"8h"}]}
75
+ ]}]
76
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gyunyu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-06 00:00:00.000000000Z
12
+ date: 2012-01-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rtmilk
16
- requirement: &3042960 !ruby/object:Gem::Requirement
16
+ requirement: &3036600 !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: *3042960
24
+ version_requirements: *3036600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: xml-simple
27
- requirement: &3042710 !ruby/object:Gem::Requirement
27
+ requirement: &3036310 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *3042710
35
+ version_requirements: *3036310
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rtm-time
38
- requirement: &3042410 !ruby/object:Gem::Requirement
38
+ requirement: &3036010 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *3042410
46
+ version_requirements: *3036010
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &3042170 !ruby/object:Gem::Requirement
49
+ requirement: &3035720 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.3.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *3042170
57
+ version_requirements: *3035720
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &3041880 !ruby/object:Gem::Requirement
60
+ requirement: &3035480 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.0.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *3041880
68
+ version_requirements: *3035480
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &3041620 !ruby/object:Gem::Requirement
71
+ requirement: &3035180 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.6.4
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *3041620
79
+ version_requirements: *3035180
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &3041380 !ruby/object:Gem::Requirement
82
+ requirement: &3034880 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *3041380
90
+ version_requirements: *3034880
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rcov
93
- requirement: &3041140 !ruby/object:Gem::Requirement
93
+ requirement: &3034590 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *3041140
101
+ version_requirements: *3034590
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rr
104
- requirement: &3040840 !ruby/object:Gem::Requirement
104
+ requirement: &3034320 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *3040840
112
+ version_requirements: *3034320
113
113
  description: now available export command
114
114
  email: wtnabe@gmail.com
115
115
  executables:
@@ -140,11 +140,13 @@ files:
140
140
  - lib/gyunyu/expander.rb
141
141
  - lib/gyunyu/token.rb
142
142
  - spec/app/.gitkeep
143
+ - spec/app/command/export/app_spec.rb
143
144
  - spec/app/command/export/custom_filter_spec.rb
144
145
  - spec/app/command/export/option_spec.rb
145
146
  - spec/app/command_spec.rb
146
147
  - spec/app/expander_spec.rb
147
148
  - spec/spec_helper.rb
149
+ - spec/support/task_raw_data.rb
148
150
  - spec/token/token_spec.rb
149
151
  - tasks/git.rake
150
152
  - tasks/spec.rake
@@ -164,7 +166,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
166
  version: '0'
165
167
  segments:
166
168
  - 0
167
- hash: 1021094161
169
+ hash: 682981779
168
170
  required_rubygems_version: !ruby/object:Gem::Requirement
169
171
  none: false
170
172
  requirements: