class Elrio::CLI

Public Class Methods

new(output = $stdout) click to toggle source
# File lib/elrio/cli.rb, line 3
def initialize(output = $stdout)
  @output = output
end

Public Instance Methods

run(args) click to toggle source
# File lib/elrio/cli.rb, line 7
def run(args)
  runner = Runner.new
  cmd = args.shift

  return usage unless cmd

  args.each do |path|
    insets = runner.send(cmd, path)
    @output.puts "#{path}: #{insets}"
  end
end

Private Instance Methods

usage() click to toggle source
# File lib/elrio/cli.rb, line 21
    def usage
      @output.puts(<<-EOF)
Usage: elrio <command> <images>

Commands:
  analyze   Analyzes each file and prints the resizable cap insets.
  optimize  Creates an optimized version of each file and prints the
            resizable cap insets for the optimized file.
EOF
    end