Basic |
= |
Pry::CommandSet.new do command "toggle-color", "Toggle syntax highlighting." do Pry.color = !Pry.color |
Context |
= |
Pry::CommandSet.new do import Ls |
Documentation |
= |
Pry::CommandSet.new do create_command "ri", "View ri documentation. e.g `ri Array#each`" do banner <<-BANNER Usage: ri [spec] e.g. ri Array#each Relies on the ri executable being available. See also: show-doc. BANNER |
EasterEggs |
= |
Pry::CommandSet.new do command(/!s\/(.*?)\/(.*?)/, "") do |source, dest| eval_string.gsub!(/#{source}/) { dest } |
Gems |
= |
Pry::CommandSet.new do create_command "gem-install", "Install a gem and refresh the gem cache.", :argument_required => true do |gem| banner <<-BANNER Usage: gem-install GEM_NAME Installs the given gem and refreshes the gem cache so that you can immediately 'require GEM_FILE' BANNER |
Input |
= |
Pry::CommandSet.new do create_command "!", "Clear the input buffer. Useful if the parsing process goes wrong and you get stuck in the read loop.", :use_prefix => false do def process |
Introspection |
= |
Pry::CommandSet.new do create_command "show-method" do description "Show the source for METH. Type `show-method --help` for more info. Aliases: $, show-source" |
Ls |
= |
Pry::CommandSet.new do create_command "ls","Show the list of vars and methods in the current scope. Type `ls --help` for more info.", :shellwords => false, :interpolate => false do def options(opt) |
BUILTIN_GLOBALS |
= |
%w($" $$ $* $, $-0 $-F $-I $-K $-W $-a $-d $-i $-l $-p $-v $-w $. $/ $\\ $: $; $< $= $> $0 $ARGV $CONSOLE $DEBUG $DEFAULT_INPUT $DEFAULT_OUTPUT $FIELD_SEPARATOR $FILENAME $FS $IGNORECASE $INPUT_LINE_NUMBER $INPUT_RECORD_SEPARATOR $KCODE $LOADED_FEATURES $LOAD_PATH $NR $OFS $ORS $OUTPUT_FIELD_SEPARATOR $OUTPUT_RECORD_SEPARATOR $PID $PROCESS_ID $PROGRAM_NAME $RS $VERBOSE $deferr $defout $stderr $stdin $stdout) |
|
ruby.runpaint.org/globals,
and running "puts global_variables.inspect".
|
PSEUDO_GLOBALS |
= |
%w($! $' $& $` $@ $? $+ $_ $~ $1 $2 $3 $4 $5 $6 $7 $8 $9 $CHILD_STATUS $SAFE $ERROR_INFO $ERROR_POSITION $LAST_MATCH_INFO $LAST_PAREN_MATCH $LAST_READ_LINE $MATCH $POSTMATCH $PREMATCH) |
|
$SAFE and $? are thread-local, the exception stuff only works in a rescue
clause, everything else is basically a local variable with a $ in its name.
|
Shell |
= |
Pry::CommandSet.new do command(/\.(.*)/, "All text following a '.' is forwarded to the shell.", :listing => ".<shell command>", :use_prefix => false) do |cmd| if cmd =~ /^cd\s+(.+)/i |