pry 0.9.11.4 → 0.9.12pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. data/.travis.yml +2 -0
  2. data/Rakefile +4 -0
  3. data/lib/pry.rb +1 -1
  4. data/lib/pry/cli.rb +14 -8
  5. data/lib/pry/code.rb +3 -3
  6. data/lib/pry/command.rb +20 -5
  7. data/lib/pry/command_set.rb +3 -3
  8. data/lib/pry/commands.rb +1 -1
  9. data/lib/pry/commands/disabled_commands.rb +2 -0
  10. data/lib/pry/commands/ls.rb +1 -2
  11. data/lib/pry/commands/reload_code.rb +8 -1
  12. data/lib/pry/commands/show_info.rb +27 -4
  13. data/lib/pry/commands/show_source.rb +2 -1
  14. data/lib/pry/commands/whereami.rb +87 -19
  15. data/lib/pry/completion.rb +7 -4
  16. data/lib/pry/helpers/base_helpers.rb +5 -2
  17. data/lib/pry/helpers/command_helpers.rb +3 -1
  18. data/lib/pry/helpers/documentation_helpers.rb +18 -7
  19. data/lib/pry/helpers/table.rb +4 -4
  20. data/lib/pry/indent.rb +2 -7
  21. data/lib/pry/method.rb +89 -129
  22. data/lib/pry/method/disowned.rb +53 -0
  23. data/lib/pry/method/weird_method_locator.rb +186 -0
  24. data/lib/pry/module_candidate.rb +3 -3
  25. data/lib/pry/pager.rb +13 -11
  26. data/lib/pry/pry_class.rb +10 -3
  27. data/lib/pry/terminal.rb +73 -0
  28. data/lib/pry/version.rb +1 -1
  29. data/lib/pry/wrapped_module.rb +51 -1
  30. data/spec/command_helpers_spec.rb +21 -1
  31. data/spec/commands/ls_spec.rb +4 -0
  32. data/spec/commands/show_doc_spec.rb +28 -28
  33. data/spec/commands/show_source_spec.rb +70 -22
  34. data/spec/commands/whereami_spec.rb +60 -11
  35. data/spec/documentation_helper_spec.rb +73 -0
  36. data/spec/fixtures/whereami_helper.rb +6 -0
  37. data/spec/helpers/table_spec.rb +19 -0
  38. data/spec/method_spec.rb +24 -7
  39. metadata +13 -7
  40. data/lib/pry/commands/deprecated_commands.rb +0 -2
  41. data/lib/pry/terminal_info.rb +0 -48
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11.4
5
- prerelease:
4
+ version: 0.9.12pre1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - John Mair (banisterfiend)
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-01-20 00:00:00.000000000 Z
14
+ date: 2013-02-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: coderay
@@ -200,8 +200,8 @@ files:
200
200
  - lib/pry/commands/cat/input_expression_formatter.rb
201
201
  - lib/pry/commands/cd.rb
202
202
  - lib/pry/commands/code_collector.rb
203
- - lib/pry/commands/deprecated_commands.rb
204
203
  - lib/pry/commands/disable_pry.rb
204
+ - lib/pry/commands/disabled_commands.rb
205
205
  - lib/pry/commands/easter_eggs.rb
206
206
  - lib/pry/commands/edit.rb
207
207
  - lib/pry/commands/edit/exception_patcher.rb
@@ -261,6 +261,8 @@ files:
261
261
  - lib/pry/hooks.rb
262
262
  - lib/pry/indent.rb
263
263
  - lib/pry/method.rb
264
+ - lib/pry/method/disowned.rb
265
+ - lib/pry/method/weird_method_locator.rb
264
266
  - lib/pry/module_candidate.rb
265
267
  - lib/pry/pager.rb
266
268
  - lib/pry/plugins.rb
@@ -270,7 +272,7 @@ files:
270
272
  - lib/pry/rbx_path.rb
271
273
  - lib/pry/repl_file_loader.rb
272
274
  - lib/pry/rubygem.rb
273
- - lib/pry/terminal_info.rb
275
+ - lib/pry/terminal.rb
274
276
  - lib/pry/test/helper.rb
275
277
  - lib/pry/version.rb
276
278
  - lib/pry/wrapped_module.rb
@@ -310,6 +312,7 @@ files:
310
312
  - spec/commands/whereami_spec.rb
311
313
  - spec/completion_spec.rb
312
314
  - spec/control_d_handler_spec.rb
315
+ - spec/documentation_helper_spec.rb
313
316
  - spec/editor_spec.rb
314
317
  - spec/exception_whitelist_spec.rb
315
318
  - spec/fixtures/candidate_helper1.rb
@@ -319,6 +322,7 @@ files:
319
322
  - spec/fixtures/show_source_doc_examples.rb
320
323
  - spec/fixtures/testrc
321
324
  - spec/fixtures/testrcbad
325
+ - spec/fixtures/whereami_helper.rb
322
326
  - spec/helper.rb
323
327
  - spec/helpers/bacon.rb
324
328
  - spec/helpers/mock_pry.rb
@@ -354,9 +358,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
354
358
  required_rubygems_version: !ruby/object:Gem::Requirement
355
359
  none: false
356
360
  requirements:
357
- - - ! '>='
361
+ - - ! '>'
358
362
  - !ruby/object:Gem::Version
359
- version: '0'
363
+ version: 1.3.1
360
364
  requirements: []
361
365
  rubyforge_project:
362
366
  rubygems_version: 1.8.24
@@ -396,6 +400,7 @@ test_files:
396
400
  - spec/commands/whereami_spec.rb
397
401
  - spec/completion_spec.rb
398
402
  - spec/control_d_handler_spec.rb
403
+ - spec/documentation_helper_spec.rb
399
404
  - spec/editor_spec.rb
400
405
  - spec/exception_whitelist_spec.rb
401
406
  - spec/fixtures/candidate_helper1.rb
@@ -405,6 +410,7 @@ test_files:
405
410
  - spec/fixtures/show_source_doc_examples.rb
406
411
  - spec/fixtures/testrc
407
412
  - spec/fixtures/testrcbad
413
+ - spec/fixtures/whereami_helper.rb
408
414
  - spec/helper.rb
409
415
  - spec/helpers/bacon.rb
410
416
  - spec/helpers/mock_pry.rb
@@ -1,2 +0,0 @@
1
- Pry::Commands.deprecated_command("edit-method", "Use `edit` instead.")
2
- Pry::Commands.deprecated_command("show-command", "Use show-source [command_name] instead.")
@@ -1,48 +0,0 @@
1
- class Pry::TerminalInfo
2
- # Return a pair of [rows, columns] which gives the size of the window.
3
- #
4
- # If the window size cannot be determined, return nil.
5
- def self.screen_size
6
- rows, cols = actual_screen_size
7
- if rows && cols
8
- [rows.to_i, cols.to_i]
9
- else
10
- nil
11
- end
12
- end
13
-
14
- # Return a screen width or a default if it fails.
15
- def self.width! default = 80
16
- (screen_size || [nil, default])[1]
17
- end
18
-
19
- def self.actual_screen_size
20
- [
21
- # Some readlines also provides get_screen_size.
22
- # Readline comes before IO#winsize because jruby sometimes defaults winsize to [25, 80]
23
- readline_screen_size,
24
-
25
- # io/console adds a winsize method to IO streams.
26
- # rescue nil for jruby 1.7.0 [jruby/jruby#354]
27
- $stdout.tty? && $stdout.respond_to?(:winsize) && ($stdout.winsize rescue nil),
28
-
29
- # Otherwise try to use the environment (this may be out of date due
30
- # to window resizing, but it's better than nothing).
31
- [ENV["LINES"] || ENV["ROWS"], ENV["COLUMNS"]],
32
-
33
- # If the user is running within ansicon, then use the screen size
34
- # that it reports (same caveats apply as with ROWS and COLUMNS)
35
- ENV['ANSICON'] =~ /\((.*)x(.*)\)/ && [$2, $1],
36
- ].detect do |(_, cols)|
37
- cols.to_i > 0
38
- end
39
- end
40
-
41
- def self.readline_screen_size
42
- Readline.get_screen_size if Readline.respond_to?(:get_screen_size)
43
- rescue Java::JavaLang::NullPointerException
44
- # This rescue won't happen on jrubies later than:
45
- # https://github.com/jruby/jruby/pull/436
46
- nil
47
- end
48
- end