Class: Jira::Command::Install

Inherits:
Base
  • Object
show all
Defined in:
lib/jira/commands/install.rb

Instance Method Summary collapse

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/jira/commands/install.rb', line 14

def run
  io.say('Please enter your JIRA information.')
  inifile[:global] = base_params
  inifile.write # Do this now because cookie authentication uses api calls

  inifile.delete_section("cookie") if inifile.has_section?("cookie")
  case authentication
  when "basic"
    inifile[:global][:password] = password
  when "token"
    inifile[:global][:token] = token
  when "cookie"
    response = cookie
    inifile[:cookie] = {}
    inifile[:cookie][:name] = response['name']
    inifile[:cookie][:value] = response['value']
  end
  inifile.write
end