Class: Suc::Mc
- Inherits:
-
Object
- Object
- Suc::Mc
- Defined in:
- lib/mc.rb
Constant Summary collapse
- CONFIG_LOCATION =
'~/.suflow'
Instance Method Summary collapse
- #configured? ⇒ Boolean
- #guide! ⇒ Object
-
#initialize ⇒ Mc
constructor
A new instance of Mc.
- #ready? ⇒ Boolean
Constructor Details
#initialize ⇒ Mc
Returns a new instance of Mc.
5 6 7 |
# File 'lib/mc.rb', line 5 def initialize @errors = [] end |
Instance Method Details
#configured? ⇒ 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
9 10 11 |
# File 'lib/mc.rb', line 9 def ready? configured? ? true : guide! end |