lib/pt/client.rb in pt-0.3.2 vs lib/pt/client.rb in pt-0.3.3

- old
+ new

@@ -1,6 +1,7 @@ require 'pivotal-tracker' +require 'pt/switch_ssl' class PT::Client def self.get_api_token(email, password) PivotalTracker::Client.token(email, password) @@ -8,17 +9,21 @@ raise PT::InputError.new("Bad email/password combination.") end def initialize(api_number) PivotalTracker::Client.token = api_number + @project = nil end - def get_projects - PivotalTracker::Project.all + def get_project(project_id) + get_projects + project = PivotalTracker::Project.find(project_id) + PivotalTracker::Client.use_ssl = project.use_https + project end - def get_project(project_id) - PivotalTracker::Project.find(project_id) + def get_projects + PivotalTracker::Project.all end def get_membership(project, email) PivotalTracker::Membership.all(project).select{ |m| m.email == email }.first end \ No newline at end of file