Class: Ready::CLI::Compile

Inherits:
CommandKit::Command
  • Object
show all
Includes:
RakeCommand
Defined in:
lib/ready/cli/compile.rb

Overview

Compiles ready stubs and prints them to stdout, or compiles everything via rake:

  • ready compile / ready compile all: compile every stub (rake ready:compile) -- bare compile defaults to all, like make
  • ready compile by: the persistent by client alias
  • ready compile NAME ...: a zsh function stub per CLI name

The --rubygems/--yjit flags only apply to by; --environment only applies to named CLIs.

Instance Method Summary collapse

Methods included from RakeCommand

#rake

Constructor Details

#initialize(**kwargs) ⇒ Compile

Seeds the per-invocation environment accumulator that the -e option block writes into. The --rubygems/--yjit booleans are read straight from #options, which command_kit populates for us.



61
62
63
64
65
# File 'lib/ready/cli/compile.rb', line 61

def initialize(**kwargs)
  super

  @environment = {}
end

Instance Method Details

#run(*names) ⇒ Object

Dispatches on the argument(s): all compiles everything via rake, by prints the persistent-client alias, and anything else is treated as one or more gem/CLI names.

Parameters:

  • names (Array<String>)


74
75
76
77
78
79
80
81
82
# File 'lib/ready/cli/compile.rb', line 74

def run(*names)
  case names
  in [] | ["all"] then rake("ready:compile")
  in ["by"] then print by_alias
  else
    reject_reserved_names!(names)
    print gem_script(names)
  end
end