Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created September 17, 2020 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/49693ec16cb1b831bf6c6634fdefcff0 to your computer and use it in GitHub Desktop.
Save havenwood/49693ec16cb1b831bf6c6634fdefcff0 to your computer and use it in GitHub Desktop.
My `~/.pryrc` file
Pry.config.prompt = Pry::Prompt[:simple]
Pry.config.pager = false
##
# Support refinements at top level in Pry.
Pry.hooks.add_hook :when_started, :context_switch do |_output, _binding, pry|
pry.binding_stack = [TOPLEVEL_BINDING]
end
##
# Add a `paste` command for clipboard paste support.
begin
require 'clipboard'
Pry::Commands.block_command 'paste', 'Paste from the clipboard.' do
_pry_.input = StringIO.new Clipboard.paste
end
rescue LoadError
end
##
# Provide an incrementable `assertions` attr_accessor to use assertions
# a la carte. Normally this would already be provided by Minitest::Runnable
# but we want to play with assertions from the top level! \o/
require 'minitest'
module Minitest::Assertions
attr_writer :assertions
def assertions
@assertions ||= 0
end
end
include Minitest::Assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment