Class: Binpacker::CLI
- Inherits:
-
Object
- Object
- Binpacker::CLI
- Defined in:
- lib/binpacker/cli.rb,
sig/binpacker/cli.rbs
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ nil
Constructor Details
#initialize(args) ⇒ CLI
Returns a new instance of CLI.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/binpacker/cli.rb', line 12 def initialize(args) @args = args.dup @command = nil @profile = nil @passthrough = [] @quiet = false @incremental = false @report_path = nil @skill_list = false @skill_path = false @skill_describe = false @skill_name = nil # A CI matrix sets env vars far more easily than it rewrites the command a Makefile target runs, so # BINPACKER_SHARD is a first-class way in; an explicit --shard still wins over it. @shard_spec = ENV.fetch('BINPACKER_SHARD', nil) parse! end |
Class Method Details
.start(args) ⇒ nil
8 9 10 |
# File 'lib/binpacker/cli.rb', line 8 def self.start(args) new(args).run end |
Instance Method Details
#run ⇒ nil
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/binpacker/cli.rb', line 30 def run case @command when 'calibrate' cmd_calibrate when 'run' cmd_run when 'shards-check' cmd_shards_check when 'init' cmd_init when 'skill' cmd_skill when 'describe' cmd_describe when '--version', '-v' puts "binpacker #{Binpacker::VERSION}" when '--help', '-h', nil print_help else warn "unknown command: #{@command}" print_help exit 1 end end |