class Pod::Command::Trunk::Me::CleanSessions

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/pod/command/trunk/me.rb, line 96
def initialize(argv)
  @remove_all = argv.flag?('all', false)
  super
end
options() click to toggle source
Calls superclass method
# File lib/pod/command/trunk/me.rb, line 90
def self.options
  [
    ['--all', 'Removes all your sessions, except for the current one'],
  ].concat(super)
end

Public Instance Methods

run() click to toggle source
# File lib/pod/command/trunk/me.rb, line 108
def run
  path = @remove_all ? 'sessions/all' : 'sessions'
  request_path(:delete, path, auth_headers)
rescue REST::Error => e
  raise Informative, 'There was an error cleaning up your ' \
                           "sessions from trunk: #{e.message}"
end
validate!() click to toggle source
Calls superclass method Pod::Command::Trunk::Me#validate!
# File lib/pod/command/trunk/me.rb, line 101
def validate!
  super
  unless token
    help! 'You need to register a session first.'
  end
end