Sha256: e1a9c6dfe44c7b730d2b90c1fb13d7c807d5685f5252c773f71de85c28c605e6

Contents?: true

Size: 817 Bytes

Versions: 79

Compression:

Stored size: 817 Bytes

Contents

class Pry
  class Command::Cd < Pry::ClassCommand
    match 'cd'
    group 'Context'
    description 'Move into a new context (object or scope).'

    banner <<-'BANNER'
      Usage: cd [OPTIONS] [--help]

      Move into new context (object or scope). As in UNIX shells use `cd ..` to go
      back, `cd /` to return to Pry top-level and `cd -` to toggle between last two
      scopes. Complex syntax (e.g `cd ../@x/y`) also supported.

      cd @x
      cd ..
      cd /
      cd -

      https://github.com/pry/pry/wiki/State-navigation#wiki-Changing_scope
    BANNER

    def process
      state.old_stack ||= []
      stack, state.old_stack = context_from_object_path(arg_string, _pry_, state.old_stack)
      _pry_.binding_stack = stack if stack
    end
  end

  Pry::Commands.add_command(Pry::Command::Cd)
end

Version data entries

79 entries across 79 versions & 5 rubygems

Version Path
pry-0.9.12.2 lib/pry/commands/cd.rb
pry-0.9.12.2-i386-mswin32 lib/pry/commands/cd.rb
pry-0.9.12.2-i386-mingw32 lib/pry/commands/cd.rb
pry-0.9.12.2-java lib/pry/commands/cd.rb
pry-0.9.12.2pre1 lib/pry/commands/cd.rb
pry-0.9.12.2pre1-i386-mswin32 lib/pry/commands/cd.rb
pry-0.9.12.2pre1-i386-mingw32 lib/pry/commands/cd.rb
pry-0.9.12.2pre1-java lib/pry/commands/cd.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/pry-0.9.12.1/lib/pry/commands/cd.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/pry-0.9.12.1/lib/pry/commands/cd.rb
pry-0.9.12.1 lib/pry/commands/cd.rb
pry-0.9.12.1-i386-mswin32 lib/pry/commands/cd.rb
pry-0.9.12.1-i386-mingw32 lib/pry/commands/cd.rb
pry-0.9.12.1-java lib/pry/commands/cd.rb
pry-0.9.12.1pre1 lib/pry/commands/cd.rb
pry-0.9.12.1pre1-i386-mswin32 lib/pry/commands/cd.rb
pry-0.9.12.1pre1-i386-mingw32 lib/pry/commands/cd.rb
pry-0.9.12.1pre1-java lib/pry/commands/cd.rb
torquebox-console-0.2.5 vendor/bundle/jruby/1.9/gems/pry-0.9.12-java/lib/pry/commands/cd.rb
pry-1.0.0.pre1-i386-mswin32 lib/pry/commands/cd.rb