pt 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +3 -0
- data/README.md +4 -0
- data/lib/pt.rb +1 -1
- data/lib/pt/client.rb +9 -4
- data/lib/pt/switch_ssl.rb +10 -0
- data/lib/pt/ui.rb +1 -0
- metadata +4 -3
data/Changelog.md
CHANGED
data/README.md
CHANGED
@@ -36,6 +36,10 @@ The rest of the commands will open you a list of your tasks and let you interact
|
|
36
36
|
|
37
37
|
pt reject # mark a task as rejected, explaining why
|
38
38
|
|
39
|
+
## Problems?
|
40
|
+
|
41
|
+
You can [open a new issue](https://github.com/raul/pt/issues/new). It can be helpful to include a trace of the requests and responses you're getting from Pivotal Tracker: you can get it by adding the `--debug` parameter while invoking `pt` (remember to remove all sensible data though).
|
42
|
+
|
39
43
|
## Thanks to...
|
40
44
|
|
41
45
|
- the [Pivotal Tracker](https://www.pivotaltracker.com) guys for making a planning tool that doesn't suck and has an API
|
data/lib/pt.rb
CHANGED
data/lib/pt/client.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'pivotal-tracker'
|
2
|
+
require 'pt/switch_ssl'
|
2
3
|
|
3
4
|
class PT::Client
|
4
5
|
|
@@ -10,14 +11,18 @@ class PT::Client
|
|
10
11
|
|
11
12
|
def initialize(api_number)
|
12
13
|
PivotalTracker::Client.token = api_number
|
14
|
+
@project = nil
|
13
15
|
end
|
14
16
|
|
15
|
-
def
|
16
|
-
|
17
|
+
def get_project(project_id)
|
18
|
+
get_projects
|
19
|
+
project = PivotalTracker::Project.find(project_id)
|
20
|
+
PivotalTracker::Client.use_ssl = project.use_https
|
21
|
+
project
|
17
22
|
end
|
18
23
|
|
19
|
-
def
|
20
|
-
PivotalTracker::Project.
|
24
|
+
def get_projects
|
25
|
+
PivotalTracker::Project.all
|
21
26
|
end
|
22
27
|
|
23
28
|
def get_membership(project, email)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# PivotalTracker gem doesn't update the connection when switching SSL
|
2
|
+
# I'll submit a pull request, but in the meantime this patch should solve it
|
3
|
+
module PivotalTracker
|
4
|
+
class Client
|
5
|
+
def self.use_ssl=(val)
|
6
|
+
@connection = nil if !@use_ssl == val
|
7
|
+
@use_ssl = val
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
data/lib/pt/ui.rb
CHANGED
@@ -213,6 +213,7 @@ class PT::UI
|
|
213
213
|
projects = PT::ProjectTable.new(@client.get_projects)
|
214
214
|
project = select("Please select the project for the current directory", projects)
|
215
215
|
config[:project_id], config[:project_name] = project.id, project.name
|
216
|
+
project = @client.get_project(project.id)
|
216
217
|
membership = @client.get_membership(project, @global_config[:email])
|
217
218
|
config[:user_name], config[:user_id], config[:user_initials] = membership.name, membership.id, membership.initials
|
218
219
|
congrats "Thanks! I'm saving this project's info",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 3
|
9
|
+
version: 0.3.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Raul Murciano
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-07-02 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- lib/pt/data_row.rb
|
91
91
|
- lib/pt/data_table.rb
|
92
92
|
- lib/pt/debugger.rb
|
93
|
+
- lib/pt/switch_ssl.rb
|
93
94
|
- lib/pt/ui.rb
|
94
95
|
- lib/pt.rb
|
95
96
|
- Changelog.md
|