1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

15 commits

Author SHA1 Message Date
Uros Jurglic
0262e827ae Add print option to play command (resolves #864)
When print option in play is used, it prints the executed code.
2013-12-12 10:11:00 +01:00
Jonathan Jackson and Travis Anderson
d6176275b6 Add expression flag to play
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.
2013-07-22 19:03:23 -04:00
Conrad Irwin
2c60f93b2d Merge branch 'wip.refactor'
Conflicts:
	lib/pry/completion.rb
	lib/pry/pry_instance.rb
	spec/commands/play_spec.rb
	spec/pry_defaults_spec.rb
2013-01-18 00:19:38 -08:00
John Mair
75d1380c07 play specs: rewrite -i spec to use redirect_pry_io
This is because pry_tester doesn't work when the eval_string is mutated by a command
2013-01-14 17:06:08 +01:00
John Mair
703f42b1ee play and amend-line: now use fix-indent to correct broken indentation 2013-01-12 22:29:33 +01:00
John Mair
8732bb1025 updated play_spec.rb to check for errors
Also added play spec for multi-ranged -i options but does not work
for some weird reason?!
2013-01-12 22:29:32 +01:00
John Mair
4a059fd3a6 Pry::Command::CodeCollector: replace module inclusion with delegation
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.
2013-01-09 01:42:09 +01:00
John Mair
439c5c6811 Reimplemented play, save-file with Pry::Command::CodeCollector
Pry::Command::CodeCollector is a mixin that extracts out shared
functionality from play, save-file and gist. Gist is yet to be
reimplemented.
2013-01-09 01:42:08 +01:00
Ryan Fitzgerald
1ea1927b43 Rename accept_line to eval 2012-12-27 22:06:50 -08:00
Ryan Fitzgerald
7313581093 Fix play_spec and command_integration_spec 2012-12-18 00:53:32 -08:00
John Mair
9a279461c1 PryTestHelpers methods are now module_functions, included into Bacon::Context by default 2012-12-07 23:08:49 +01:00
John Mair
31a9578228 cleaned up lib/pry/test/helper.rb
* 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)
2012-12-07 21:41:05 +01:00
Kyrylo Silin
9b85398d29 Remove some repetitive bits from play_spec.rb
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-12-01 05:49:27 +02:00
Kyrylo Silin
de50544759 Add support for play 69 syntax
`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>
2012-12-01 05:22:16 +02:00
☈king
848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00
Renamed from test/test_commands/test_play.rb (Browse further)