pry 0.16.0 → 0.16.1

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: f45a7ece4b6117e2ecb650b850bbafc729d1575d810ae709dff957979782b030
4
- data.tar.gz: f3977bcef3004c4643ea02320dc4f3ca1d2958ea813665559bc2f0db01325efd
3
+ metadata.gz: 9ebc92a4517dfa140377a064c75d144477159656148a4370c924ecbacf97155a
4
+ data.tar.gz: ac296d197af25cc2e5635d5fba84e92133abcab28d891d88441c498539fd4707
5
5
  SHA512:
6
- metadata.gz: 276887cb72b590db134890f41b44dd6844bc1e5cd8307ca72236028967026c7f24fd07e14ae1d99840330672941740945a502ca965e2d7d00df400095af7a12a
7
- data.tar.gz: 52146474624b386e394aaf5a21e371c5e52744a2aeff67468603a25b81bfb4bd83be027b7b2bf9aa9b987b22aa3a0efb3debc86d892536c00ad6a33465a33d85
6
+ metadata.gz: fcbc19a8e8c9d3d7f93f80a4cc8b42cf1074843355f9e1c0145e3d5ac18e8b9f8e2ad095ef94db193bf5fc47c904bf89848863cc4a81fce8339097023765cdfc
7
+ data.tar.gz: 0156ac2559648e20e71c51c066176f1649d5b27e2689246f6c2b8985ea0fc5a1c8830ef787a6bf235e7e679fd380913f8e85e5a1d00572260fd36979b99c9ff4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ### [v0.16.1](v0.16.1) (October 19, 2026)
2
+
3
+ #### Bug Fixes
4
+
5
+ * Fix `ls -G` grep filtering across all variable types
6
+ ([#2363](https://github.com/pry/pry/pull/2363))
7
+ * Fix Readline call on Ruby 4+ with SimplePager
8
+ ([#2366](https://github.com/pry/pry/pull/2366))
9
+ ([#2373](https://github.com/pry/pry/pull/2373))
10
+ * Fix test failures when `TERM` and `EDITOR` are unset
11
+ ([#2367](https://github.com/pry/pry/pull/2367))
12
+
1
13
  ### [v0.16.0](v0.16.0) (December 26, 2025)
2
14
 
3
15
  #### Features
@@ -27,7 +27,8 @@ class Pry
27
27
  def output_self
28
28
  mod = interrogatee_mod
29
29
  constants = WrappedModule.new(mod).constants(@verbose_switch)
30
- output_section('constants', grep.regexp[format(mod, constants)])
30
+ constants = grep.regexp[constants]
31
+ output_section('constants', format(mod, constants))
31
32
  end
32
33
 
33
34
  private
@@ -27,8 +27,8 @@ class Pry
27
27
  end
28
28
 
29
29
  def output_self
30
- variables = format(@target.eval('global_variables'))
31
- output_section('global variables', grep.regexp[variables])
30
+ globals = grep.regexp[@target.eval('global_variables')]
31
+ output_section('global variables', format(globals))
32
32
  end
33
33
 
34
34
  private
@@ -24,6 +24,8 @@ class Pry
24
24
  [] # TODO: BasicObject support
25
25
  end
26
26
  kvars = Pry::Method.safe_send(interrogatee_mod, :class_variables)
27
+ ivars = grep.regexp[ivars]
28
+ kvars = grep.regexp[kvars]
27
29
  ivars_out = output_section('instance variables', format(:instance_var, ivars))
28
30
  kvars_out = output_section('class variables', format(:class_var, kvars))
29
31
  ivars_out + kvars_out
@@ -14,6 +14,7 @@ class Pry
14
14
  locals = @target.eval('local_variables').reject do |e|
15
15
  @sticky_locals.key?(e.to_sym)
16
16
  end
17
+ locals = grep.regexp[locals]
17
18
  name_value_pairs = locals.map do |name|
18
19
  [name, @target.eval(name.to_s)]
19
20
  end
@@ -37,7 +38,7 @@ class Pry
37
38
  pad = desired_width + color_escape_padding
38
39
  Kernel.format(
39
40
  "%-#{pad}<name>s = %<value>s",
40
- name: color(:local_var, colorized_lhs),
41
+ name: colorized_lhs,
41
42
  value: rhs
42
43
  )
43
44
  end
@@ -50,7 +50,7 @@ class Pry
50
50
  end
51
51
 
52
52
  def local_vars
53
- LocalVars.new(@opts, pry_instance)
53
+ grep LocalVars.new(@opts, pry_instance)
54
54
  end
55
55
 
56
56
  def entities
data/lib/pry/editor.rb CHANGED
@@ -17,7 +17,7 @@ class Pry
17
17
 
18
18
  %w[editor nano vi].find do |editor_exe|
19
19
  Kernel.system("which #{editor_exe} > /dev/null 2>&1")
20
- end
20
+ end || 'nano'
21
21
  end
22
22
 
23
23
  include Pry::Helpers::CommandHelpers
@@ -36,8 +36,10 @@ class Pry
36
36
  end
37
37
 
38
38
  def use_ansi_codes?
39
- Pry::Helpers::Platform.windows_ansi? ||
40
- ((term = Pry::Env['TERM']) && term != "dumb")
39
+ return true if Pry::Helpers::Platform.windows_ansi?
40
+
41
+ term = Pry::Env['TERM']
42
+ !term.nil? && term != "dumb"
41
43
  end
42
44
 
43
45
  def colorize_code(code)
data/lib/pry/pager.rb CHANGED
@@ -57,7 +57,7 @@ class Pry
57
57
  if !pry_instance.config.pager
58
58
  NullPager.new(pry_instance.output)
59
59
  elsif !SystemPager.available? || Helpers::Platform.jruby?
60
- SimplePager.new(pry_instance.output)
60
+ SimplePager.new(pry_instance.output, pry_instance.input)
61
61
  else
62
62
  SystemPager.new(pry_instance.output)
63
63
  end
@@ -99,8 +99,9 @@ class Pry
99
99
  # `SimplePager` is a straightforward pure-Ruby pager. We use it on
100
100
  # JRuby and when we can't find a usable external pager.
101
101
  class SimplePager < NullPager
102
- def initialize(*)
103
- super
102
+ def initialize(out, input = Pry.config.input)
103
+ super(out)
104
+ @input = input
104
105
  @tracker = PageTracker.new(height - 3, width)
105
106
  end
106
107
 
@@ -115,7 +116,7 @@ class Pry
115
116
  @out.print "\e[0m"
116
117
  @out.print "<page break> --- Press enter to continue " \
117
118
  "( q<enter> to break ) --- <page break>\n"
118
- raise StopPaging if Readline.readline("").chomp == "q"
119
+ raise StopPaging if @input.readline("").chomp == "q"
119
120
 
120
121
  @tracker.reset
121
122
  end
@@ -49,10 +49,10 @@ class Pry
49
49
  attr_reader :config
50
50
 
51
51
  def_delegators(
52
- :@config, :input, :input=, :output, :output=, :commands,
52
+ :@config, :input, :input=, :output=, :commands,
53
53
  :commands=, :print, :print=, :exception_handler, :exception_handler=,
54
- :hooks, :hooks=, :color, :color=, :pager, :pager=, :editor, :editor=,
55
- :memory_size, :memory_size=, :extra_sticky_locals, :extra_sticky_locals=
54
+ :hooks, :hooks=, :color, :color=, :pager=, :editor, :editor=,
55
+ :extra_sticky_locals, :extra_sticky_locals=
56
56
  )
57
57
 
58
58
  EMPTY_COMPLETIONS = [].freeze
@@ -182,14 +182,12 @@ class Pry
182
182
  end
183
183
  end
184
184
 
185
- undef :memory_size if method_defined? :memory_size
186
185
  # @return [Integer] The maximum amount of objects remembered by the inp and
187
186
  # out arrays. Defaults to 100.
188
187
  def memory_size
189
188
  @output_ring.max_size
190
189
  end
191
190
 
192
- undef :memory_size= if method_defined? :memory_size=
193
191
  def memory_size=(size)
194
192
  @input_ring = Pry::Ring.new(size)
195
193
  @output_ring = Pry::Ring.new(size)
@@ -493,7 +491,6 @@ class Pry
493
491
  prompt_stack.size > 1 ? prompt_stack.pop : prompt
494
492
  end
495
493
 
496
- undef :pager if method_defined? :pager
497
494
  # Returns the currently configured pager
498
495
  # @example
499
496
  # pry_instance.pager.page text
@@ -501,7 +498,6 @@ class Pry
501
498
  Pry::Pager.new(self)
502
499
  end
503
500
 
504
- undef :output if method_defined? :output
505
501
  # Returns an output device
506
502
  # @example
507
503
  # pry_instance.output.puts "ohai!"
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.16.0'.freeze
4
+ VERSION = '0.16.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubygems_version: 4.0.3
232
+ rubygems_version: 4.0.6
233
233
  specification_version: 4
234
234
  summary: A runtime developer console and IRB alternative with powerful introspection
235
235
  capabilities.