class Nutella::NutellaCLI
Constants
- NUTELLA_LOGO
Public Class Methods
print_nutella_logo()
click to toggle source
Print nutella logo
# File lib/core/nutella_cli.rb, line 41 def self.print_nutella_logo console.info(NUTELLA_LOGO) nutella_version = File.open("#{Nutella::NUTELLA_HOME}VERSION", 'rb').read console.info("Welcome to nutella version #{nutella_version}! For a complete lists of available commands type 'nutella help'\n") # If nutella is not ready to be used (i.e. nobody has invoked the "nutella checkup" command yet), # append warning/reminder message if Nutella.config['ready'].nil? console.warn 'Looks like this is a fresh installation of nutella. Please run \'nutella checkup\' to check all dependencies are installed.' end end
run()
click to toggle source
Nutella
entry point. Every time the “nutella” command is invoked this is the method that gets called. It reads the command line parameters and it invokes the right sub-command
# File lib/core/nutella_cli.rb, line 16 def self.run # Read parameters args = ARGV.dup args.shift # Check that the command is not empty, if so, simply print the nutella logo command = ARGV.first if command == nil print_nutella_logo exit 0 end # If nutella is not ready to be used (i.e. nobody has invoked the "nutella checkup" command yet), # append warning/reminder message if Nutella.config['ready'].nil? && command!='checkup' console.warn 'Looks like this is a fresh installation of nutella. Please run \'nutella checkup\' to check all dependencies are installed.' end # Execute the appropriate command Nutella.execute_command command, args exit 0 end