Class: Terjira::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/terjira.rb

Overview

Main CLI

Instance Method Summary collapse

Instance Method Details

#loginObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/terjira.rb', line 16

def 
  pastel = Pastel.new
  Client::Base.expire_auth_options
  Client::Base.build_auth_options(options)

  # for touch base resource
  Client::Field.all
  puts pastel.blue("Login successful")
rescue JIRA::HTTPError => e
  puts pastel.red(e.message)
  Client::Base.expire_auth_options
rescue => e
  Client::Base.expire_auth_options
  raise e
end

#logoutObject



33
34
35
# File 'lib/terjira.rb', line 33

def logout
  Client::Base.expire_auth_options
end