Object
AsciiParadise::Sparky::CLI.run
Helper method to run an instance with the given arguments.
@see run @return [CLI] the instance that ran.
run
# File lib/ascii_paradise/sparky/cli.rb, line 21 def self.run(*i) instance = new instance.run(*i) instance end
Returns usage information for the sparkyc omponent.
# File lib/ascii_paradise/sparky/cli.rb, line 48 def help " USAGE: sparky [-h|--help] VALUE,... EXAMPLES: sparky 1 5 22 13 53 ▁▁▃▂▇ sparky 0,30,55,80,33,150 ▁▂▃▅▂▇ echo 9 13 5 17 1 | sparky ▄▆▂█▁ " end
Runs sparky with the given input argument.
The method will return nil.
# File lib/ascii_paradise/sparky/cli.rb, line 34 def run(*i) if i.empty? || (i.size == 1 && %w(-h --help).include?(i.first)) puts help else sparkline = Sparky.new(i.map(&:to_f)) puts sparkline.to_s end end