Created
September 17, 2020 18:03
-
-
Save havenwood/49693ec16cb1b831bf6c6634fdefcff0 to your computer and use it in GitHub Desktop.
My `~/.pryrc` file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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