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

21 commits

Author SHA1 Message Date
Takashi Kokubun
272b3290b5 Fix Ruby 2.6 warning for Binding#source_location
eval('[__FILE__, __LINE__]') will not work in future Ruby.
Let's stop using it when Binding#source_location is available because it
prints noisy warnings.

Since Binding#source_location is added in Ruby 2.6
https://github.com/ruby/ruby/commit/571e48b7442, this commit is leaving
old code with branching by binding.respond_to?(:source_location).

Fixes #1871
2018-12-11 11:10:55 +09:00
Kyrylo Silin
ccf3c3daa9 rubocop: fix offences of the Style/AndOr cop 2018-11-18 00:22:56 +08:00
Kyrylo Silin
383f97e341 rubocop: fix offences of the Layout/EmptyLineBetweenDefs cop 2018-10-14 14:40:48 +08:00
Kyrylo Silin
f33d82779a rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
Jake Worth
e7f2520728 Fix typo 2015-12-09 07:15:46 -06:00
Travis Yoder
86154b4965 Changes deprecated ‘File.exists’ to ‘File.exist’ 2015-05-10 19:58:16 -06:00
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
John Mair
d682b44b40 Merge pull request #952 from hashrocketeer/play_expression
Add expression flag to play
2013-07-23 17:47:33 -07: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
ZPH
537f39865b Altered play command message as seen in 'help' 2013-06-08 21:40:53 +00:00
Kyrylo Silin
cc736cd777 Commands::Play: fix typo 2013-05-10 13:17:24 +03:00
Kyrylo Silin
fd74b2214e Commands::Play: improve the help output
* Add a few new examples
* Fix typo in the description of `:open` switch
2013-05-10 12:51:49 +03:00
John Mair
703f42b1ee play and amend-line: now use fix-indent to correct broken indentation 2013-01-12 22:29:33 +01:00
Kyrylo Silin
256f35422a Prettify command descriptions, switches and stuff
Wrap command descriptions to 80 characters. Convert some string options
to symbols (where possible). Align options in code. Remove dots in the
end of switch descriptions.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2013-01-09 22:23:19 +02: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
Kyrylo Silin
ebccd57013 Convert all commands to classes
John "banister" Mair describes the following key features of commands
as classes:

  1. It enables people to extend them by either subclassing or
     monkeypatching.
  2. It enables them to provide their own API, so that for example, the
     Pry::Command::Edit class could have class methods for people to
     configure it.

Please, note that I didn't touch easter eggs commands. I also prettified
some strings (your source code reading experience should vastly improve!).

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-12-27 13:31:37 +02:00
Kyrylo Silin
14f7f86b8b Add information about play 1..2 syntax to help
Also, improve some code formatting.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-12-01 05:55:23 +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
Ryan Fitzgerald
1af4207c63 Restore groups, convert most commands to class syntax 2012-08-11 18:27:26 -07:00
Ryan Fitzgerald
8ce49ee081 Remove extended_commands, default_commands -> commands 2012-08-11 17:39:25 -07:00
Renamed from lib/pry/default_commands/play.rb (Browse further)