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

30 commits

Author SHA1 Message Date
Conrad Irwin
231732616e Merge branch 'feature/ls2' 2011-10-15 01:51:52 -07:00
Conrad Irwin
50e5d47ee7 Add --super to show-method, edit-method et.al. 2011-10-15 01:49:26 -07:00
Ryan Fitzgerald
6fa4e1cbc5 add coderay version to test output 2011-10-09 12:19:11 -07:00
John Mair
8ca04c22df fixed some style issues; renamed Pry.config.indent to Pry.config.auto_indent 2011-10-09 00:40:55 +13:00
Yorick Peterse
e9c2f383eb Pry now indents code similar to IRB.
Code is indented using the class Pry::Indent. This class uses an internal stack
that contains the indentation levels for each line of code. Certain keywords
such as "class" or "def" will add data to this stack so that the next line is
indented, other keywords such as "end" or "}" will remove data from the stack,
causing the next line to be un-indented.

Pry::Indent is hooked into Pry#retrieve_line as well as Pry#readline. This means
that both input strings as well as the ones displayed by "show-method" are
indented. Sadly due to the way Readline works input strings are indented similar
to IRB. This means that instead of the following:

    > class User
    >   def initialize
    >   end
    > end

You'll get the following:

    > class User
    >   def initialize
    >     end
    >   end

While annoying there doesn't seem to be a way to work around this issue. Luckily
the "show-method" command indents your code properly.

By default indentation is turned on. This can be turned off (or back on) using
the configuration item Pry.config.indent. However, if you turn this option off
after a method is defined "show-method" will still show it with indentation as
indentation happens on input rather than only when code is displayed.

For more information see Pry::Indent#indent in lib/pry/indent.rb.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2011-10-05 19:04:44 +02:00
Ryan Fitzgerald
76753fac99 don't show whereami on binding.pry during tests 2011-09-24 13:53:30 +12:00
Ryan Fitzgerald
2d8566e5ed remove temptation to abuse temp_file helper 2011-09-13 20:10:35 -07:00
John Mair
5af4111846 added tests for cat --ex N and edit --ex N, all passing except on RBX 2011-09-14 05:43:57 +12:00
Ryan Fitzgerald
ffbbe044ca add implementation to test output 2011-09-12 19:44:59 -07:00
Ryan Fitzgerald
e13962e66d a bit more cleanup 2011-09-12 01:06:47 -07:00
Eero Saynatkari
d200c8005c Default the redirect_pry_io helper's output to an anonymous StringIO. 2011-09-09 02:49:11 +03:00
John Mair
b3576244db added more rbx helpers (command_helpers.rb) and added limited support for cat --ex on rbx 2011-09-01 15:47:29 +12:00
John Mair
84b0601f4a all special locals are now injected into all bindings for a Pry instance - e.g _ex_ is consistent no matter if you cd into a new context. New 'special local' system, and added tests for the new system 2011-09-01 05:05:21 +12:00
Gosha Arinich
2b70a27f1f show-method and show-doc now accept multiple method names
fixes
2011-08-27 17:21:01 +03:00
Conrad Irwin
f8b7260872 Add mock_pry to tests.
This is the most common using for redirect_pry_io.
2011-08-24 01:02:34 -07:00
Conrad Irwin
13bedefc26 Exclude the current line from History. 2011-07-24 16:20:32 -07:00
David Palm
3d6aa37469 Removing rubygems require now that I know about "rake test" 2011-06-09 13:23:11 +02:00
David Palm
e82e826688 Tests set should_load/should_save instead of load/save on config.history 2011-06-09 12:26:57 +02:00
Rob Gleeson
528a55bda0 Merge branch 'master' of github.com:banister/pry 2011-06-05 23:48:34 +01:00
Rob Gleeson
30d0b7b2f4 Assert that no warnings are emitted by Pry. 2011-06-05 23:41:59 +01:00
John Mair
94a1f993e6 Replaced Pry.config.should_load_plugins with Pry.config.plugins.enabled. Also added Pry.config.plugins.strict_loading config option; also updated test helper to reflect changes 2011-06-02 21:41:56 +12:00
John Mair
b8e7107715 ensure all plugins are disabled for tests 2011-06-01 03:11:57 +12:00
John Mair
34f63c65f6 fixed tests (phew), migrated more code over to Pry.config, made major changes to helper.rb for tests 2011-05-29 01:38:00 +12:00
John Mair
71ad2aa9d1 added a bunch more tests for: hist command, :listing option to commands, regex commands, etc. Turned paging off in helper.rb 2011-05-28 18:05:41 +12:00
John Mair
fc31a44fda added tests for show-method acting on dynamic pry methods 2011-05-25 02:57:18 +12:00
John Mair
8b065971c3 added tests for hist and failing test for hist --replay 2011-05-23 12:32:29 +12:00
John Mair
1be5786dc1 added tests for show-method and show-doc and cd commands, added some more test helpers 2011-05-19 15:31:29 +12:00
Mon ouïe
1750fe4d78 Got rid of CommandSet#name 2011-05-07 07:32:05 +02:00
John Mair
e8776e8a2c added some tests for cd command (and new behaviour) in test_default_commands.rb 2011-05-06 22:56:22 +12:00
Lee Jarvis
eeababc343 rename test to test_pry to allow bacon -a to autotest 2011-04-30 15:36:24 +01:00
Renamed from test/test_helper.rb (Browse further)