Class: Hexlet::BaseCLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/hexlet/base_cli.rb

Direct Known Subclasses

MemberCLI, TeacherCLI

Constant Summary collapse

CONFIG_DIR =

include Thor::Shell::Basic

File.join(Dir.home, ".hexlet")
CREDENTIALS_FILE =
File.join(Dir.home, ".hexlet", "credentials")

Instance Method Summary collapse

Instance Method Details

#login(key) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/hexlet/base_cli.rb', line 13

def (key)
  client = build_client(key)
  if client.
    puts (t :ok)
    write_config("hexlet_api_key" => key)
  else
    puts (t :not_found)
  end
end