Just discovered this nice feature of RSpec where it can load all files for
us. Works with `bundle exec rake` and `bundle exec rspec spec/file_spec.rb`,
which covers all use cases.
Deprecate Pry.config.exception_whitelist,
use Pry.config.unrescued_exceptions instead.
Deprecate Pry::DEFAULT_EXCEPTION_WHITELIST,
use Pry::DEFAULT_UNRESCUED_EXCEPTIONS instead.
What white / black means are not clear,
use clearer terminologies.
Fixes offences of the following cops:
* Layout/SpaceAroundEqualsInParameterDefault
* Layout/SpaceAroundOperators
* Layout/SpaceBeforeBlockBraces
* Layout/SpaceInsideBlockBraces
`Pry::Platform` really looks like a helper and therefore should be defined as
one. Invoking `Pry::Platform` emits a warning now. Users are encouraged to use
`Pry::Helpers::Platform`.
Removes Bacon and Mocha
Reasoning explained in this comment: https://github.com/pry/pry/issues/277#issuecomment-51708712
Mostly this went smoothly. There were a few errors that I fixed along
the way, e.g. tests that were failing but for various reasons still
passed. Should have documented them, but didn't think about it until
very near the end. But generaly, I remember 2 reasons this would happen:
`lambda { raise "omg" }.should.raise(RuntimeError, /not-omg/)` will pass
because the second argument is ignored by Bacon. And `1.should == 2`
will return false instead of raising an error when it is not in an it
block (e.g. if stuck in a describe block, that would just return false)
The only one that I felt unsure about was spec/helpers/table_spec.rb
`Pry::Helpers.tablify_or_one_line('head', %w(ing)).should == 'head: ing'`
This is wrong, but was not failing because it was in a describe block
instead of an it block. In reality, it returns `"head: ing\n"`,
I updated the test to reflect this, though I don't know for sure
this is the right thing to do
This will fail on master until https://github.com/pry/pry/pull/1281 is merged.
This makes https://github.com/pry/pry/pull/1278 unnecessary.
with `_pry_` as an optional second. in the repl the second argument will
always be met but to avoid needing a pry instance around to use Pry::InputCompleter,
it uses the first argument(`input`) when implementing auto completion, and
'pry' can be used if its around/available.
this commit changes InputCompleter from a module implemented on top
of singleton/class methods to a class who wraps '_pry_' and reads
from _pry_.input, who is assumed to be Readline.
pry-bond will also need to be updated to have a similar style API.
when the tests are run in a certain order spec/completion_spec.rb can fail with:
NameError: uninitialized constant Pry::InputCompleter::Readline
/Users/giorgio/code/pry/lib/pry/input_completer.rb:6:in `start': Pry::InputCompleter - should not crash if there's a Module that has a symbolic name.
/Users/giorgio/code/pry/lib/pry/config/default.rb:41:in `block in <class:Default>'
/Users/giorgio/code/pry/lib/pry/config/default.rb:58:in `instance_eval'
we require readline so we know spec/completion_spec.rb has its dependencies met
before being run.
https://github.com/johnny5-/pry-bond project adds the enable-bond! and disable-bond! commands,
as well as other features, that enhance the pry&bond experience and make it easier to use and
setup without a manual effort.
see #1165closes#1160
prior to commit both would be loaded but in most cases you'd only use
one or the other. when `bond` is available and `_pry_.config.completer`
has not been set to nil before the pry session has started & editline is
not being used(OSX only), then "pry/bond_completer" is loaded. otherwise
the default fallback is Pry::InputCompleter("pry/input_completer")