Class: Jira::Command::Install

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

Instance Method Summary collapse

Instance Method Details

#runObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/jira/commands/install.rb', line 30

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(session_params)
    inifile[:cookie] = {}
    inifile[:cookie][:name] = response['name']
    inifile[:cookie][:value] = response['value']
  end
  inifile.write
end


50
51
52
53
54
55
56
57
# File 'lib/jira/commands/install.rb', line 50

def run_rescue_cookie
  response = cookie(rescue_cookie_params)
  config = Jira::Core.config
  config[:cookie] = {}
  config[:cookie][:name] = response['name']
  config[:cookie][:value] = response['value']
  config.write
end