Class: Abak::Flow::Commands::Configure

Inherits:
Object
  • Object
show all
Includes:
ANSI::Code
Defined in:
lib/abak-flow/commands/configure.rb

Instance Method Summary collapse

Instance Method Details

#process(args, options) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/abak-flow/commands/configure.rb', line 16

def process(args, options)
  interview

  password_hash = deffered do
    client = Octokit::Client.new(login: @login, password: @password)
    response = client.create_authorization(
      scopes: ["repo"], note: "abak-flow",
      note_url: "https://github.com/Strech/abak-flow",
      headers: @headers)

    response[:token]
  end

  Manager.configuration.rewrite(
    login: @login, password: password_hash,
    locale: @locale, http_proxy: @http_proxy)
end

#run(args, options) ⇒ Object



9
10
11
12
13
14
# File 'lib/abak-flow/commands/configure.rb', line 9

def run(args, options)
  process(args, options)

  puts
  say green { Manager.locale.success(self) }
end