Sha256: b2cdd6b42ae8d65d153c3fca6e7e01dcdfe77f661caaf2015d7b73f89ec801d2

Contents?: true

Size: 1.01 KB

Versions: 21

Compression:

Stored size: 1.01 KB

Contents

class Pry
  module DefaultCommands

    Basic = Pry::CommandSet.new do
      command "toggle-color", "Toggle syntax highlighting." do
        Pry.color = !Pry.color
        output.puts "Syntax highlighting #{Pry.color ? "on" : "off"}"
      end

      command "simple-prompt", "Toggle the simple prompt." do
        case Pry.active_instance.prompt
        when Pry::SIMPLE_PROMPT
          Pry.active_instance.pop_prompt
        else
          Pry.active_instance.push_prompt Pry::SIMPLE_PROMPT
        end
      end

      command "version", "Show Pry version." do
        output.puts "Pry version: #{Pry::VERSION} on Ruby #{RUBY_VERSION}."
      end

      command "import", "Import a command set" do |command_set_name|
        next output.puts "Provide a command set name" if command_set.nil?

        set = target.eval(arg_string)
        Pry.active_instance.commands.import set
      end

      command "reset", "Reset the REPL to a clean state." do
        output.puts "Pry reset."
        exec "pry"
      end
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
pry-0.9.2 lib/pry/default_commands/basic.rb
pry-0.9.2-i386-mswin32 lib/pry/default_commands/basic.rb
pry-0.9.2-i386-mingw32 lib/pry/default_commands/basic.rb
pry-0.9.1 lib/pry/default_commands/basic.rb
pry-0.9.1-i386-mswin32 lib/pry/default_commands/basic.rb
pry-0.9.1-i386-mingw32 lib/pry/default_commands/basic.rb
pry-0.9.0 lib/pry/default_commands/basic.rb
pry-0.9.0-i386-mswin32 lib/pry/default_commands/basic.rb
pry-0.9.0-i386-mingw32 lib/pry/default_commands/basic.rb
pry-0.9.0pre3 lib/pry/default_commands/basic.rb
pry-0.9.0pre3-i386-mswin32 lib/pry/default_commands/basic.rb
pry-0.9.0pre3-i386-mingw32 lib/pry/default_commands/basic.rb
pry-0.9.0pre3-java lib/pry/default_commands/basic.rb
pry-0.9.0pre2 lib/pry/default_commands/basic.rb
pry-0.9.0pre2-i386-mswin32 lib/pry/default_commands/basic.rb
pry-0.9.0pre2-i386-mingw32 lib/pry/default_commands/basic.rb
pry-0.9.0pre2-java lib/pry/default_commands/basic.rb
pry-0.9.0pre1 lib/pry/default_commands/basic.rb
pry-0.9.0pre1-i386-mswin32 lib/pry/default_commands/basic.rb
pry-0.9.0pre1-i386-mingw32 lib/pry/default_commands/basic.rb