Class: Suc::Mc

Inherits:
Object
  • Object
show all
Defined in:
lib/mc.rb

Constant Summary collapse

CONFIG_LOCATION =
'~/.suflow'

Instance Method Summary collapse

Constructor Details

#initializeMc

Returns a new instance of Mc.



5
6
7
# File 'lib/mc.rb', line 5

def initialize
  @errors = []
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/mc.rb', line 13

def configured?
  config_file_present? && config_valid?
end

#guide!Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/mc.rb', line 17

def guide!
  info = %{
    It seems your client is not configured. That's easy to solve!
    Please visit #{Suc::DEFAULT_URL}, login with your account and populate #{CONFIG_LOCATION}
    with received token.
  }
  puts(info)
  @errors.each{|s| puts(s)}
  exit(1)
end

#ready?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/mc.rb', line 9

def ready?
  configured? ? true : guide!
end