Class: Ready::CLI::Init

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

Overview

Prints the shell snippet that sources ready's zsh plugin. The plugin path is resolved by introspection relative to this gem, so the output is correct wherever the gem is installed:

eval "$(ready init)"      # or paste the line into ~/.zshrc

Constant Summary collapse

PLUGIN_PATH =

The bundled zsh plugin entry point, resolved relative to the gem.

Ready.root / "zsh" / "ready" / "ready.plugin.zsh"

Instance Method Summary collapse

Instance Method Details

#runObject

Prints source <plugin path> to stdout.



20
21
22
23
24
25
26
27
# File 'lib/ready/cli/init.rb', line 20

def run
  unless PLUGIN_PATH.file?
    print_error "ready zsh plugin not found at #{PLUGIN_PATH}"
    exit(1)
  end

  puts "source #{PLUGIN_PATH}"
end