pry 0.10.4 → 0.12.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +251 -16
  3. data/LICENSE +1 -1
  4. data/README.md +35 -51
  5. data/bin/pry +3 -11
  6. data/lib/pry/basic_object.rb +6 -0
  7. data/lib/pry/cli.rb +50 -52
  8. data/lib/pry/code/code_file.rb +13 -6
  9. data/lib/pry/code/code_range.rb +3 -3
  10. data/lib/pry/code/loc.rb +14 -8
  11. data/lib/pry/code.rb +11 -6
  12. data/lib/pry/code_object.rb +27 -4
  13. data/lib/pry/color_printer.rb +20 -10
  14. data/lib/pry/command.rb +76 -45
  15. data/lib/pry/command_set.rb +17 -45
  16. data/lib/pry/commands/amend_line.rb +3 -4
  17. data/lib/pry/commands/bang.rb +1 -1
  18. data/lib/pry/commands/cat/exception_formatter.rb +10 -8
  19. data/lib/pry/commands/cat/file_formatter.rb +7 -3
  20. data/lib/pry/commands/cat/input_expression_formatter.rb +1 -1
  21. data/lib/pry/commands/cat.rb +7 -6
  22. data/lib/pry/commands/change_prompt.rb +29 -9
  23. data/lib/pry/commands/clear_screen.rb +14 -0
  24. data/lib/pry/commands/code_collector.rb +25 -23
  25. data/lib/pry/commands/easter_eggs.rb +12 -12
  26. data/lib/pry/commands/edit/file_and_line_locator.rb +1 -1
  27. data/lib/pry/commands/edit.rb +15 -10
  28. data/lib/pry/commands/exit.rb +2 -1
  29. data/lib/pry/commands/find_method.rb +12 -14
  30. data/lib/pry/commands/gem_cd.rb +1 -1
  31. data/lib/pry/commands/gem_install.rb +2 -2
  32. data/lib/pry/commands/gem_list.rb +2 -2
  33. data/lib/pry/commands/gem_open.rb +2 -2
  34. data/lib/pry/commands/gem_readme.rb +25 -0
  35. data/lib/pry/commands/gem_search.rb +40 -0
  36. data/lib/pry/commands/gem_stats.rb +83 -0
  37. data/lib/pry/commands/gist.rb +7 -6
  38. data/lib/pry/commands/help.rb +3 -3
  39. data/lib/pry/commands/hist.rb +11 -10
  40. data/lib/pry/commands/import_set.rb +2 -1
  41. data/lib/pry/commands/install_command.rb +7 -6
  42. data/lib/pry/commands/jump_to.rb +7 -7
  43. data/lib/pry/commands/list_inspectors.rb +2 -2
  44. data/lib/pry/commands/ls/constants.rb +14 -3
  45. data/lib/pry/commands/ls/formatter.rb +4 -2
  46. data/lib/pry/commands/ls/globals.rb +0 -2
  47. data/lib/pry/commands/ls/grep.rb +0 -2
  48. data/lib/pry/commands/ls/instance_vars.rb +0 -1
  49. data/lib/pry/commands/ls/jruby_hacks.rb +2 -2
  50. data/lib/pry/commands/ls/local_names.rb +0 -2
  51. data/lib/pry/commands/ls/local_vars.rb +0 -2
  52. data/lib/pry/commands/ls/ls_entity.rb +0 -1
  53. data/lib/pry/commands/ls/methods.rb +0 -3
  54. data/lib/pry/commands/ls/methods_helper.rb +1 -1
  55. data/lib/pry/commands/ls/self_methods.rb +2 -1
  56. data/lib/pry/commands/ls.rb +30 -31
  57. data/lib/pry/commands/play.rb +3 -4
  58. data/lib/pry/commands/pry_backtrace.rb +1 -1
  59. data/lib/pry/commands/raise_up.rb +2 -1
  60. data/lib/pry/commands/reload_code.rb +2 -2
  61. data/lib/pry/commands/ri.rb +9 -4
  62. data/lib/pry/commands/shell_command.rb +36 -9
  63. data/lib/pry/commands/shell_mode.rb +6 -6
  64. data/lib/pry/commands/show_doc.rb +5 -7
  65. data/lib/pry/commands/show_info.rb +35 -20
  66. data/lib/pry/commands/show_source.rb +5 -2
  67. data/lib/pry/commands/stat.rb +1 -1
  68. data/lib/pry/commands/watch_expression/expression.rb +1 -1
  69. data/lib/pry/commands/watch_expression.rb +9 -7
  70. data/lib/pry/commands/whereami.rb +11 -10
  71. data/lib/pry/commands/wtf.rb +15 -2
  72. data/lib/pry/config/behavior.rb +230 -114
  73. data/lib/pry/config/convenience.rb +24 -21
  74. data/lib/pry/config/default.rb +151 -153
  75. data/lib/pry/config/memoization.rb +48 -0
  76. data/lib/pry/config.rb +30 -19
  77. data/lib/pry/core_extensions.rb +15 -4
  78. data/lib/pry/editor.rb +5 -12
  79. data/lib/pry/exceptions.rb +1 -3
  80. data/lib/pry/forwardable.rb +23 -0
  81. data/lib/pry/helpers/base_helpers.rb +197 -110
  82. data/lib/pry/helpers/command_helpers.rb +5 -4
  83. data/lib/pry/helpers/documentation_helpers.rb +3 -2
  84. data/lib/pry/helpers/options_helpers.rb +6 -6
  85. data/lib/pry/helpers/platform.rb +58 -0
  86. data/lib/pry/helpers/table.rb +20 -15
  87. data/lib/pry/helpers/text.rb +82 -74
  88. data/lib/pry/helpers.rb +1 -0
  89. data/lib/pry/history.rb +43 -9
  90. data/lib/pry/hooks.rb +50 -109
  91. data/lib/pry/indent.rb +21 -19
  92. data/lib/pry/input_completer.rb +146 -123
  93. data/lib/pry/input_lock.rb +0 -2
  94. data/lib/pry/last_exception.rb +2 -2
  95. data/lib/pry/method/disowned.rb +3 -1
  96. data/lib/pry/method/patcher.rb +2 -5
  97. data/lib/pry/method/weird_method_locator.rb +21 -11
  98. data/lib/pry/method.rb +44 -38
  99. data/lib/pry/object_path.rb +5 -4
  100. data/lib/pry/output.rb +37 -37
  101. data/lib/pry/pager.rb +195 -184
  102. data/lib/pry/platform.rb +91 -0
  103. data/lib/pry/plugins.rb +27 -8
  104. data/lib/pry/prompt.rb +144 -25
  105. data/lib/pry/pry_class.rb +83 -33
  106. data/lib/pry/pry_instance.rb +94 -59
  107. data/lib/pry/repl.rb +70 -11
  108. data/lib/pry/repl_file_loader.rb +2 -3
  109. data/lib/pry/ring.rb +84 -0
  110. data/lib/pry/rubygem.rb +9 -7
  111. data/lib/pry/slop/LICENSE +20 -0
  112. data/lib/pry/slop/commands.rb +195 -0
  113. data/lib/pry/slop/option.rb +206 -0
  114. data/lib/pry/slop.rb +661 -0
  115. data/lib/pry/terminal.rb +18 -6
  116. data/lib/pry/testable/evalable.rb +15 -0
  117. data/lib/pry/testable/mockable.rb +14 -0
  118. data/lib/pry/testable/pry_tester.rb +73 -0
  119. data/lib/pry/testable/utility.rb +26 -0
  120. data/lib/pry/testable/variables.rb +46 -0
  121. data/lib/pry/testable.rb +70 -0
  122. data/lib/pry/version.rb +1 -1
  123. data/lib/pry/{module_candidate.rb → wrapped_module/candidate.rb} +8 -14
  124. data/lib/pry/wrapped_module.rb +21 -21
  125. data/lib/pry.rb +21 -50
  126. metadata +29 -40
  127. data/lib/pry/commands/list_prompts.rb +0 -35
  128. data/lib/pry/commands/simple_prompt.rb +0 -22
  129. data/lib/pry/history_array.rb +0 -121
  130. data/lib/pry/rbx_path.rb +0 -22
  131. data/lib/pry/test/helper.rb +0 -170
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1b85ec70167eee63c4f58e11c27f2c1f94f49db
4
- data.tar.gz: 08a2b56e67aef2cdaf4fb6c4aa3ac0c1e8bf395f
3
+ metadata.gz: 6320662aa62bb2b7410cb900e5e0d75e075413da
4
+ data.tar.gz: d72635ecb0613ee87e6bf7fbc37c71573f1137ce
5
5
  SHA512:
6
- metadata.gz: f82d5ccba499a9dc6a11bc48496424f691248134bad714cdaf8704bc95ffd3368fa07471d3651f464fcf92cac0b0779860276fa973783f1b2bd34b338c14ce92
7
- data.tar.gz: 088a2f47add7c3e16ca078f4e84ebac15b05051d945b3f5c25a295292ec6478bf5bbe0c6752a143f16d323116fbf1e19ebd72b5fbbfa716830a9181a768fe20a
6
+ metadata.gz: 396ab2db71196633ab518104409ae367d67c9c9e64a318bdecbef0e40010364cc207211f808f2e616d9909ec93b256b5bc0f58a458f7ac97d195eee8ee6d7e71
7
+ data.tar.gz: f74d3c223f09b7d06af0a30500176a6caa10474646ce59fb787d6a5936ab420828a399679d55f7fa0a106ab2f5f45d622748cb13804af85032621151c1147a94
data/CHANGELOG.md CHANGED
@@ -1,11 +1,243 @@
1
- ### 0.10.3
1
+ ### HEAD
2
2
 
3
- * cherry-pick 0d1d72b and e0e5c75 to fix the install of Pry on Windows.
3
+ ### [v0.12.2][v0.12.2] (November 12, 2018)
4
4
 
5
- ### 0.10.2
5
+ #### Bug fixes
6
6
 
7
- * cherry-pick c2ed9ec135bd791a32c70fbe05cc0508ea17c4040e from master (fix inf. loop with prepended methods source retrieval)
8
- * Update some specs for recent ruby versions (2.2+)
7
+ * Restore removed deprecations, which were removed by accident due to a bad
8
+ rebase.
9
+
10
+ ### [v0.12.1][v0.12.1] (November 12, 2018)
11
+
12
+ #### Bug fixes
13
+
14
+ * Stopped creating a new hash each time `Pry::Prompt#[]` is invoked
15
+ ([#1855](https://github.com/pry/pry/pull/1855))
16
+ * Fixed `less` pager not working when it's available
17
+ ([#1861](https://github.com/pry/pry/pull/1861))
18
+
19
+ ### [v0.12.0][v0.12.0] (November 5, 2018)
20
+
21
+ #### Major changes
22
+
23
+ * Dropped support for Rubinius ([#1785](https://github.com/pry/pry/pull/1785))
24
+
25
+ #### Features
26
+
27
+ * Added a new command, `clear-screen`, that clears the content of the screen Pry
28
+ is running in regardless of platform (Windows or UNIX-like)
29
+ ([#1723](https://github.com/pry/pry/pull/1723))
30
+ * Added a new command, `gem-stat`, that prints gem statistics such as gem
31
+ dependencies and downloads ([#1707](https://github.com/pry/pry/pull/1707))
32
+ * Added support for nested exceptions for the `wtf` command
33
+ ([#1791](https://github.com/pry/pry/pull/1791))
34
+ * Added support for dynamic prompt names
35
+ ([#1833](https://github.com/pry/pry/pull/1833))
36
+
37
+ ```rb
38
+ # pryrc
39
+ Pry.config.prompt_name = Pry.lazy { rand(100) }
40
+
41
+ # Session
42
+ [1] 80(main)>
43
+ [2] 87(main)>
44
+ [3] 30(main)>
45
+ ```
46
+ * Added support for XDG Base Directory Specification
47
+ ([#1609](https://github.com/pry/pry/pull/1609),
48
+ [#1844](https://github.com/pry/pry/pull/1844),
49
+ ([#1848](https://github.com/pry/pry/pull/1848)))
50
+ * Removed the `simple-prompt`. Use `change-prompt simple` instead. The
51
+ `list-prompt` command was removed and embedded as `change-prompt --list`
52
+ ([#1849](https://github.com/pry/pry/pull/1849))
53
+
54
+ #### API changes
55
+
56
+ * The following methods started accepting the new optional `config` parameter
57
+ ([#1809](https://github.com/pry/pry/pull/1809)):
58
+ * `Pry::Helpers.tablify(things, line_length, config = Pry.config)`
59
+ * `Pry::Helpers.tablify_or_one_line(heading, things, config = Pry.config)`
60
+ * `Pry::Helpers.tablify_to_screen_width(things, options, config = Pry.config)`
61
+ * `Pry::Helpers::Table.new(items, args, config = Pry.config)`
62
+
63
+ You are expected to pass a session-local `_pry_.config` instead of the global
64
+ one.
65
+
66
+ * Added new method `Pry::Config.assign`, for creating a Config non-recursively
67
+ ([#1725](https://github.com/pry/pry/issues/1725))
68
+ * Added `Pry.lazy`, which is a helper method for values that need to be
69
+ calculated dynamically. Currently, only `config.prompt_name` supports it
70
+ ([#1833](https://github.com/pry/pry/pull/1833))
71
+ * `Pry::Prompt` responds to `.[]`, `.all` & `.add` now. The `Pry::Prompt.add`
72
+ method must be used for implementing custom prompts. See the API in the
73
+ documentation for the class ([#1846](https://github.com/pry/pry/pull/1846))
74
+
75
+ #### Breaking changes
76
+
77
+ * Deleted the `Pry::Helpers::Text.bright_default` alias for
78
+ `Pry::Helpers::Text.bold` ([#1795](https://github.com/pry/pry/pull/1795))
79
+ * `Pry::Helpers.tablify_to_screen_width(things, options, config = Pry.config)`
80
+ requires `options` or `nil` in place of them.
81
+ * `Pry::Helpers::Table.new(items, args, config = Pry.config)` requires `args`
82
+ or `nil` in place of them.
83
+ * Completely revamped `Pry::HistoryArray`
84
+ ([#1818](https://github.com/pry/pry/pull/1818)).
85
+ * It's been renamed to `Pry::Ring`
86
+ ([#1817](https://github.com/pry/pry/pull/1817))
87
+ * The implementation has changed and as result, the following methods were
88
+ removed:
89
+ * `Pry::Ring#length` (use `Pry::Ring#count` instead)
90
+ * `#empty?`, `#each`, `#inspect`, `#pop!`, `#to_h`
91
+ * To access old Enumerable methods convert the ring to Array with `#to_a`
92
+ * Fixed indexing for elements (e.g. `_pry_.input_ring[0]` always return some
93
+ element and not `nil`)
94
+ * Renamed `Pry.config.prompt_safe_objects` to `Pry.config.prompt_safe_contexts`
95
+ * Removed deprecated `Pry::CommandSet#before_command` &
96
+ `Pry::CommandSet#after_command` ([#1838](https://github.com/pry/pry/pull/1838))
97
+
98
+ #### Deprecations
99
+
100
+ * Deprecated `_pry_.input_array` & `_pry_.output_array` in favour of
101
+ `_pry_.input_ring` & `_pry_.output_ring` respectively
102
+ ([#1814](https://github.com/pry/pry/pull/1814))
103
+ * Deprecated `Pry::Command#text`. Please use `#black`, `#white`, etc. directly
104
+ instead (as you would with helper functions from `BaseHelpers` and
105
+ `CommandHelpers`) ([#1701](https://github.com/pry/pry/pull/1701))
106
+ * Deprecated `_pry_.input_array` & `_pry_.output_array` in favour of
107
+ `_pry_.input_ring` and `_pry_.output_ring` respectively
108
+ ([#1817](https://github.com/pry/pry/pull/1817))
109
+ * Deprecated `Pry::Platform`. Use `Pry::Helpers::Platform` instead. Note that
110
+ `Pry::Helpers::BaseHelpers` still includes the `Platform` methods but emits a
111
+ warning. You must switch to `Pry::Helpers::Platform` in your code
112
+ ([#1838](https://github.com/pry/pry/pull/1838),
113
+ ([#1845](https://github.com/pry/pry/pull/1845)))
114
+ * Deprecated `Pry::Prompt::MAP`. You should use `Pry::Prompt.all` instead to
115
+ access the same map ([#1846](https://github.com/pry/pry/pull/1846))
116
+
117
+ #### Bug fixes
118
+
119
+ * Fixed a bug where `cd Hash.new` reported `self` as an instance of Pry::Config
120
+ in the prompt ([#1725](https://github.com/pry/pry/pull/1725))
121
+ * Silenced the `Could not find files for the given pattern(s)` error message
122
+ coming from `where` on Windows, when `less` or another pager is not installed
123
+ ([#1767](https://github.com/pry/pry/pull/1767))
124
+ * Fixed possible double loading of Pry plugins' `cli.rb` on Ruby (>= 2.4) due to
125
+ [the `realpath` changes while invoking
126
+ `require`](https://bugs.ruby-lang.org/issues/10222)
127
+ ([#1762](https://github.com/pry/pry/pull/1762),
128
+ [#1774](https://github.com/pry/pry/pull/1762))
129
+ * Fixed `NoMethodError` on code objects that have a comment but no source when
130
+ invoking `show-source` ([#1779](https://github.com/pry/pry/pull/1779))
131
+ * Fixed `negative argument (ArgumentError)` upon pasting code with tabs, which
132
+ used to confuse automatic indentation
133
+ ([#1771](https://github.com/pry/pry/pull/1771))
134
+ * Fixed Pry not being able to load history on Ruby 2.4.4+ when it contains the
135
+ null character ([#1789](https://github.com/pry/pry/pull/1789))
136
+ * Fixed Pry raising errors on `cd`'ing into some objects that redefine
137
+ `method_missing` and `respond_to?`
138
+ ([#1811](https://github.com/pry/pry/pull/1811))
139
+ * Fixed bug when indentation leaves parts of input after pressing enter when
140
+ Readline is enabled with mode indicators for vi mode
141
+ ([#1813](https://github.com/pry/pry/pull/1813),
142
+ [#1820](https://github.com/pry/pry/pull/1820),
143
+ [#1825](https://github.com/pry/pry/pull/1825))
144
+ * Fixed `edit` not writing to history
145
+ ([#1749](https://github.com/pry/pry/issues/1749))
146
+
147
+ #### Other changes
148
+
149
+ * Deprecated the `Data` constant to match Ruby 2.5 in the `ls` command
150
+ ([#1731](https://github.com/pry/pry/pull/1731))
151
+
152
+ ### 0.11.3
153
+
154
+ #### Features
155
+
156
+ * Add Pry::Testable, an improved modular replacement for PryTestHelpers.
157
+ **breaking change**.
158
+
159
+ See pull request [#1679](https://github.com/pry/pry/pull/1679).
160
+
161
+ * Add a new category module: "Pry::Platform". Loosely related to #1668 below.
162
+
163
+ See pull request [#1670](https://github.com/pry/pry/pull/1670)
164
+
165
+ * Add `mac_osx?` and `linux?` utility functions to Pry::Helpers::BaseHelpers.
166
+
167
+ See pull request [#1668](https://github.com/pry/pry/pull/1668).
168
+
169
+ * Add utility functions for drawing colorised text on a colorised background.
170
+
171
+ See pull request [#1673](https://github.com/pry/pry/pull/1673).
172
+
173
+ #### Bug fixes
174
+
175
+ * Fix a case of infinite recursion in `Pry::Method::WeirdMethodLocator#find_method_in_superclass`
176
+ that users of the [Hanami](http://hanamirb.org/) web framework experienced and
177
+ reported since 2015.
178
+
179
+ See pull request [#1689](https://github.com/pry/pry/pull/1689).
180
+
181
+ * Fix a bug where Method objects were not returned for setters inherited
182
+ from a default (Pry::Config::Default). Eg, this is no longer an error:
183
+
184
+ pry(main)> d = Pry::Config.from_hash({}, Pry::Config::Default.new)
185
+ pry(main)> d.method(:exception_whitelist=) # Error
186
+
187
+ See pull request [#1688](https://github.com/pry/pry/pull/1688).
188
+
189
+ * Do not capture unused Proc objects in Text helper methods `no_color` and `no_paging`,
190
+ for performance reasons. Improve the documentation of both methods.
191
+
192
+ See pull request [#1691](https://github.com/pry/pry/pull/1691).
193
+
194
+ * Fix `String#pp` output color.
195
+
196
+ See pull request [#1674](https://github.com/pry/pry/pull/1674).
197
+
198
+
199
+ ### 0.11.0
200
+
201
+ * Add alias 'whereami[?!]+' for 'whereami' command. ([#1597](https://github.com/pry/pry/pull/1597))
202
+ * Improve Ruby 2.4 support ([#1611](https://github.com/pry/pry/pull/1611)):
203
+ * Deprecated constants are hidden from `ls` output by default, use the `-d` switch to see them.
204
+ * Fix warnings that originate in Pry while using the repl.
205
+ * Improve completion speed in large applications. ([#1588](https://github.com/pry/pry/pull/1588))
206
+ * Pry::ColorPrinter.pp: add `newline` argument and pass it on to PP. ([#1603](https://github.com/pry/pry/pull/1603))
207
+ * Use `less` or system pager pager on MS Windows if it is available. ([#1512](https://github.com/pry/pry/pull/1512))
208
+ * Add `Pry.configure` as an alternative to the current way of changing configuration options in `.pryrc` files. ([#1502](https://github.com/pry/pry/pull/1502))
209
+ * Add `Pry::Config::Behavior#eager_load!` to add a possible workaround for issues like ([#1501](https://github.com/pry/pry/issues/1501))
210
+ * Remove Slop as a runtime dependency by vendoring v3.4 as Pry::Slop.
211
+ People can depend on Slop v4 and Pry at the same time without running into version conflicts. ([#1497](https://github.com/pry/pry/issues/1497))
212
+ * Fix auto-indentation of code that uses a single-line rescue ([#1450](https://github.com/pry/pry/issues/1450))
213
+ * Remove "Pry::Config#refresh", please use "Pry::Config#clear" instead.
214
+ * Defining a method called "ls" no longer breaks the "ls" command ([#1407](https://github.com/pry/pry/issues/1407))
215
+ * Don't raise when directory permissions don't allow file expansion ([#1432](https://github.com/pry/pry/issues/1432))
216
+ * Syntax highlight <tt> tags in documentation output.
217
+ * Add support for BasicObject subclasses who implement their own #inspect (#1341)
218
+ * Fix 'include RSpec::Matchers' at the top-level (#1277)
219
+ * Add 'gem-readme' command, prints the README file bundled with a rubygem
220
+ * Add 'gem-search' command, searches for a gem with the rubygems.org HTTP API
221
+ * Fixed bug in the `cat` command where it was impossible to use line numbers with files ([#1349](https://github.com/pry/pry/issues/1349))
222
+ * Fixed uncaught Errno::EOPNOTSUPP exception when $stdout is a socket ([#1352](https://github.com/pry/pry/issues/1352))
223
+ * Display a warning when you cd'ed inside a C object and executed 'show-source' without arguments ([#691](https://github.com/pry/pry/issues/691))
224
+ * Make the stagger_output method more reliable by reusing possibly available Pry instance ([#1364](https://github.com/pry/pry/pull/1364))
225
+ * Make the 'gem-install' message less confusing by removing backticks ([#1350](https://github.com/pry/pry/pull/1350))
226
+ * Fixed error when Pry was trying to load incompatible versions of plugins ([#1312](https://github.com/pry/pry/issues/1312))
227
+ * Fixed bug when `hist --clear` led to ArgumentError ([#1340](https://github.com/pry/pry/pull/1340))
228
+ * Fixed the "uninitialized constant Pry::ObjectPath::StringScanner" exception during autocomplete ([#1330](https://github.com/pry/pry/issues/1330))
229
+ * Secured usage of colours with special characters (RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE) in Pry::Helpers::Text ([#493](https://github.com/pry/pry/issues/493#issuecomment-39232771))
230
+ * Fixed regression with `pry -e` when it messes the terminal ([#1387](https://github.com/pry/pry/issues/1387))
231
+ * Fixed regression with space prefixes of expressions ([#1369](https://github.com/pry/pry/issues/1369))
232
+ * Introduced the new way to define hooks for commands (with `Pry.hooks.add_hook("{before,after}_commandName")`). The old way is deprecated, but still supported (with `Pry.commands.{before,after}_command`) ([#651](https://github.com/pry/pry/issues/651))
233
+ * Removed old API's using `Pry::Hooks.from_hash` altogether
234
+ * Removed hints on Foreman support (see [this](https://github.com/ddollar/foreman/pull/536))
235
+ * Fixed support for the tee command ([#1334](https://github.com/pry/pry/issues/1334))
236
+ * Implemented support for CDPATH for ShellCommand ([#1433](https://github.com/pry/pry/issues/1433), [#1434](https://github.com/pry/pry/issues/1434))
237
+ * `Pry::CLI.parse_options` does not start Pry anymore ([#1393](https://github.com/pry/pry/pull/1393))
238
+ * The gem uses CPU-less platforms for Windows now ([#1410](https://github.com/pry/pry/pull/1410))
239
+ * Add `Pry::Config::Memoization` to make it easier to implement your own `Pry::Config::Default` class.([#1503](https://github.com/pry/pry/pull/1503/))
240
+ * Lazy load the config defaults for `Pry.config.history` and `Pry.config.gist`.
9
241
 
10
242
  ### 0.10.1
11
243
 
@@ -13,7 +245,6 @@
13
245
  * Move to rspec for testing (from bacon)
14
246
  * Clean up ruby warnings
15
247
 
16
-
17
248
  ### 0.10.0
18
249
 
19
250
  #### Features
@@ -376,7 +607,7 @@
376
607
  * Fewer internal methods polluting output
377
608
 
378
609
  ### 0.9.8.4 (2012/6/3)
379
- * ~/.pry_history wasnt being created (if it did not exist)! FIXED
610
+ * ~/.pry_history wasn't being created (if it did not exist)! FIXED
380
611
  * `hist --save` saved colors! FIXED
381
612
  * added Pry#add_sticky_local API for adding sticky locals to individual pry instances
382
613
 
@@ -384,7 +615,7 @@
384
615
  * various tweaks to improve rbx support
385
616
  * commands now support optional block arguments
386
617
  * much improved help command
387
- * updated method_source dependencya
618
+ * updated method_source dependency
388
619
  * added wtf command
389
620
  * jruby should now work in windows (though without color)
390
621
 
@@ -412,7 +643,7 @@ MAJOR NEW FEATURES
412
643
  - added gist command (removed gist-method, new gist command is more general)
413
644
 
414
645
  complete CHANGELOG:
415
- * CommandError's no longer cause the current input to be disgarded
646
+ * CommandError's no longer cause the current input to be discarded
416
647
  * Better syntax highlighting for rbx code code
417
648
  * added cat --in to show pry input history
418
649
  * prefixed temporary file names with 'pry'
@@ -425,7 +656,7 @@ complete CHANGELOG:
425
656
  * added CommandSet#{before_command,after_command} for enhancing builtin commands
426
657
  * added checking for namespace collisions with pry commands, set Pry.config.collision_warning
427
658
  * work around namespace collisions by ensuring lines starting with a space are executed as
428
- * ruby.work around namespace collisions by prensuring lines starting with a space are executed as ruby
659
+ * ruby.work around namespace collisions by pressuring lines starting with a space are executed as ruby
429
660
  * added handlers for Ctrl+C (SIGINT) on jruby, these are now caught as in other ruby versions
430
661
  * removed dependency on ruby_parser
431
662
  * prevented colours leaking across the pry prompt
@@ -445,7 +676,7 @@ complete CHANGELOG:
445
676
 
446
677
  ### 0.9.7.4 (2011/11/5)
447
678
  * ls -M now works in modules (bugfix)
448
- * added exception msg for bad cd object/path
679
+ * added exception message for bad cd object/path
449
680
  * no longer die when encounter exceptions in .pryrc
450
681
  * baked in CoolLine support
451
682
  * Pry.config.input in .pryrc now respected
@@ -462,7 +693,7 @@ complete CHANGELOG:
462
693
  * changed ^D so it no longer resets indent level automatically
463
694
 
464
695
  ### 0.9.7.1 (2011/10/26)
465
- * fixed gem dependecy issues
696
+ * fixed gem dependency issues
466
697
 
467
698
  ### 0.9.7 (2011/10/25)
468
699
 
@@ -503,7 +734,7 @@ complete CHANGELOG:
503
734
  * play -m --open uses show-input to show play'd code
504
735
  * added "unindent" helper to make adding help to commands easier
505
736
  * local ./.pryrc now loaded after ~/.pryrc if it exists
506
- * cat --ex N and edit --ex N now can navigate through backtrace, where cat --ex (with no args) moves throuh successive levels of the backtrace automatically with state stored on the exceptino object itself
737
+ * cat --ex N and edit --ex N now can navigate through backtrace, where cat --ex (with no args) moves through successive levels of the backtrace automatically with state stored on the exception object itself
507
738
  * new option Pry.config.exception_window_size determines window size for cat --ex
508
739
  * input_stack now implemented - pushing objects onto a pry instance's input_stack causes the instance to read from those objects in turn as it encounters EOF on the previous object. On finishing the input_stack the input object for the pry instance is set back to Pry.config.input, if this fails, pry breaks out of the REPL (throw(:breakout)) with an error message
509
740
  * Pry.config.system() defines how pry runs system commands
@@ -536,10 +767,10 @@ complete CHANGELOG:
536
767
  * fixed bug #200 ( https://github.com/pry/pry/issues/200 )- string interpolation bug (thanks to ryanf)
537
768
  * show-doc and stat now display method visibility (update WIKI)
538
769
  * got rid of warnings caused by stricter ruby 1.9.3 rules
539
- * remove interpolation of command names and fix interpolation error messag (update WIKI) (thanks ryanf!)
770
+ * remove interpolation of command names and fix interpolation error message (update WIKI) (thanks ryanf!)
540
771
  * 'nested sessions' now use binding stacks (so each instance manages its own collection of bindings without spawning other instances)
541
772
  * 'cd ..' just pops a binding off the binding_stack with special behaviour when only one binding in stack - it breaks out of the repl loop
542
- * added switch-to command (like jump-to but doesnt unwind the stack)
773
+ * added switch-to command (like jump-to but doesn't unwind the stack)
543
774
  * show-method and show-doc now accept multiple method names
544
775
  * control_d hook added (Pry.config.control_d_handler)
545
776
  * behaviour of ^d is now to break out of current expr if in multi-line expr, or break out of current context if nested, or break out of pry repl loop if at top-level
@@ -633,7 +864,7 @@ complete CHANGELOG:
633
864
  * -I mode for pry commandline
634
865
  * --color mode for pry commandline
635
866
  * clean up requires (put them all in one place)
636
- * simple-prompt command and toggle-color commandd.
867
+ * simple-prompt command and toggle-color command.
637
868
 
638
869
  ### 0.6.3 (2011/2/28)
639
870
  * Using MethodSource 0.3.4 so 1.8 show-method support provided
@@ -716,3 +947,7 @@ complete CHANGELOG:
716
947
 
717
948
  ### 0.1.0 (2010/12/8)
718
949
  * release!
950
+
951
+ [v0.12.0]: https://github.com/pry/pry/releases/tag/v0.12.0
952
+ [v0.12.1]: https://github.com/pry/pry/releases/tag/v0.12.1
953
+ [v0.12.2]: https://github.com/pry/pry/releases/tag/v0.12.2
data/LICENSE CHANGED
@@ -3,7 +3,7 @@ License
3
3
 
4
4
  (The MIT License)
5
5
 
6
- Copyright (c) 2013 John Mair (banisterfiend)
6
+ Copyright (c) 2018 The Pry Team
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
data/README.md CHANGED
@@ -1,27 +1,16 @@
1
- [![Build Status](https://img.shields.io/travis/pry/pry.svg)](https://travis-ci.org/pry/pry)
2
- [![Code Climate](https://img.shields.io/codeclimate/github/pry/pry.svg)](https://codeclimate.com/github/pry/pry)
3
- [![Inline docs](http://inch-ci.org/github/pry/pry.svg)](http://inch-ci.org/github/pry/pry)
4
-
5
- <center>
6
- ![The Pry Logo](https://dl.dropbox.com/u/26521875/pry%20stuff/logo/pry_logo_350.png)
7
-
8
- © John Mair ([banisterfiend](https://twitter.com/banisterfiend)) 2013<br>
9
-
10
- **Please** [DONATE](http://www.pledgie.com/campaigns/15899) to the Pry project - Pry was a **huge** amount of work and every donation received is encouraging and supports Pry's continued development!
11
-
12
- **Sponsors**
13
-
14
- [Tealeaf Academy](http://www.gotealeaf.com)<br/>
15
- [Atomic Object](http://www.atomicobject.com/)<br/>
16
- [Hashrocket](http://hashrocket.com/)<br/>
17
- [Intridea](http://intridea.com/)<br/>
18
- [Gaslight](http://gaslight.co/home)<br/>
1
+ [![Circle Build Status](https://circleci.com/gh/pry/pry.svg?style=shield)](https://circleci.com/gh/pry/pry)
2
+ [![Code Climate](https://codeclimate.com/github/pry/pry.svg)](https://codeclimate.com/github/pry/pry)
3
+ [![Gem Version](https://badge.fury.io/rb/pry.svg)](http://badge.fury.io/rb/pry)
4
+ [![Documentation Status](http://inch-ci.org/github/pry/pry.svg?branch=master)](http://inch-ci.org/github/pry/pry)
5
+ [![Downloads](https://img.shields.io/gem/dt/pry.svg?style=flat)](https://rubygems.org/gems/pry)
6
+ <br><br>
7
+ ![logo for Pry](https://www.dropbox.com/s/zp8o63kquby2rln/pry_logo_350.png?raw=1)
19
8
 
20
9
  **Other Resources**
21
10
 
22
- [Skip to the website (recommended)](http://pry.github.com) <br />
11
+ [Skip to the website (recommended)](http://pryrepl.org/) <br />
23
12
  [Skip to the wiki](https://github.com/pry/pry/wiki)
24
- </center>
13
+
25
14
 
26
15
  Pry is a powerful alternative to the standard IRB shell for Ruby. It is
27
16
  written from scratch to provide a number of advanced features,
@@ -44,7 +33,7 @@ including:
44
33
 
45
34
  Pry also aims to be more than an IRB replacement; it is an
46
35
  attempt to bring REPL driven programming to the Ruby language. It is
47
- currently not as powerful as tools like [SLIME](http://en.wikipedia.org/wiki/SLIME) for lisp, but that is the
36
+ currently not as powerful as tools like [SLIME](https://en.wikipedia.org/wiki/SLIME) for lisp, but that is the
48
37
  general direction Pry is heading.
49
38
 
50
39
  Pry is also fairly flexible and allows significant user
@@ -53,10 +42,10 @@ is trivial to set it to read from any object that has a `readline` method and wr
53
42
  `puts` method - many other aspects of Pry are also configurable making
54
43
  it a good choice for implementing custom shells.
55
44
 
56
- Pry comes with an executable so it can be invoked at the command line.
57
- Just enter `pry` to start. A `.pryrc` file in the user's home directory will
58
- be loaded if it exists. Type `pry --help` at the command line for more
59
- information.
45
+ Pry comes with an executable so it can be invoked at the command line. Just
46
+ enter `pry` to start. A `pryrc` file in `$XDG_CONFIG_HOME/pry/` or the user's
47
+ home directory will be loaded if it exists. Type `pry --help` at the command
48
+ line for more information.
60
49
 
61
50
  Try `gem install pry-doc` for additional documentation on Ruby Core
62
51
  methods. The additional docs are accessed through the `show-doc` and
@@ -64,8 +53,8 @@ methods. The additional docs are accessed through the `show-doc` and
64
53
 
65
54
  * Install the [gem](https://rubygems.org/gems/pry): `gem install pry`
66
55
  * Browse the comprehensive [documentation at the official Pry wiki](https://github.com/pry/pry/wiki)
67
- * Read the [YARD API documentation](http://rdoc.info/github/pry/pry/master/file/README.markdown)
68
- * See the [source code](http://github.com/pry/pry)
56
+ * Read the [YARD API documentation](http://www.rubydoc.info/github/pry/pry/)
57
+ * See the [source code](https://github.com/pry/pry)
69
58
 
70
59
  ### Commands
71
60
 
@@ -137,20 +126,22 @@ implementing developer consoles and applying hot patches.
137
126
 
138
127
  code:
139
128
 
140
- # test.rb
141
- require 'pry'
129
+ ```ruby
130
+ # test.rb
131
+ require 'pry'
142
132
 
143
- class A
144
- def hello() puts "hello world!" end
145
- end
133
+ class A
134
+ def hello() puts "hello world!" end
135
+ end
146
136
 
147
- a = A.new
137
+ a = A.new
148
138
 
149
- # start a REPL session
150
- binding.pry
139
+ # start a REPL session
140
+ binding.pry
151
141
 
152
- # program resumes here (after pry session)
153
- puts "program resumes here."
142
+ # program resumes here (after pry session)
143
+ puts "program resumes here."
144
+ ```
154
145
 
155
146
  Pry session:
156
147
 
@@ -179,9 +170,8 @@ present working directory into the Pry prompt and bring in (limited at this stag
179
170
  We can also interpolate Ruby code directly into the shell by
180
171
  using the normal `#{}` string interpolation syntax.
181
172
 
182
- In the code below we're going to switch to `shell-mode` and edit the
183
- `.pryrc` file in the home directory. We'll then cat its contents and
184
- reload the file.
173
+ In the code below we're going to switch to `shell-mode` and edit the `pryrc`
174
+ file. We'll then cat its contents and reload the file.
185
175
 
186
176
  pry(main)> shell-mode
187
177
  pry main:/home/john/ruby/projects/pry $ .cd ~
@@ -314,10 +304,10 @@ We can also use `ri` in the normal way:
314
304
 
315
305
  ### Gist integration
316
306
 
317
- If the `gist` gem is installed then method source or documentation can be gisted to github with the
307
+ If the `gist` gem is installed then method source or documentation can be gisted to GitHub with the
318
308
  `gist` command. The `gist` command is capable of gisting [almost any REPL content](https://gist.github.com/cae143e4533416529726), including methods, documentation,
319
309
  input expressions, command source, and so on. In the example below we will gist the C source
320
- code for the `Symbol#to_proc` method to github:
310
+ code for the `Symbol#to_proc` method to GitHub:
321
311
 
322
312
  pry(main)> gist -m Symbol#to_proc
323
313
  Gist created at https://gist.github.com/5332c38afc46d902ce46 and added to clipboard.
@@ -351,7 +341,7 @@ Many other commands are available in Pry; to see the full list type
351
341
  with basic instructions for use; some commands have a more extensive
352
342
  help that can be accessed via typing `command_name --help`. A command
353
343
  will typically say in its description if the `--help` option is
354
- avaiable.
344
+ available.
355
345
 
356
346
  ### Use Pry as your Rails Console
357
347
 
@@ -382,7 +372,7 @@ gem.
382
372
 
383
373
  You can toggle the syntax highlighting on and off in a session by
384
374
  using the `toggle-color` command. Alternatively, you can turn it off
385
- permanently by putting the line `Pry.color = false` in your `~/.pryrc`
375
+ permanently by putting the line `Pry.color = false` in your `pryrc`
386
376
  file.
387
377
 
388
378
  ### Future Directions
@@ -397,10 +387,4 @@ between commands and running commands in background
397
387
 
398
388
  ### Contact
399
389
 
400
- Problems or questions? file an issue at [github](https://github.com/pry/pry/issues)
401
-
402
- ### Contributors
403
-
404
- Pry is primarily the work of [John Mair (banisterfiend)](http://github.com/banister), for full list
405
- of contributors see the
406
- [CONTRIBUTORS](https://github.com/pry/pry/blob/master/CONTRIBUTORS) file.
390
+ Problems or questions? File an issue at [GitHub](https://github.com/pry/pry/issues).
data/bin/pry CHANGED
@@ -1,16 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- # (C) John Mair (banisterfiend)
4
- # MIT license
5
-
6
2
  $0 = 'pry'
7
3
 
8
- begin
9
- require 'pry'
10
- rescue LoadError
11
- require 'rubygems'
12
- require 'pry'
13
- end
4
+ require 'pry'
14
5
 
15
6
  # Process command line options and run Pry
16
- Pry::CLI.parse_options
7
+ opts = Pry::CLI.parse_options
8
+ Pry::CLI.start(opts)
@@ -0,0 +1,6 @@
1
+ class Pry::BasicObject < BasicObject
2
+ [:Kernel, :Pry].each do |constant|
3
+ const_set constant, ::Object.const_get(constant)
4
+ end
5
+ include Kernel
6
+ end