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

35 commits

Author SHA1 Message Date
John Mair
503e6bb63f edit command: add --method option
* --method doesn't accept any parameters, it only edits the 'current' method associated
with the binding. It's equivalent to 'edit-method' (with no args).
* This option is necessary as 'edit' by itself edits the last expression.
* Note that --method doesn't just edit the current method, if no method exists (i.e binding.pry was not put
inside a method context) then it edits the current OBJECT instead.

TODO:
* explicitly restrict --method to *just* methods and not allow it to fall back to objects?
* allow --method to take a parameter that must be a method object? e.g --method Pry#repl works
but --method Pry would fail ?
2013-01-11 20:47:46 +01:00
☈king
139a2a7a0a Extract Table to its own file 2013-01-09 17:18:44 -06: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
☈king
982b4fa92d More lenient assertion for whereami -n 2013-01-08 15:00:10 -06:00
☈king
f9b9598c11 ls columns improvement
Now is like /bin/ls, sorting downward, shrink-wrapping columns, and
minimizing row usage as best as I know how.
2013-01-08 14:22:20 -06:00
☈king
4e89649ac7 Intermediate merge step 2013-01-08 14:22:20 -06: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
32eb6ca573 implement whereami -n (exclude line numbers) 2013-01-09 01:42:08 +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
Larry Gilbert
611708386e Fix calls to Tempfile.new (GH issue #792)
Suffix of "*.rb" caused temp files to be named with "*.rb"
at the end, literally.  Not all file systems like that, and
it's almost certainly not what was intended.
2013-01-07 15:02:39 -08:00
John Mair
68758e49ab be brave, fully remove the 'edit-method' command
All functionality has been successfully moved to 'edit' command, with all tests passing.
2013-01-01 01:25:43 +01:00
Ryan Fitzgerald
b5455a10bc Fix Regexp warnings on 1.8.7 2012-12-27 17:34:25 -08:00
John Mair
c786862875 alliteration 2012-12-27 23:20:41 +01:00
John Mair
92c345aa12 module_candidate.rb improved class lookup regex
Bug prevented lookup of Deeply::Nested::Class::Definitions.

Also properly differentiate when looking up docs/source for *commands* and for the class that represents the command, i.e:
show-doc show-source #=> displays show-source --help
show-doc Pry::Command::ShowSource #=> comments above class definition (as with any other class)
2012-12-27 23:02:53 +01:00
John Mair
37b9fce976 show-source / show-doc: ensure _file_ and _line_ are set
Also cleaned up some OCD edge cases for show-doc, totally unnecessary & kind of silly
2012-12-22 22:59:03 +01:00
John Mair
d19aef516e show-doc: Removed the horror of ModuleInstrospectionHelpers and method_options
show-doc should be a lot easier to grok now there are no hidden modules adding methods and doing spooky things
behind the scenes.
2012-12-21 16:41:52 +01:00
John Mair
eda2c73afb make show-source code more readable 2012-12-20 20:46:33 +01:00
John Mair
47d30a139c free show-source from the horror of module_introspection_helpers.rb and method_options.rb
show-doc and edit and a variety of other commands can also be updated to use the new Pry::CodeObject API
2012-12-20 20:15:00 +01:00
John Mair
81554dda0a migrating show-source over to new Pry::CodeObject API 2012-12-20 18:05:42 +01:00
John Mair
3663559291 fix tests on ruby 2.0 2012-12-19 12:28:29 +01:00
Conrad Irwin
e59cd57ebf Fix ls formatting spec error 2012-12-09 22:11:09 -08:00
☈king
9b38f33b79 Progress on gist + jruby crash 2012-12-09 23:21:18 -06:00
☈king
2104655a67 Replace gist spec globals with Pad 2012-12-09 19:19:38 -07: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
☈king
8f92f5a855 Use Jist.copy, not a Helper; fix @filename 2012-12-07 08:35:25 -06:00
☈king
c51f75a9fc DRY gist command's docs vs tests 2012-12-06 23:14:04 -06:00
☈king
27bbc4383a gist: fix filenames from REPL + refactor + test
I glommed together too much on this commit. ☹
2012-12-06 22:46:01 -06: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
Andrew Vos
cd5f0ae3be Reading the output of ls is hard, tablify it
ls now shows items more like how the unix ls works
2012-11-29 10:51:08 +00:00
Conrad Irwin
a6c4c6950d Revert "Make whereami more consistent (and less cheeky) [Fixes #383]"
This reverts commit f937bb6097.
2012-11-18 16:42:29 -08:00
Conrad Irwin
f937bb6097 Make whereami more consistent (and less cheeky) [Fixes #383] 2012-11-18 16:29:48 -08:00
Conrad Irwin
71bd613f13 More spec fixtures around 2012-11-18 01:33:32 -08:00
☈king
848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00