Sha256: fcdde9f28997e26c3162af810937e8fa075b59ecb86625de3ff937a018f2381f
Contents?: true
Size: 831 Bytes
Versions: 1
Compression:
Stored size: 831 Bytes
Contents
# encoding: utf-8 module Sparkr class CLI # Helper method to run an instance with the given +args+ # # @see #run # @return [CLI] the instance that ran def self.run(*args) instance = new instance.run(*args) instance end # Runs sparkr with the given +args+ # @return [void] def run(*args) if args.empty? || (args.size == 1 && %w(-h --help).include?(args.first)) puts help else sparkline = Sparkline.new(args.map(&:to_f)) puts sparkline.to_s end end private # Returns usage information def help """ USAGE: sparkr [-h|--help] VALUE,... EXAMPLES: sparkr 1 5 22 13 53 ▁▁▃▂█ sparkr 0,30,55,80,33,150 ▁▂▃▄▂█ echo 9 13 5 17 1 | sparkr ▄▆▂█▁ """ end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sparkr-0.4.1 | lib/sparkr/cli.rb |