redpomo-reloaded 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/Dockerfile +5 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +139 -0
  5. data/Guardfile +23 -0
  6. data/LICENSE +22 -0
  7. data/README.md +176 -0
  8. data/Rakefile +6 -0
  9. data/bin/redpomo +7 -0
  10. data/docker-compose.yml +7 -0
  11. data/lib/redpomo.rb +10 -0
  12. data/lib/redpomo/cli.rb +172 -0
  13. data/lib/redpomo/config.rb +26 -0
  14. data/lib/redpomo/entries_printer.rb +33 -0
  15. data/lib/redpomo/entry.rb +65 -0
  16. data/lib/redpomo/file_cache.rb +44 -0
  17. data/lib/redpomo/fuzzy_converter.rb +68 -0
  18. data/lib/redpomo/issue.rb +38 -0
  19. data/lib/redpomo/null_cache.rb +9 -0
  20. data/lib/redpomo/numeric_ext.rb +30 -0
  21. data/lib/redpomo/task.rb +103 -0
  22. data/lib/redpomo/task_list.rb +61 -0
  23. data/lib/redpomo/templates/config.yml +47 -0
  24. data/lib/redpomo/templates/issue_stub.textile +7 -0
  25. data/lib/redpomo/tracker.rb +175 -0
  26. data/lib/redpomo/ui.rb +73 -0
  27. data/lib/redpomo/version.rb +3 -0
  28. data/redpomo.gemspec +33 -0
  29. data/spec/file_cache_spec.rb +22 -0
  30. data/spec/fixtures/add_results.txt +4 -0
  31. data/spec/fixtures/cassettes/cli_add.yml +102 -0
  32. data/spec/fixtures/cassettes/cli_close.yml +50 -0
  33. data/spec/fixtures/cassettes/cli_pull.yml +1222 -0
  34. data/spec/fixtures/cassettes/cli_push.yml +297 -0
  35. data/spec/fixtures/cassettes/close_issue.yml +50 -0
  36. data/spec/fixtures/cassettes/create_issue.yml +102 -0
  37. data/spec/fixtures/cassettes/issues.yml +449 -0
  38. data/spec/fixtures/cassettes/push_entry.yml +55 -0
  39. data/spec/fixtures/close_results.txt +2 -0
  40. data/spec/fixtures/config.yml +16 -0
  41. data/spec/fixtures/printer_output.txt +16 -0
  42. data/spec/fixtures/proper_timelog.csv +4 -0
  43. data/spec/fixtures/pull_results.txt +20 -0
  44. data/spec/fixtures/tasks.txt +3 -0
  45. data/spec/fixtures/timelog.csv +6 -0
  46. data/spec/integration/add_spec.rb +29 -0
  47. data/spec/integration/init_spec.rb +33 -0
  48. data/spec/lib/redpomo/cli_spec.rb +91 -0
  49. data/spec/lib/redpomo/entry_spec.rb +23 -0
  50. data/spec/lib/redpomo/fuzzy_converter_spec.rb +65 -0
  51. data/spec/lib/redpomo/task_spec.rb +39 -0
  52. data/spec/lib/redpomo/tracker_spec.rb +72 -0
  53. data/spec/spec_helper.rb +28 -0
  54. data/spec/support/cli_helpers.rb +76 -0
  55. data/spec/support/fixtures.rb +24 -0
  56. data/spec/support/ruby_ext.rb +20 -0
  57. data/spec/tmp/REDME.md +0 -0
  58. metadata +296 -0
@@ -0,0 +1,297 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://project.cantierecreativo.net/projects/giunti-web.json?key=CANTIERE_TOKEN
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Mon, 25 Jun 2012 18:49:26 GMT
25
+ Server:
26
+ - Apache/2.2.9 (Debian) DAV/2 PHP/5.2.6-1+lenny10 with Suhosin-Patch mod_python/3.3.1
27
+ Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g Phusion_Passenger/3.0.0
28
+ X-Powered-By:
29
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
30
+ Etag:
31
+ - ! '"65d33299faf455805a802660e349d516"'
32
+ X-Runtime:
33
+ - '17'
34
+ Cache-Control:
35
+ - private, max-age=0, must-revalidate
36
+ Content-Length:
37
+ - '241'
38
+ Status:
39
+ - '200'
40
+ Content-Type:
41
+ - application/json; charset=utf-8
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ! '{"project":{"parent":{"name":"LCD (Gianni Sinni)","id":55},"updated_on":"2012/03/14
45
+ 21:52:12 +0100","description":"","created_on":"2012/03/14 21:52:12 +0100","identifier":"giunti-web","name":"Sito
46
+ Giunti Educational ","id":56,"homepage":""}}'
47
+ http_version:
48
+ recorded_at: Mon, 25 Jun 2012 18:49:27 GMT
49
+ - request:
50
+ method: get
51
+ uri: http://code.welaika.com/issues/3293.json?key=WELAIKA_TOKEN
52
+ body:
53
+ encoding: US-ASCII
54
+ string: ''
55
+ headers:
56
+ Accept:
57
+ - application/json
58
+ Accept-Encoding:
59
+ - gzip, deflate
60
+ Content-Type:
61
+ - application/json
62
+ User-Agent:
63
+ - Ruby
64
+ response:
65
+ status:
66
+ code: 200
67
+ message: OK
68
+ headers:
69
+ Date:
70
+ - Mon, 25 Jun 2012 18:49:27 GMT
71
+ Server:
72
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9
73
+ OpenSSL/0.9.8g Phusion_Passenger/3.0.0
74
+ X-Powered-By:
75
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
76
+ Etag:
77
+ - ! '"e96d810afab9370460405d2b1279b664"'
78
+ X-Runtime:
79
+ - '40'
80
+ Cache-Control:
81
+ - private, max-age=0, must-revalidate
82
+ Content-Length:
83
+ - '447'
84
+ Status:
85
+ - '200'
86
+ Content-Type:
87
+ - application/json; charset=utf-8
88
+ body:
89
+ encoding: US-ASCII
90
+ string: ! '{"issue":{"status":{"name":"Closed","id":5},"updated_on":"2012/05/07
91
+ 17:02:13 +0200","assigned_to":{"name":"Stefano Verna","id":4},"done_ratio":100,"description":"","tracker":{"name":"Feature","id":2},"start_date":"2012/04/27","created_on":"2012/04/27
92
+ 18:15:23 +0200","spent_hours":4.2152778208256,"subject":"Ricette","author":{"name":"Stefano
93
+ Verna","id":4},"id":3293,"priority":{"name":"Normal","id":4},"project":{"name":"Olasagasti
94
+ ","id":52}}}'
95
+ http_version:
96
+ recorded_at: Mon, 25 Jun 2012 18:49:27 GMT
97
+ - request:
98
+ method: get
99
+ uri: https://project.cantierecreativo.net/projects/giunti-web.json?key=CANTIERE_TOKEN
100
+ body:
101
+ encoding: US-ASCII
102
+ string: ''
103
+ headers:
104
+ Accept:
105
+ - application/json
106
+ Accept-Encoding:
107
+ - gzip, deflate
108
+ Content-Type:
109
+ - application/json
110
+ User-Agent:
111
+ - Ruby
112
+ response:
113
+ status:
114
+ code: 200
115
+ message: OK
116
+ headers:
117
+ Date:
118
+ - Mon, 25 Jun 2012 18:49:27 GMT
119
+ Server:
120
+ - Apache/2.2.9 (Debian) DAV/2 PHP/5.2.6-1+lenny10 with Suhosin-Patch mod_python/3.3.1
121
+ Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g Phusion_Passenger/3.0.0
122
+ X-Powered-By:
123
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
124
+ Etag:
125
+ - ! '"65d33299faf455805a802660e349d516"'
126
+ X-Runtime:
127
+ - '21'
128
+ Cache-Control:
129
+ - private, max-age=0, must-revalidate
130
+ Content-Length:
131
+ - '241'
132
+ Status:
133
+ - '200'
134
+ Content-Type:
135
+ - application/json; charset=utf-8
136
+ body:
137
+ encoding: US-ASCII
138
+ string: ! '{"project":{"parent":{"name":"LCD (Gianni Sinni)","id":55},"updated_on":"2012/03/14
139
+ 21:52:12 +0100","description":"","created_on":"2012/03/14 21:52:12 +0100","identifier":"giunti-web","name":"Sito
140
+ Giunti Educational ","id":56,"homepage":""}}'
141
+ http_version:
142
+ recorded_at: Mon, 25 Jun 2012 18:49:27 GMT
143
+ - request:
144
+ method: post
145
+ uri: https://project.cantierecreativo.net/time_entries.json?key=CANTIERE_TOKEN
146
+ body:
147
+ encoding: US-ASCII
148
+ string: ! '{"time_entry":{"project_id":"giunti-web","spent_on":"2012-05-02T08:10:08+00:00","hours":0.08333333333333333,"comments":"Layout
149
+ homepage e contatti"}}'
150
+ headers:
151
+ Accept:
152
+ - application/json
153
+ Accept-Encoding:
154
+ - gzip, deflate
155
+ Content-Type:
156
+ - application/json
157
+ Content-Length:
158
+ - '149'
159
+ User-Agent:
160
+ - Ruby
161
+ response:
162
+ status:
163
+ code: 201
164
+ message: Created
165
+ headers:
166
+ Date:
167
+ - Mon, 25 Jun 2012 18:49:27 GMT
168
+ Server:
169
+ - Apache/2.2.9 (Debian) DAV/2 PHP/5.2.6-1+lenny10 with Suhosin-Patch mod_python/3.3.1
170
+ Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g Phusion_Passenger/3.0.0
171
+ X-Powered-By:
172
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
173
+ X-Runtime:
174
+ - '65'
175
+ Cache-Control:
176
+ - no-cache
177
+ Set-Cookie:
178
+ - _redmine_session=BAh7BjoPc2Vzc2lvbl9pZCIlZTlhMGZjM2RhNGJlNWZlNzgzYzA0MWRiYjdkODQ0Y2Y%3D--c177e9142b00003b7a458d3f998b8c69a011cd9a;
179
+ path=/; HttpOnly
180
+ - autologin=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
181
+ Location:
182
+ - https://project.cantierecreativo.net/time_entries/1067
183
+ Content-Length:
184
+ - '335'
185
+ Status:
186
+ - '201'
187
+ Content-Type:
188
+ - application/json; charset=utf-8
189
+ body:
190
+ encoding: US-ASCII
191
+ string: ! '{"time_entry":{"hours":0.0833333333333333,"activity":{"name":"da
192
+ valutare","id":15},"updated_on":"2012/06/25 20:49:27 +0200","comments":"Layout
193
+ homepage e contatti","spent_on":"2012/05/02","user":{"name":"Stefano Verna","id":18},"created_on":"2012/06/25
194
+ 20:49:27 +0200","project":{"name":"Sito Giunti Educational ","id":56},"id":1067}}'
195
+ http_version:
196
+ recorded_at: Mon, 25 Jun 2012 18:49:27 GMT
197
+ - request:
198
+ method: get
199
+ uri: http://code.welaika.com/issues/3293.json?key=WELAIKA_TOKEN
200
+ body:
201
+ encoding: US-ASCII
202
+ string: ''
203
+ headers:
204
+ Accept:
205
+ - application/json
206
+ Accept-Encoding:
207
+ - gzip, deflate
208
+ Content-Type:
209
+ - application/json
210
+ User-Agent:
211
+ - Ruby
212
+ response:
213
+ status:
214
+ code: 200
215
+ message: OK
216
+ headers:
217
+ Date:
218
+ - Mon, 25 Jun 2012 18:49:27 GMT
219
+ Server:
220
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9
221
+ OpenSSL/0.9.8g Phusion_Passenger/3.0.0
222
+ X-Powered-By:
223
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
224
+ Etag:
225
+ - ! '"e96d810afab9370460405d2b1279b664"'
226
+ X-Runtime:
227
+ - '36'
228
+ Cache-Control:
229
+ - private, max-age=0, must-revalidate
230
+ Content-Length:
231
+ - '447'
232
+ Status:
233
+ - '200'
234
+ Content-Type:
235
+ - application/json; charset=utf-8
236
+ body:
237
+ encoding: US-ASCII
238
+ string: ! '{"issue":{"status":{"name":"Closed","id":5},"updated_on":"2012/05/07
239
+ 17:02:13 +0200","assigned_to":{"name":"Stefano Verna","id":4},"done_ratio":100,"description":"","tracker":{"name":"Feature","id":2},"start_date":"2012/04/27","created_on":"2012/04/27
240
+ 18:15:23 +0200","spent_hours":4.2152778208256,"subject":"Ricette","author":{"name":"Stefano
241
+ Verna","id":4},"id":3293,"priority":{"name":"Normal","id":4},"project":{"name":"Olasagasti
242
+ ","id":52}}}'
243
+ http_version:
244
+ recorded_at: Mon, 25 Jun 2012 18:49:28 GMT
245
+ - request:
246
+ method: post
247
+ uri: http://code.welaika.com/time_entries.json?key=WELAIKA_TOKEN
248
+ body:
249
+ encoding: US-ASCII
250
+ string: ! '{"time_entry":{"issue_id":3293,"spent_on":"2012-05-04T15:04:57+00:00","hours":0.08333333333333333,"comments":"Ricette"}}'
251
+ headers:
252
+ Accept:
253
+ - application/json
254
+ Accept-Encoding:
255
+ - gzip, deflate
256
+ Content-Type:
257
+ - application/json
258
+ Content-Length:
259
+ - '120'
260
+ User-Agent:
261
+ - Ruby
262
+ response:
263
+ status:
264
+ code: 201
265
+ message: Created
266
+ headers:
267
+ Date:
268
+ - Mon, 25 Jun 2012 18:49:28 GMT
269
+ Server:
270
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9
271
+ OpenSSL/0.9.8g Phusion_Passenger/3.0.0
272
+ X-Powered-By:
273
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
274
+ X-Runtime:
275
+ - '184'
276
+ Cache-Control:
277
+ - no-cache
278
+ Set-Cookie:
279
+ - _redmine_session=BAh7BjoPc2Vzc2lvbl9pZCIlYzYwYzNlOWFjZmM3NjIyOThlZmEzMGE4MjE4N2IyZjE%3D--07438999f23ae8a8c673302f979759a67f640430;
280
+ path=/; HttpOnly
281
+ Location:
282
+ - http://code.welaika.com/time_entries/4501
283
+ Content-Length:
284
+ - '321'
285
+ Status:
286
+ - '201'
287
+ Content-Type:
288
+ - application/json; charset=utf-8
289
+ body:
290
+ encoding: US-ASCII
291
+ string: ! '{"time_entry":{"spent_on":"2012/05/04","updated_on":"2012/06/25 20:49:28
292
+ +0200","activity":{"name":"Development","id":9},"user":{"name":"Stefano Verna","id":4},"created_on":"2012/06/25
293
+ 20:49:28 +0200","hours":0.0833333333333333,"comments":"Ricette","issue":{"id":3293},"id":4501,"project":{"name":"Olasagasti
294
+ ","id":52}}}'
295
+ http_version:
296
+ recorded_at: Mon, 25 Jun 2012 18:49:28 GMT
297
+ recorded_with: VCR 2.0.1
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://code.welaika.com/issues/3290.json?key=WELAIKA_TOKEN
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"issue":{"status_id":5,"notes":"foobar"}}'
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '42'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Sat, 05 May 2012 12:30:14 GMT
27
+ Server:
28
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9
29
+ OpenSSL/0.9.8g Phusion_Passenger/3.0.0
30
+ X-Powered-By:
31
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
32
+ X-Runtime:
33
+ - '396'
34
+ Cache-Control:
35
+ - no-cache
36
+ Set-Cookie:
37
+ - _redmine_session=BAh7BzoPc2Vzc2lvbl9pZCIlMjFjM2E3NWM3YTkzYzg5OTI5NTdmNWQzMzZiNmQ5NzYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlIhlNb2RpZmljYSBlZmZldHR1YXRhLgY6CkB1c2VkewY7B0Y%3D--70b4a63bf9001e4fd949e12c69bb218eea2de03c;
38
+ path=/; HttpOnly
39
+ Content-Length:
40
+ - '1'
41
+ Status:
42
+ - '200'
43
+ Content-Type:
44
+ - application/json; charset=utf-8
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ! ' '
48
+ http_version:
49
+ recorded_at: Sat, 05 May 2012 12:30:15 GMT
50
+ recorded_with: VCR 2.0.1
@@ -0,0 +1,102 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://code.welaika.com/users/current.json?key=WELAIKA_TOKEN
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Sun, 13 May 2012 12:36:06 GMT
25
+ Server:
26
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9
27
+ OpenSSL/0.9.8g Phusion_Passenger/3.0.0
28
+ X-Powered-By:
29
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
30
+ Etag:
31
+ - ! '"210f37abc00e2352ce9a7ebfc82e684d"'
32
+ X-Runtime:
33
+ - '212'
34
+ Cache-Control:
35
+ - private, max-age=0, must-revalidate
36
+ Content-Length:
37
+ - '196'
38
+ Status:
39
+ - '200'
40
+ Content-Type:
41
+ - application/json; charset=utf-8
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ! '{"user":{"mail":"stefano.verna@welaika.com","last_login_on":"2012/05/13
45
+ 11:17:28 +0200","lastname":"Verna","login":"steffoz","created_on":"2010/02/11
46
+ 09:34:28 +0100","firstname":"Stefano","id":4}}'
47
+ http_version:
48
+ recorded_at: Sun, 13 May 2012 12:36:07 GMT
49
+ - request:
50
+ method: post
51
+ uri: http://code.welaika.com/issues.json?key=WELAIKA_TOKEN
52
+ body:
53
+ encoding: UTF-8
54
+ string: ! '{"issue":{"subject":"foo","description":"bar","due_date":"2012-12-01","project_id":"olasagasti","priority_id":5,"assigned_to_id":4}}'
55
+ headers:
56
+ Accept:
57
+ - application/json
58
+ Accept-Encoding:
59
+ - gzip, deflate
60
+ Content-Type:
61
+ - application/json
62
+ Content-Length:
63
+ - '132'
64
+ User-Agent:
65
+ - Ruby
66
+ response:
67
+ status:
68
+ code: 201
69
+ message: Created
70
+ headers:
71
+ Date:
72
+ - Sun, 13 May 2012 12:36:07 GMT
73
+ Server:
74
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9
75
+ OpenSSL/0.9.8g Phusion_Passenger/3.0.0
76
+ X-Powered-By:
77
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
78
+ X-Runtime:
79
+ - '124'
80
+ Cache-Control:
81
+ - no-cache
82
+ Set-Cookie:
83
+ - _redmine_session=BAh7BzoPc2Vzc2lvbl9pZCIlYzJiNzBmNmU4NmVjNjY3NmZjNDcyOTgxYzMxMWE5OGQiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlIhpDcmVhemlvbmUgZWZmZXR0dWF0YS4GOgpAdXNlZHsGOwdG--a60050631dc0708324a571c42a5577b94471e05e;
84
+ path=/; HttpOnly
85
+ Location:
86
+ - http://code.welaika.com/issues/3395
87
+ Content-Length:
88
+ - '447'
89
+ Status:
90
+ - '201'
91
+ Content-Type:
92
+ - application/json; charset=utf-8
93
+ body:
94
+ encoding: US-ASCII
95
+ string: ! '{"issue":{"status":{"name":"New","id":1},"updated_on":"2012/05/13
96
+ 14:36:07 +0200","due_date":"2012/12/01","assigned_to":{"name":"Stefano Verna","id":4},"done_ratio":0,"description":"bar","tracker":{"name":"Bug","id":1},"start_date":"2012/05/13","created_on":"2012/05/13
97
+ 14:36:07 +0200","spent_hours":0.0,"subject":"foo","author":{"name":"Stefano
98
+ Verna","id":4},"id":3395,"priority":{"name":"High","id":5},"project":{"name":"Olasagasti
99
+ ","id":52}}}'
100
+ http_version:
101
+ recorded_at: Sun, 13 May 2012 12:36:08 GMT
102
+ recorded_with: VCR 2.0.1