Class: Lemon::CLI::OBrother

Inherits:
Base
  • Object
show all
Defined in:
lib/lemon/cli/obrother.rb

Overview

The ol’ “Sing it, Brother” Command.

Instance Method Summary collapse

Methods inherited from Base

#command_parse, #initialize, #option_coverage, #option_dryrun, #option_format, #option_loadpath, #option_namespaces, #option_output, #option_parser, #option_private, #option_requires, #option_verbose, #option_zealous, #options, run, #run

Constructor Details

This class inherits a constructor from Lemon::CLI::Base

Instance Method Details

#command_run(argv) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/lemon/cli/obrother.rb', line 12

def command_run(argv)
  if argv.any?{ |a| a.downcase == 'good' }
    show_ascii_art
  else
    puts "No, they are GOOD!"
  end
end

#show_ascii_artObject



21
22
23
24
25
26
27
28
29
# File 'lib/lemon/cli/obrother.rb', line 21

def show_ascii_art
  string = File.read(File.dirname(__FILE__) + '/lemon.ascii')
  begin
    require 'ansi'
    puts string.ansi(:yellow)
  rescue LoadError
    puts string
  end
end