pry 0.12.2 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +158 -1
  3. data/LICENSE +1 -1
  4. data/README.md +331 -269
  5. data/bin/pry +5 -0
  6. data/lib/pry/basic_object.rb +8 -4
  7. data/lib/pry/block_command.rb +22 -0
  8. data/lib/pry/class_command.rb +194 -0
  9. data/lib/pry/cli.rb +44 -55
  10. data/lib/pry/code/code_file.rb +28 -24
  11. data/lib/pry/code/code_range.rb +4 -2
  12. data/lib/pry/code/loc.rb +15 -8
  13. data/lib/pry/code.rb +40 -28
  14. data/lib/pry/code_object.rb +40 -38
  15. data/lib/pry/color_printer.rb +47 -46
  16. data/lib/pry/command.rb +166 -369
  17. data/lib/pry/command_set.rb +76 -73
  18. data/lib/pry/command_state.rb +31 -0
  19. data/lib/pry/commands/amend_line.rb +86 -81
  20. data/lib/pry/commands/bang.rb +18 -14
  21. data/lib/pry/commands/bang_pry.rb +15 -11
  22. data/lib/pry/commands/cat/abstract_formatter.rb +23 -18
  23. data/lib/pry/commands/cat/exception_formatter.rb +71 -60
  24. data/lib/pry/commands/cat/file_formatter.rb +55 -49
  25. data/lib/pry/commands/cat/input_expression_formatter.rb +35 -30
  26. data/lib/pry/commands/cat.rb +61 -54
  27. data/lib/pry/commands/cd.rb +40 -35
  28. data/lib/pry/commands/change_inspector.rb +29 -22
  29. data/lib/pry/commands/change_prompt.rb +44 -39
  30. data/lib/pry/commands/clear_screen.rb +16 -10
  31. data/lib/pry/commands/code_collector.rb +148 -133
  32. data/lib/pry/commands/disable_pry.rb +23 -19
  33. data/lib/pry/commands/easter_eggs.rb +19 -30
  34. data/lib/pry/commands/edit/exception_patcher.rb +21 -17
  35. data/lib/pry/commands/edit/file_and_line_locator.rb +34 -23
  36. data/lib/pry/commands/edit.rb +184 -161
  37. data/lib/pry/commands/exit.rb +39 -35
  38. data/lib/pry/commands/exit_all.rb +24 -20
  39. data/lib/pry/commands/exit_program.rb +20 -16
  40. data/lib/pry/commands/find_method.rb +168 -160
  41. data/lib/pry/commands/fix_indent.rb +16 -12
  42. data/lib/pry/commands/help.rb +140 -133
  43. data/lib/pry/commands/hist.rb +151 -150
  44. data/lib/pry/commands/import_set.rb +20 -16
  45. data/lib/pry/commands/jump_to.rb +25 -21
  46. data/lib/pry/commands/list_inspectors.rb +35 -28
  47. data/lib/pry/commands/ls/constants.rb +59 -42
  48. data/lib/pry/commands/ls/formatter.rb +50 -46
  49. data/lib/pry/commands/ls/globals.rb +38 -34
  50. data/lib/pry/commands/ls/grep.rb +17 -13
  51. data/lib/pry/commands/ls/instance_vars.rb +29 -27
  52. data/lib/pry/commands/ls/interrogatable.rb +18 -12
  53. data/lib/pry/commands/ls/jruby_hacks.rb +47 -41
  54. data/lib/pry/commands/ls/local_names.rb +26 -22
  55. data/lib/pry/commands/ls/local_vars.rb +38 -28
  56. data/lib/pry/commands/ls/ls_entity.rb +47 -51
  57. data/lib/pry/commands/ls/methods.rb +44 -43
  58. data/lib/pry/commands/ls/methods_helper.rb +46 -42
  59. data/lib/pry/commands/ls/self_methods.rb +23 -22
  60. data/lib/pry/commands/ls.rb +124 -102
  61. data/lib/pry/commands/nesting.rb +21 -17
  62. data/lib/pry/commands/play.rb +93 -82
  63. data/lib/pry/commands/pry_backtrace.rb +22 -17
  64. data/lib/pry/commands/pry_version.rb +15 -11
  65. data/lib/pry/commands/raise_up.rb +27 -22
  66. data/lib/pry/commands/reload_code.rb +60 -48
  67. data/lib/pry/commands/reset.rb +16 -12
  68. data/lib/pry/commands/ri.rb +55 -45
  69. data/lib/pry/commands/save_file.rb +45 -43
  70. data/lib/pry/commands/shell_command.rb +51 -51
  71. data/lib/pry/commands/shell_mode.rb +21 -17
  72. data/lib/pry/commands/show_doc.rb +80 -68
  73. data/lib/pry/commands/show_info.rb +189 -171
  74. data/lib/pry/commands/show_input.rb +16 -11
  75. data/lib/pry/commands/show_source.rb +110 -45
  76. data/lib/pry/commands/stat.rb +35 -31
  77. data/lib/pry/commands/switch_to.rb +21 -15
  78. data/lib/pry/commands/toggle_color.rb +20 -16
  79. data/lib/pry/commands/watch_expression/expression.rb +32 -27
  80. data/lib/pry/commands/watch_expression.rb +89 -86
  81. data/lib/pry/commands/whereami.rb +156 -148
  82. data/lib/pry/commands/wtf.rb +75 -50
  83. data/lib/pry/config/attributable.rb +22 -0
  84. data/lib/pry/config/lazy_value.rb +29 -0
  85. data/lib/pry/config/memoized_value.rb +34 -0
  86. data/lib/pry/config/value.rb +24 -0
  87. data/lib/pry/config.rb +307 -25
  88. data/lib/pry/control_d_handler.rb +28 -0
  89. data/lib/pry/core_extensions.rb +9 -7
  90. data/lib/pry/editor.rb +48 -21
  91. data/lib/pry/env.rb +18 -0
  92. data/lib/pry/exception_handler.rb +43 -0
  93. data/lib/pry/exceptions.rb +13 -16
  94. data/lib/pry/forwardable.rb +5 -1
  95. data/lib/pry/helpers/base_helpers.rb +68 -197
  96. data/lib/pry/helpers/command_helpers.rb +50 -61
  97. data/lib/pry/helpers/documentation_helpers.rb +21 -13
  98. data/lib/pry/helpers/options_helpers.rb +14 -7
  99. data/lib/pry/helpers/platform.rb +7 -5
  100. data/lib/pry/helpers/table.rb +33 -26
  101. data/lib/pry/helpers/text.rb +22 -19
  102. data/lib/pry/helpers.rb +2 -0
  103. data/lib/pry/history.rb +48 -56
  104. data/lib/pry/hooks.rb +21 -12
  105. data/lib/pry/indent.rb +54 -50
  106. data/lib/pry/input_completer.rb +248 -230
  107. data/lib/pry/input_lock.rb +8 -9
  108. data/lib/pry/inspector.rb +36 -24
  109. data/lib/pry/last_exception.rb +45 -45
  110. data/lib/pry/method/disowned.rb +16 -4
  111. data/lib/pry/method/patcher.rb +12 -3
  112. data/lib/pry/method/weird_method_locator.rb +68 -44
  113. data/lib/pry/method.rb +141 -94
  114. data/lib/pry/object_path.rb +33 -25
  115. data/lib/pry/output.rb +121 -35
  116. data/lib/pry/pager.rb +41 -42
  117. data/lib/pry/prompt.rb +123 -54
  118. data/lib/pry/pry_class.rb +61 -103
  119. data/lib/pry/pry_instance.rb +217 -215
  120. data/lib/pry/repl.rb +18 -22
  121. data/lib/pry/repl_file_loader.rb +27 -21
  122. data/lib/pry/ring.rb +11 -6
  123. data/lib/pry/slop/commands.rb +164 -169
  124. data/lib/pry/slop/option.rb +172 -168
  125. data/lib/pry/slop.rb +574 -563
  126. data/lib/pry/syntax_highlighter.rb +26 -0
  127. data/lib/pry/system_command_handler.rb +17 -0
  128. data/lib/pry/testable/evalable.rb +21 -12
  129. data/lib/pry/testable/mockable.rb +18 -10
  130. data/lib/pry/testable/pry_tester.rb +71 -56
  131. data/lib/pry/testable/utility.rb +29 -21
  132. data/lib/pry/testable/variables.rb +49 -43
  133. data/lib/pry/testable.rb +59 -61
  134. data/lib/pry/version.rb +3 -1
  135. data/lib/pry/warning.rb +27 -0
  136. data/lib/pry/wrapped_module/candidate.rb +21 -14
  137. data/lib/pry/wrapped_module.rb +51 -42
  138. data/lib/pry.rb +132 -119
  139. metadata +34 -34
  140. data/lib/pry/commands/disabled_commands.rb +0 -2
  141. data/lib/pry/commands/gem_cd.rb +0 -26
  142. data/lib/pry/commands/gem_install.rb +0 -32
  143. data/lib/pry/commands/gem_list.rb +0 -33
  144. data/lib/pry/commands/gem_open.rb +0 -29
  145. data/lib/pry/commands/gem_readme.rb +0 -25
  146. data/lib/pry/commands/gem_search.rb +0 -40
  147. data/lib/pry/commands/gem_stats.rb +0 -83
  148. data/lib/pry/commands/gist.rb +0 -102
  149. data/lib/pry/commands/install_command.rb +0 -54
  150. data/lib/pry/commands.rb +0 -6
  151. data/lib/pry/config/behavior.rb +0 -255
  152. data/lib/pry/config/convenience.rb +0 -28
  153. data/lib/pry/config/default.rb +0 -159
  154. data/lib/pry/config/memoization.rb +0 -48
  155. data/lib/pry/platform.rb +0 -91
  156. data/lib/pry/plugins.rb +0 -122
  157. data/lib/pry/rubygem.rb +0 -84
  158. data/lib/pry/terminal.rb +0 -91
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6320662aa62bb2b7410cb900e5e0d75e075413da
4
- data.tar.gz: d72635ecb0613ee87e6bf7fbc37c71573f1137ce
2
+ SHA256:
3
+ metadata.gz: d3d394fb61f0a41511177954f810a8aa4ab0c390baa89e538878121806a28c08
4
+ data.tar.gz: d36e350eb1e8ff448e088dab7233f6c9f28849f6ae94d3eed0b9ad4768ade770
5
5
  SHA512:
6
- metadata.gz: 396ab2db71196633ab518104409ae367d67c9c9e64a318bdecbef0e40010364cc207211f808f2e616d9909ec93b256b5bc0f58a458f7ac97d195eee8ee6d7e71
7
- data.tar.gz: f74d3c223f09b7d06af0a30500176a6caa10474646ce59fb787d6a5936ab420828a399679d55f7fa0a106ab2f5f45d622748cb13804af85032621151c1147a94
6
+ metadata.gz: fe3608e5e7046c474a6e8b077dded9bfc091bfdeaa44d178bb69e66bbeaafaca2a3447fac31dd6d5d5bab8ecc10cbb2e2de327f3c4f55393d4024a45f6407b55
7
+ data.tar.gz: 1596aef2f91334198c2705f79fa6c93e324cd89071a1f6c04c60c471a5c168864c8a3bb991c1d362b5fd5e040782c4a680e7b1eb3cbf4324258c11379d8019f0
data/CHANGELOG.md CHANGED
@@ -1,4 +1,157 @@
1
- ### HEAD
1
+ ### master
2
+
3
+ ### [v0.14.1][v0.14.1] (April 12, 2021)
4
+
5
+ #### Bug fixes
6
+
7
+ * Fixed bad coloring of some RDoc-style docs
8
+ ([#2182](https://github.com/pry/pry/pull/2182))
9
+ * Fixed broken `--plugins` option. It shows a warning now
10
+ ([#2180](https://github.com/pry/pry/pull/2180))
11
+ * Fixed bad output on printing non-visible characters with color codes
12
+ ([#2154](https://github.com/pry/pry/pull/2154))
13
+ * Fixed bad output when colors are disabled and a string with color codes is
14
+ printed ([#2158](https://github.com/pry/pry/pull/2158))
15
+
16
+ ### [v0.14.0][v0.14.0] (February 8, 2021)
17
+
18
+ #### Features
19
+
20
+ * Made `?` an alias to `show-source -d`
21
+ ([#2133](https://github.com/pry/pry/pull/2133))
22
+ * Added support for Ruby 3.0
23
+
24
+ #### Breaking changes
25
+
26
+ * Deleted support for plugin autoloading
27
+ ([#2119](https://github.com/pry/pry/pull/2119)). In order to load a Pry plugin
28
+ you must `require` it from your `pryrc` or add it to your Gemfile.
29
+
30
+ ```rb
31
+ # ~/.pryrc
32
+ require 'pryrc'
33
+ ```
34
+
35
+ ### [v0.13.1][v0.13.1] (April 12, 2020)
36
+
37
+ #### Bug fixes
38
+
39
+ * Fixed bug where on invalid input only the last syntax error is displayed
40
+ (instead of all of them) ([#2117](https://github.com/pry/pry/pull/2117))
41
+ * Fixed `Pry::Config` raising `NoMethodError` on undefined option instead of
42
+ returning `nil` (usually invoked via `Pry.config.foo_option` calls)
43
+ ([#2126](https://github.com/pry/pry/pull/2126))
44
+ * Fixed `help` command not displaying regexp aliases properly
45
+ ([#2120](https://github.com/pry/pry/pull/2120))
46
+ * Fixed `pry-backtrace` not working ([#2122](https://github.com/pry/pry/pull/2122))
47
+
48
+ ### [v0.13.0][v0.13.0] (March 21, 2020)
49
+
50
+ #### Features
51
+
52
+ * Added metadata to the gem (such as changelog URI, source code URI & bug
53
+ tracker URI), so it shows on https://rubygems.org/gems/pry
54
+ ([#1869](https://github.com/pry/pry/pull/1869))
55
+ * Added ability to forward ARGV to a Pry session via `--` (or `-`) when
56
+ launching Pry from shell
57
+ ([#1902](https://github.com/pry/pry/commit/5cd65d3c0eb053f6edcdf571eea5d0cd990626ed))
58
+ * Added `Pry::Config::LazyValue` & `Pry::Config::MemoizedValue`, which allow
59
+ storing callable procs in the config
60
+ ([#2024](https://github.com/pry/pry/pull/2024))
61
+ * Added the `rc_file` config option that tells Pry the path to `pryrc`
62
+ ([#2027](https://github.com/pry/pry/pull/2027))
63
+ * Added the `--code` flag to the `wtf` command, which shows code for each
64
+ backtrace frame ([#2037](https://github.com/pry/pry/pull/2037))
65
+ * Added the ability to paste method call chains with leading dots
66
+ ([#2060](https://github.com/pry/pry/pull/2060))
67
+
68
+ #### API changes
69
+
70
+ * `Pry::Prompt` is a class now and it can be instantiated to create new prompts
71
+ on the fly that are not registered with `Pry::Prompt#add`. Learn more about
72
+ its API in the docs ([#1877](https://github.com/pry/pry/pull/1877))
73
+
74
+ #### Deprecations
75
+
76
+ * Deprecated `Pry.config.exception_whitelist` in favor of
77
+ `Pry.config.unrescued_exceptions`
78
+ ([#1874](https://github.com/pry/pry/pull/1874))
79
+ * Deprecated `Pry.config.prompt = Pry::Prompt[:simple][:value]` in favor of
80
+ `Pry.config.prompt = Pry::Prompt[:simple]` when setting Pry prompt via
81
+ `pryrc`. `Pry::Prompt[:simple]` would return an instance of `Pry::Prompt`
82
+ instead of `Hash` ([#1877](https://github.com/pry/pry/pull/1877))
83
+ * Deprecated setting prompt via an array of two procs:
84
+ ([#1877](https://github.com/pry/pry/pull/1877))
85
+
86
+ ```ruby
87
+ # Deprecated, emits a warning.
88
+ Pry.config.prompt = [proc {}, proc {}]
89
+ ```
90
+
91
+ This will be removed in the next release.
92
+ * Deprecated the `show-doc` command. The `show-source -d` is the new recommended
93
+ way of reading docs ([#1934](https://github.com/pry/pry/pull/1934))
94
+ * Deprecated `Pry::Command#_pry_`. Use `Pry::Command#pry_instance` instead
95
+ ([#1989](https://github.com/pry/pry/pull/1989))
96
+
97
+ #### Breaking changes
98
+
99
+ * Deleted deprecated `Pry::Platform`
100
+ ([#1863](https://github.com/pry/pry/pull/1863))
101
+ * Deleted deprecated `Pry#{input/output}_array`
102
+ ([#1884](https://github.com/pry/pry/pull/1864))
103
+ * Deleted deprecated `Pry::Prompt::MAP`
104
+ ([#1866](https://github.com/pry/pry/pull/1866))
105
+ * Deleted deprecated methods of `Pry::Helpers::BaseHelpers` such as `mac_osx?`,
106
+ `linux?`, `windows?`, `windows_ansi?`, `jruby?`, `jruby_19?`, `mri?`,
107
+ `mri_19?`, `mri_2?` ([#1867](https://github.com/pry/pry/pull/1867))
108
+ * Deleted deprecated `Pry::Command#text`
109
+ ([#1865](https://github.com/pry/pry/pull/1865))
110
+ * Deleted deprecated `Pry::Method#all_from_common`
111
+ ([#1868](https://github.com/pry/pry/pull/1868))
112
+ * Deleted `install-command` ([#1979](https://github.com/pry/pry/pull/1979))
113
+ * Deleted `Pry::Helpers::BaseHelpers#command_dependencies_met?`
114
+ ([#1979](https://github.com/pry/pry/pull/1979))
115
+ * Deleted commands: `gem-cd`, `gem-install`, `gem-list`, `gem-open`,
116
+ `gem-readme`, `gem-search`, `gem-stats`
117
+ ([#1981](https://github.com/pry/pry/pull/1981))
118
+ * Deleted deprecated commands: `edit-method` and `show-command`
119
+ ([#2001](https://github.com/pry/pry/pull/2001))
120
+ * Deleted `Pry::Command#disabled_commands`
121
+ ([#2001](https://github.com/pry/pry/pull/2001))
122
+ * Deleted `Pry::BlockCommand#opts` (use `#context` instead)
123
+ ([#2003](https://github.com/pry/pry/pull/2003))
124
+ * Deleted `Pry.lazy` (use `Pry::Config::LazyValue` instead)
125
+ ([#2024](https://github.com/pry/pry/pull/2024))
126
+
127
+ #### Bug fixes
128
+
129
+ * Fixed bug where using `Pry.config.prompt_name` can return a
130
+ `Pry::Config::Lazy` instead of expected instance of `String`
131
+ ([#1890](https://github.com/pry/pry/commit/c8f23b3464d596c08922dc923c64bb57488e6227))
132
+ * Fixed `LoadError` being raised when using auto completions and Bundler
133
+ ([#1896](https://github.com/pry/pry/commit/85850f47e074fe01f93e5cb7d561e7c2de7aede9))
134
+ * Fixed bug where `Pry.input_ring` doesn't append duplicate elements
135
+ ([#1898](https://github.com/pry/pry/pull/1898))
136
+ * Fixed Ruby 2.6 warning about `Binding#source_location`
137
+ ([#1904](https://github.com/pry/pry/pull/1904))
138
+ * Fixed wrong `winsize` when custom `output` is passed to Pry
139
+ ([#2045](https://github.com/pry/pry/pull/2045))
140
+ * Fixed `XDG_CONFIG_HOME` & `XDG_DATA_HOME` precedence. When these env variables
141
+ are set, Pry no longer uses traditional files like `~/.pryrc` &
142
+ `~/.pry_history`. Instead, the env variable paths are loaded first
143
+ ([#2056](https://github.com/pry/pry/pull/2056))
144
+ * Fixed the `$SAFE will become a normal global variable in Ruby 3.0` warning on
145
+ Ruby 2.7 ([#2107](https://github.com/pry/pry/pull/2107))
146
+ * Fixed bug when `whereami -c` cannot show beginning of the class, which is on
147
+ the same line as another expression
148
+ ([#2098](https://github.com/pry/pry/pull/2098))
149
+ * Fixed bug when `Object#owner` is defined, which results into somewhat broken
150
+ method introspection ([#2113](https://github.com/pry/pry/pull/2113))
151
+ * Fixed bug when indentation leaves parts of input after pressing enter when
152
+ Readline is enabled with mode indicators for vi mode. This was supposed to be
153
+ fixed in v0.12.2 but it regressed
154
+ ([#2114](https://github.com/pry/pry/pull/2114))
2
155
 
3
156
  ### [v0.12.2][v0.12.2] (November 12, 2018)
4
157
 
@@ -951,3 +1104,7 @@ complete CHANGELOG:
951
1104
  [v0.12.0]: https://github.com/pry/pry/releases/tag/v0.12.0
952
1105
  [v0.12.1]: https://github.com/pry/pry/releases/tag/v0.12.1
953
1106
  [v0.12.2]: https://github.com/pry/pry/releases/tag/v0.12.2
1107
+ [v0.13.0]: https://github.com/pry/pry/releases/tag/v0.13.0
1108
+ [v0.13.1]: https://github.com/pry/pry/releases/tag/v0.13.1
1109
+ [v0.14.0]: https://github.com/pry/pry/releases/tag/v0.14.0
1110
+ [v0.14.1]: https://github.com/pry/pry/releases/tag/v0.14.1
data/LICENSE CHANGED
@@ -3,7 +3,7 @@ License
3
3
 
4
4
  (The MIT License)
5
5
 
6
- Copyright (c) 2018 The Pry Team
6
+ Copyright (c) 2018 John Mair (banisterfiend)
7
7
 
8
8
  Permission is hereby granted, free of charge, to any person obtaining
9
9
  a copy of this software and associated documentation files (the