Class: Nutella::Checkup

Inherits:
Command show all
Defined in:
lib/commands/checkup.rb

Instance Method Summary collapse

Instance Method Details

#run(args = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/commands/checkup.rb', line 8

def run( args=nil )

  # First check that we have all the tools we need to run nutella
  return unless all_dependencies_installed?
  
  # Check if we have a local broker installed
  # and install one if we don't
  if broker_exists
    console.info 'You have a local broker installed. Yay!'
  else
    console.warn 'You don\'t seem to have a local broker installed so we are going to go ahead and install one for you. This might take some time...'
    unless install_local_broker
      console.error 'Whoops...something went wrong while installing the broker'
      return
    end
  end
      
  # Set ready flag in config.json
  Nutella.config['ready'] = true

  # Output success message
  console.success 'All systems go! You are ready to use nutella!'
end