Although `_pry_` is a well-established name, it is confusing. `pry_instance` is
a clearer name (arguably the best name). This change was dictated by Rubocop but
I support it. Therefore, I decided to do it, but I realise it's a big change.
`Pry::Command` deprecates `_pry_` and emits a warning. This seems to be the only
place where `_pry_` is used publicly.
Another place where it may affect the user is the sticky locals area. I don't
think it will be a big issue there, though.
I realise that some code might be less readable now, but now that we set a good
default limit, we protect the codebase from further mess. It's important to do
this to prevent adding more mess to already messy code that we have. :doctor:
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.
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.
This is in reference to issue #904. In said issue it was mentioned that
this should be a `-L` flag because it was ostensibly an extension of the
`-l` flag. Felt `-e` was more intention revealing.
And implement play and save-file using the new delegator. 'gist' still needs
to be re-implemented using CodeCollector.
************
TODO:
**************
Couldn't write a test for `play --lines 4..5` with implied target.eval("__FILE__") parameter,
need to come up with a decent test.
* removed most historicla junk from lib/pry/test/helper.rb
* relocated recalcitrant junk to the local spec/helper.rb (this isn't exposed to 3rd parties)
`play 69` is a shortcut for `play --file #{_file_} --lines 69`. It plays
lines from the current file. Example (I omitted some useless
information):
pry(main)> show-source hello
def hello
binding.pry
true
puts "hi"
69
end
pry(main)> hello
1: def hello
=> 2: binding.pry
3: true
4: puts "hi"
5: 69
6: end
pry(main)> play 5
=> 69
pry(main)> play 3..4
hi
=> nil
pry(main)>
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>