pt 0.3.2 → 0.3.3

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.
@@ -1,5 +1,8 @@
1
1
  # pt changelog
2
2
 
3
+ ## v0.3.3
4
+ Added SSL support
5
+
3
6
  ## v0.3.2
4
7
  Fix in requests debugger
5
8
 
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
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  module PT
4
4
  class InputError < StandardError; end
5
- VERSION = '0.3.2'
5
+ VERSION = '0.3.3'
6
6
  end
7
7
 
8
8
  require 'pt/client'
@@ -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 get_projects
16
- PivotalTracker::Project.all
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 get_project(project_id)
20
- PivotalTracker::Project.find(project_id)
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
@@ -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
- - 2
9
- version: 0.3.2
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-06-30 00:00:00 -07:00
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