Class: Sem::CLI

Inherits:
Dracula
  • Object
show all
Defined in:
lib/sem/cli.rb

Defined Under Namespace

Classes: Orgs, Projects, SharedConfigs, Teams

Instance Method Summary collapse

Instance Method Details

#loginObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sem/cli.rb', line 20

def 
  auth_token = options["auth-token"]

  if Sem::Configuration.valid_auth_token?(auth_token)
    Sem::Configuration.export_auth_token(auth_token)

    puts "Your credentials have been saved to #{Sem::Configuration::CREDENTIALS_PATH}."
  else
    abort "[ERROR] Token is invalid!"
  end
end

#logoutObject



33
34
35
36
37
# File 'lib/sem/cli.rb', line 33

def logout
  Sem::Configuration.delete_auth_token

  puts "Loged out."
end

#versionObject



11
12
13
# File 'lib/sem/cli.rb', line 11

def version
  puts Sem::VERSION
end