svenfuchs/cl

View on GitHub
examples/readme/runner_custom

Summary

Maintainability
Test Coverage
# anywhere in your library

require 'cl'

class Runner
  Cl::Runner.register :custom, self

  def initialize(ctx, args)
    # ...
  end

  def run
    const = identify_cmd_class_from_args
    const.new(ctx, args).run
  end
end

# in bin/run
Cl.new('run', runner: :custom).run(ARGV)