class Pivotalcli::CLI

Public Instance Methods

get_story_info(_story_id) click to toggle source
# File lib/pivotalcli/cli.rb, line 16
def get_story_info(_story_id)
  story_id = _story_id.delete('#')
  begin
    story = client.story(story_id)
    puts story.name
    puts story.url
  rescue => e
    STDERR.puts "#{story_id} is not found."
  end
end
list_projects() click to toggle source
# File lib/pivotalcli/cli.rb, line 9
def list_projects
  client.projects.each do |project|
    puts "#{project.id}, #{project.name}"
  end
end

Private Instance Methods

client() click to toggle source
# File lib/pivotalcli/cli.rb, line 28
def client
  TrackerApi::Client.new(token: ENV['PIVOTAL_TOKEN'])
end