Class: Jira::Command::Install

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

Instance Method Summary collapse

Instance Method Details

#runObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/jira/commands/install.rb', line 26

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


46
47
48
49
50
51
52
53
# File 'lib/jira/commands/install.rb', line 46

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