pry 0.15.2-java → 0.16.0-java

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1df121eee8ebfd716007e0c689baf5d42dc768e604f258f5f06050a6b5e1d93d
4
- data.tar.gz: 447e326878c36eb79eea61bb9ed2f1d36fddb801e5d408fd283c4b7a50d26f76
3
+ metadata.gz: e218c4a8c488da052e3d082b1f00b745b35c3119fd007a214324d06a49047acb
4
+ data.tar.gz: f3977bcef3004c4643ea02320dc4f3ca1d2958ea813665559bc2f0db01325efd
5
5
  SHA512:
6
- metadata.gz: 80ace28ad36ab92c028820b3136df285d34759d25bf6b3f3a2021e6508042479e123ebc31a26e44986ee64981999fe468e2b612fae52d996fde3f39b3de674b4
7
- data.tar.gz: 7df26040bd5054a7f29e595219d409b82acf311f7d1a0aae87dc7e4a6b73702c9661a9046c18f73c5fdb055962972c6ad8391f00585c58bd96fba59ecea965c1
6
+ metadata.gz: f84451bee3be8a20beff56c43776fe87c3f1929e24794533627ac63e80445924b2af63723cbcab8febfecc66792a8446b214f75a11d60a33f14b3a263b1f9fe4
7
+ data.tar.gz: 52146474624b386e394aaf5a21e371c5e52744a2aeff67468603a25b81bfb4bd83be027b7b2bf9aa9b987b22aa3a0efb3debc86d892536c00ad6a33465a33d85
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ### [v0.16.0](v0.16.0) (December 26, 2025)
2
+
3
+ #### Features
4
+
5
+ * Ruby 4.0 Support.
6
+ Pry will now require and default to Reline for newer Rubies.
7
+ ([#2357](https://github.com/pry/pry/pull/2357))
8
+ ([#2349](https://github.com/pry/pry/pull/2349))
9
+ * Revert 'Unify show-doc with show-source'.
10
+ ([#2346](https://github.com/pry/pry/pull/2346))
11
+
12
+ #### Breaking Changes
13
+
14
+ * Remove experimental `Pry.auto_resize!`
15
+ Returns a warning. The code will be removed later.
16
+ ([#2359](https://github.com/pry/pry/pull/2359))
17
+ * Drop support for Ruby < 2.6
18
+ ([#2349](https://github.com/pry/pry/pull/2349))
19
+
1
20
  ### [v0.15.2](v0.15.2) (December 24, 2024)
2
21
 
3
22
  #### Bug Fixes
data/LICENSE CHANGED
@@ -3,7 +3,7 @@ License
3
3
 
4
4
  (The MIT License)
5
5
 
6
- Copyright (c) 2018 John Mair (banisterfiend)
6
+ Copyright (c) 2010 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
data/README.md CHANGED
@@ -9,9 +9,9 @@ Pry
9
9
 
10
10
  ![Pry logo](https://www.dropbox.com/s/zp8o63kquby2rln/pry_logo_350.png?raw=1)
11
11
 
12
- © John Mair ([banisterfiend](https://twitter.com/banisterfiend)) 2018<br> (Creator)
12
+ © John Mair ([banisterfiend](https://twitter.com/banisterfiend)) 2010<br> (Creator)
13
13
 
14
- © Kyrylo Silin ([kyrylosilin](https://twitter.com/kyrylosilin)) 2018<br> (Maintainer)
14
+ © Kyrylo Silin ([kyrylosilin](https://twitter.com/kyrylosilin)) 2010<br> (Maintainer)
15
15
 
16
16
  **Alumni:**
17
17
 
data/lib/pry/cli.rb CHANGED
@@ -123,7 +123,7 @@ Pry::CLI.add_options do
123
123
  "Usage: pry [OPTIONS]\n" \
124
124
  "Start a Pry session.\n" \
125
125
  "See http://pry.github.io/ for more information.\n" \
126
- "Copyright (c) 2016 John Mair (banisterfiend)" \
126
+ "Copyright (c) 2010 John Mair (banisterfiend)" \
127
127
  )
128
128
 
129
129
  on(
@@ -21,16 +21,6 @@ class Pry
21
21
  show-doc Pry -a # for all definitions of Pry class (all monkey patches)
22
22
  BANNER
23
23
 
24
- def process
25
- super
26
-
27
- output.puts(
28
- "\nWARNING: the show-doc command is deprecated. It will be removed " \
29
- "from future Pry versions.\nPlease use 'show-source' with the -d " \
30
- "(or --doc) switch instead\nExample: show-source #{obj_name} -d"
31
- )
32
- end
33
-
34
24
  # The docs for code_object prepared for display.
35
25
  def content_for(code_object)
36
26
  Code.new(
@@ -89,5 +79,6 @@ class Pry
89
79
  end
90
80
 
91
81
  Pry::Commands.add_command(Pry::Command::ShowDoc)
82
+ Pry::Commands.alias_command '?', 'show-doc'
92
83
  end
93
84
  end
@@ -3,8 +3,6 @@
3
3
  class Pry
4
4
  class Command
5
5
  class ShowSource < Command::ShowInfo
6
- include Pry::Helpers::DocumentationHelpers
7
-
8
6
  match 'show-source'
9
7
  group 'Introspection'
10
8
  description 'Show the source for a method or class.'
@@ -23,7 +21,6 @@ class Pry
23
21
  show-source Pry -a # for all Pry class definitions (all monkey patches)
24
22
  show-source Pry.foo -e # for class of the return value of expression `Pry.foo`
25
23
  show-source Pry --super # for superclass of Pry (Object class)
26
- show-source Pry -d # include documentation
27
24
 
28
25
  https://github.com/pry/pry/wiki/Source-browsing#wiki-Show_method
29
26
  BANNER
@@ -31,7 +28,6 @@ class Pry
31
28
  def options(opt)
32
29
  opt.on :e, :eval, "evaluate the command's argument as a ruby " \
33
30
  "expression and show the class its return value"
34
- opt.on :d, :doc, 'include documentation in the output'
35
31
  super(opt)
36
32
  end
37
33
 
@@ -46,73 +42,16 @@ class Pry
46
42
 
47
43
  # The source for code_object prepared for display.
48
44
  def content_for(code_object)
49
- content = ''
50
- if opts.present?(:d)
51
- code = Code.new(
52
- render_doc_markup_for(code_object), start_line_for(code_object), :text
53
- )
54
- content += code.with_line_numbers(use_line_numbers?).to_s
55
- content += "\n"
56
- end
57
-
58
45
  code = Code.new(
59
- code_object.source || [], start_line_for(code_object)
46
+ code_object.source || [],
47
+ start_line_for(code_object)
60
48
  )
61
- content += code.with_line_numbers(use_line_numbers?).highlighted
62
- content
63
- end
64
-
65
- # process the markup (if necessary) and apply colors
66
- def render_doc_markup_for(code_object)
67
- docs = docs_for(code_object)
68
-
69
- if code_object.command?
70
- # command '--help' shouldn't use markup highlighting
71
- docs
72
- else
73
- if docs.empty?
74
- raise CommandError, "No docs found for: #{obj_name || 'current context'}"
75
- end
76
-
77
- process_comment_markup(docs)
78
- end
79
- end
80
-
81
- # Return docs for the code_object, adjusting for whether the code_object
82
- # has yard docs available, in which case it returns those.
83
- # (note we only have to check yard docs for modules since they can
84
- # have multiple docs, but methods can only be doc'd once so we
85
- # dont need to check them)
86
- def docs_for(code_object)
87
- if code_object.module_with_yard_docs?
88
- # yard docs
89
- code_object.yard_doc
90
- else
91
- # normal docs (i.e comments above method/module/command)
92
- code_object.doc
93
- end
94
- end
95
-
96
- # Which sections to include in the 'header', can toggle: :owner,
97
- # :signature and visibility.
98
- def header_options
99
- super.merge signature: true
100
- end
101
-
102
- # figure out start line of docs by back-calculating based on
103
- # number of lines in the comment and the start line of the code_object
104
- # @return [Fixnum] start line of docs
105
- def start_line_for(code_object)
106
- return 1 if code_object.command? || opts.present?(:'base-one')
107
- return 1 unless code_object.source_line
108
-
109
- code_object.source_line - code_object.doc.lines.count
49
+ code.with_line_numbers(use_line_numbers?).highlighted
110
50
  end
111
51
  end
112
52
 
113
53
  Pry::Commands.add_command(Pry::Command::ShowSource)
114
54
  Pry::Commands.alias_command 'show-method', 'show-source'
115
55
  Pry::Commands.alias_command '$', 'show-source'
116
- Pry::Commands.alias_command '?', 'show-source -d'
117
56
  end
118
57
  end
data/lib/pry/config.rb CHANGED
@@ -290,14 +290,21 @@ class Pry
290
290
  require 'readline'
291
291
  ::Readline
292
292
  rescue LoadError
293
- output.puts(
294
- "Sorry, you can't use Pry without Readline or a compatible library. \n" \
295
- "Possible solutions: \n" \
296
- " * Rebuild Ruby with Readline support using `--with-readline` \n" \
297
- " * Use the rb-readline gem, which is a pure-Ruby port of Readline \n" \
298
- " * Use the pry-coolline gem, a pure-ruby alternative to Readline"
299
- )
300
- raise
293
+ begin
294
+ require 'reline'
295
+ ::Reline
296
+ rescue LoadError
297
+ output.puts(
298
+ "Sorry, you can't use Pry without Readline or a compatible library. \n" \
299
+ "Possible solutions: \n" \
300
+ " * Rebuild Ruby with Readline support using `--with-readline` \n" \
301
+ " * Use the reline gem \n" \
302
+ " * Use the readline-ext gem \n " \
303
+ " * Use the rb-readline gem, which is a pure-Ruby port of Readline \n" \
304
+ " * Use the pry-coolline gem, a pure-ruby alternative to Readline"
305
+ )
306
+ raise
307
+ end
301
308
  end
302
309
 
303
310
  def default_rc_file
@@ -60,7 +60,7 @@ class Pry
60
60
  # @return [Pry::Method, nil] The Pry::Method that matches the
61
61
  # given binding.
62
62
  def find_method
63
- find_method_in_superclass || find_renamed_method
63
+ find_renamed_method || find_method_in_superclass
64
64
  end
65
65
 
66
66
  # @return [Boolean] Whether the Pry::Method is unrecoverable
@@ -97,7 +97,7 @@ class Pry
97
97
 
98
98
  def target_line
99
99
  if target.respond_to?(:source_location)
100
- target.source_location.last
100
+ target.source_location[1]
101
101
  else
102
102
  target.eval('__LINE__')
103
103
  end
@@ -170,7 +170,7 @@ class Pry
170
170
  if pry_file?
171
171
  source_location
172
172
  else
173
- [File.expand_path(source_location.first), source_location.last]
173
+ [File.expand_path(source_location.first), source_location[1]]
174
174
  end
175
175
  end
176
176
 
data/lib/pry/method.rb CHANGED
@@ -359,7 +359,7 @@ class Pry
359
359
  # @return [Fixnum, nil] The line of code in `source_file` which begins
360
360
  # the method's definition, or `nil` if that information is unavailable.
361
361
  def source_line
362
- source_location.nil? ? nil : source_location.last
362
+ source_location.nil? ? nil : source_location[1]
363
363
  end
364
364
 
365
365
  # @return [Range, nil] The range of lines in `source_file` which contain
data/lib/pry/pry_class.rb CHANGED
@@ -294,34 +294,7 @@ you can add "Pry.config.windows_console_warning = false" to your pryrc.
294
294
  end
295
295
 
296
296
  def self.auto_resize!
297
- Pry.config.input # by default, load Readline
298
-
299
- if !defined?(Readline) || Pry.config.input != Readline
300
- warn "Sorry, you must be using Readline for Pry.auto_resize! to work."
301
- return
302
- end
303
-
304
- if Readline::VERSION =~ /edit/i
305
- warn(<<-WARN)
306
- Readline version #{Readline::VERSION} detected - will not auto_resize! correctly.
307
- For the fix, use GNU Readline instead:
308
- https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X
309
- WARN
310
- return
311
- end
312
-
313
- trap :WINCH do
314
- begin
315
- Readline.set_screen_size(*output.size)
316
- rescue StandardError => e
317
- warn "\nPry.auto_resize!'s Readline.set_screen_size failed: #{e}"
318
- end
319
- begin
320
- Readline.refresh_line
321
- rescue StandardError => e
322
- warn "\nPry.auto_resize!'s Readline.refresh_line failed: #{e}"
323
- end
324
- end
297
+ warn "Pry.auto_resize! was experimental and has been removed."
325
298
  end
326
299
 
327
300
  # Set all the configurable options back to their default values
data/lib/pry/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Pry
4
- VERSION = '0.15.2'.freeze
4
+ VERSION = '0.16.0'.freeze
5
5
  end
@@ -130,7 +130,13 @@ class Pry
130
130
  #
131
131
  # @return [Integer] number of lines.
132
132
  def number_of_lines_in_first_chunk
133
- end_method_line = last_method_source_location.last
133
+ # Ruby 4.0+ provides more details, including end of method:
134
+ # https://bugs.ruby-lang.org/issues/6012
135
+ end_method_line = if last_method_source_location.size == 5
136
+ last_method_source_location[-2]
137
+ else
138
+ last_method_source_location.last
139
+ end
134
140
 
135
141
  end_method_line - line
136
142
  end
data/lib/pry.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (C) John Mair (banisterfiend) 2016
3
+ # (C) John Mair (banisterfiend) 2010
4
4
  # MIT License
5
5
 
6
6
  require 'pry/version'
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.16.0
5
5
  platform: java
6
6
  authors:
7
7
  - John Mair (banisterfiend)
8
8
  - Conrad Irwin
9
9
  - Ryan Fitzgerald
10
10
  - Kyrylo Silin
11
- autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2024-12-24 00:00:00.000000000 Z
13
+ date: 1980-01-02 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: coderay
@@ -41,6 +40,20 @@ dependencies:
41
40
  - - "~>"
42
41
  - !ruby/object:Gem::Version
43
42
  version: '1.0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: reline
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 0.6.0
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.6.0
44
57
  - !ruby/object:Gem::Dependency
45
58
  name: spoon
46
59
  requirement: !ruby/object:Gem::Requirement
@@ -216,7 +229,6 @@ metadata:
216
229
  changelog_uri: https://github.com/pry/pry/blob/master/CHANGELOG.md
217
230
  source_code_uri: https://github.com/pry/pry
218
231
  bug_tracker_uri: https://github.com/pry/pry/issues
219
- post_install_message:
220
232
  rdoc_options: []
221
233
  require_paths:
222
234
  - lib
@@ -224,15 +236,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
236
  requirements:
225
237
  - - ">="
226
238
  - !ruby/object:Gem::Version
227
- version: '2.0'
239
+ version: '2.6'
228
240
  required_rubygems_version: !ruby/object:Gem::Requirement
229
241
  requirements:
230
242
  - - ">="
231
243
  - !ruby/object:Gem::Version
232
244
  version: '0'
233
245
  requirements: []
234
- rubygems_version: 3.4.14
235
- signing_key:
246
+ rubygems_version: 4.0.3
236
247
  specification_version: 4
237
248
  summary: A runtime developer console and IRB alternative with powerful introspection
238
249
  capabilities.