redpomo 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
data/Gemfile CHANGED
@@ -6,3 +6,4 @@ gemspec
6
6
  gem 'rspec'
7
7
  gem 'vcr'
8
8
  gem 'mocha'
9
+ gem 'rake'
data/README.md CHANGED
@@ -1,6 +1,25 @@
1
1
  # Redpomo
2
+ ## Redmine, Pomodoro.app and Todo-txt. Together.
2
3
 
3
- TODO: Write a gem description
4
+ [![Build Status](https://secure.travis-ci.org/stefanoverna/redpomo.png)](http://travis-ci.org/stefanoverna/redpomo)
5
+
6
+ Redpomo is the classic "scratch your own itch" project:
7
+
8
+ * It makes it really easy to manage Redmine issues from the command-line;
9
+ * It is able to sync Redmine issues with your local Todo.txt tasks;
10
+ * It can start Pomodoro.app timer on a specific Todo.txt task, and is
11
+ able to "push" the logged pomodoros as Redmine timetracks.
12
+
13
+ ## Usage
14
+
15
+ › redpomo help
16
+ Tasks:
17
+ redpomo close TASK # Marks a todo.txt task as complete, and closes the related Redmine issue
18
+ redpomo help [TASK] # Describe available tasks or one specific task
19
+ redpomo open TASK # Opens up the Redmine issue page of the selected task
20
+ redpomo pull # Imports Redmine open issues into local todo.txt
21
+ redpomo push LOGFILE # Parses Pomodoro export file and imports to Redmine clients
22
+ redpomo start TASK # Starts a Pomodoro session for the selected task
4
23
 
5
24
  ## Installation
6
25
 
@@ -16,10 +35,6 @@ Or install it yourself as:
16
35
 
17
36
  $ gem install redpomo
18
37
 
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
38
  ## Contributing
24
39
 
25
40
  1. Fork it
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task :default => :spec
@@ -20,31 +20,5 @@ module Redpomo
20
20
  @@cache = data["cache"] ? FileCache : NullCache
21
21
  end
22
22
 
23
- # def todo_path
24
- # File.expand_path(@data["todo"])
25
- # end
26
-
27
- # def tasks
28
- # @tasks ||= Todo::List.new(todo_path)
29
- # end
30
-
31
- # def find_task(number)
32
- # tasks[number.to_i - 1]
33
- # end
34
-
35
- # def trackers
36
- # @trackers ||= @data["trackers"].map do |key, data|
37
- # Tracker.new(data.merge(name: key))
38
- # end
39
- # end
40
-
41
- # def issues
42
- # [].tap do |issues|
43
- # trackers.each do |tracker|
44
- # issues << tracker.issues
45
- # end
46
- # end.flatten
47
- # end
48
-
49
23
  end
50
24
  end
data/lib/redpomo/issue.rb CHANGED
@@ -7,12 +7,19 @@ module Redpomo
7
7
  @title = data["subject"]
8
8
  @issue_id = data["id"]
9
9
  @project = data["project"]
10
+ @priority = data["priority"]["name"]
10
11
  @due_date = Date.parse(data["due_date"]) if data["due_date"].present?
11
12
  @tracker = tracker
12
13
  end
13
14
 
14
15
  def to_task
15
- label = [ title ]
16
+ label = []
17
+ if @priority.present?
18
+ if priority = @tracker.todo_priority(@priority)
19
+ label << priority
20
+ end
21
+ end
22
+ label << @title
16
23
  label << @due_date.strftime("%Y-%m-%d") if @due_date.present?
17
24
  label << "##{issue_id}"
18
25
  label << "+#{project}"
@@ -26,10 +26,20 @@ module Redpomo
26
26
  @api_key = options[:token]
27
27
  @default_project = options[:default_project]
28
28
  @closed_status_id = options[:closed_status].to_i
29
+ @priorities = options[:priorities]
30
+ end
31
+
32
+ def todo_priority(priority_name)
33
+ return nil if @priorities.nil?
34
+ if index = @priorities.index(priority_name)
35
+ "(#{"ABCDE"[index]})"
36
+ else
37
+ nil
38
+ end
29
39
  end
30
40
 
31
41
  def issues
32
- data = get("/issues", assigned_to_id: current_user_id, status_id: "open")
42
+ data = get("/issues", assigned_to_id: current_user_id, status_id: "open", limit: 100)
33
43
  data["issues"].map do |issue|
34
44
  issue["project"] = project_identifier_for(issue["project"]["id"])
35
45
  Issue.new(self, issue)
@@ -1,3 +1,3 @@
1
1
  module Redpomo
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/redpomo.gemspec CHANGED
@@ -28,4 +28,5 @@ Gem::Specification.new do |gem|
28
28
  gem.add_development_dependency "webmock"
29
29
  gem.add_development_dependency "mocha"
30
30
  gem.add_development_dependency "simplecov"
31
+ gem.add_development_dependency "rake"
31
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redpomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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-05-05 00:00:00.000000000 Z
12
+ date: 2012-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70334886059560 !ruby/object:Gem::Requirement
16
+ requirement: &70189327335720 !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: *70334886059560
24
+ version_requirements: *70189327335720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &70334886058900 !ruby/object:Gem::Requirement
27
+ requirement: &70189327335300 !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: *70334886058900
35
+ version_requirements: *70189327335300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: todo-txt
38
- requirement: &70334886058000 !ruby/object:Gem::Requirement
38
+ requirement: &70189327334880 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70334886058000
46
+ version_requirements: *70189327334880
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rest-client
49
- requirement: &70334886056840 !ruby/object:Gem::Requirement
49
+ requirement: &70189327334460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70334886056840
57
+ version_requirements: *70189327334460
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: launchy
60
- requirement: &70334886071840 !ruby/object:Gem::Requirement
60
+ requirement: &70189327334040 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70334886071840
68
+ version_requirements: *70189327334040
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: applescript
71
- requirement: &70334886071320 !ruby/object:Gem::Requirement
71
+ requirement: &70189327333620 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70334886071320
79
+ version_requirements: *70189327333620
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: terminal-table
82
- requirement: &70334886070600 !ruby/object:Gem::Requirement
82
+ requirement: &70189327333200 !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: :runtime
89
89
  prerelease: false
90
- version_requirements: *70334886070600
90
+ version_requirements: *70189327333200
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec
93
- requirement: &70334886069620 !ruby/object:Gem::Requirement
93
+ requirement: &70189327332780 !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: *70334886069620
101
+ version_requirements: *70189327332780
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: vcr
104
- requirement: &70334886068480 !ruby/object:Gem::Requirement
104
+ requirement: &70189327332360 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70334886068480
112
+ version_requirements: *70189327332360
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: webmock
115
- requirement: &70334886067820 !ruby/object:Gem::Requirement
115
+ requirement: &70189327331940 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70334886067820
123
+ version_requirements: *70189327331940
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: mocha
126
- requirement: &70334886067140 !ruby/object:Gem::Requirement
126
+ requirement: &70189327331520 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70334886067140
134
+ version_requirements: *70189327331520
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: simplecov
137
- requirement: &70334886066620 !ruby/object:Gem::Requirement
137
+ requirement: &70189327331100 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,7 +142,18 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70334886066620
145
+ version_requirements: *70189327331100
146
+ - !ruby/object:Gem::Dependency
147
+ name: rake
148
+ requirement: &70189327347060 !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: *70189327347060
146
157
  description: A nice little gem that integrates Redmine, Todo.txt and Pomodoro.app
147
158
  email:
148
159
  - stefano.verna@welaika.com
@@ -153,6 +164,7 @@ extra_rdoc_files: []
153
164
  files:
154
165
  - .gitignore
155
166
  - .rspec
167
+ - .travis.yml
156
168
  - Gemfile
157
169
  - LICENSE
158
170
  - README.md