Class: Pod::Command::Trunk::Me::CleanSessions
Constant Summary
BASE_URL, SCHEME_AND_HOST
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of CleanSessions.
96
97
98
99
|
# File 'lib/pod/command/trunk/me.rb', line 96
def initialize(argv)
@remove_all = argv.flag?('all', false)
super
end
|
Class Method Details
.options ⇒ Object
90
91
92
93
94
|
# 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
|
Instance Method Details
#run ⇒ Object
108
109
110
111
112
113
114
|
# File 'lib/pod/command/trunk/me.rb', line 108
def run
path = @remove_all ? 'sessions/all' : 'sessions'
request_path(:delete, path, )
rescue REST::Error => e
raise Informative, 'There was an error cleaning up your ' \
"sessions from trunk: #{e.message}"
end
|
#validate! ⇒ Object
101
102
103
104
105
106
|
# File 'lib/pod/command/trunk/me.rb', line 101
def validate!
super
unless token
help! 'You need to register a session first.'
end
end
|