irb 1.15.1 → 1.15.2
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 +4 -4
- data/irb.gemspec +3 -1
- data/lib/irb/input-method.rb +16 -10
- data/lib/irb/pager.rb +1 -1
- data/lib/irb/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0777b40af32d70077c30a5c818b82f9b7d6b1962a59648667016fe3b2a5bdc92
|
4
|
+
data.tar.gz: 3487682618e9aa452daaabd727117182dc95d85885a0b18b0b348f67e8a75f6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528a9784ba5b854519684bbe4cd03a7e6467b3619035d90ca7b7b864300b1dc22a4d755b1824ed5d653bd46e26631d88b577bfdecd6aeed24df16302471df47c
|
7
|
+
data.tar.gz: 9b401a6e0c08bdc361232be10797e307ac94567414300f7b385ae65392340aeb3ccd88ad53e447d8fb3543211ca55e2f61beb1d9543dd593a41fa736ed42c86f
|
data/irb.gemspec
CHANGED
@@ -33,7 +33,9 @@ Gem::Specification.new do |spec|
|
|
33
33
|
"exe/irb",
|
34
34
|
"irb.gemspec",
|
35
35
|
"man/irb.1",
|
36
|
-
] + Dir.
|
36
|
+
] + Dir.chdir(File.expand_path('..', __FILE__)) do
|
37
|
+
Dir.glob("lib/**/*").map {|f| f unless File.directory?(f) }.compact
|
38
|
+
end
|
37
39
|
spec.bindir = "exe"
|
38
40
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
39
41
|
spec.require_paths = ["lib"]
|
data/lib/irb/input-method.rb
CHANGED
@@ -26,10 +26,11 @@ module IRB
|
|
26
26
|
|
27
27
|
def winsize
|
28
28
|
if instance_variable_defined?(:@stdout) && @stdout.tty?
|
29
|
-
@stdout.winsize
|
30
|
-
|
31
|
-
|
29
|
+
winsize = @stdout.winsize
|
30
|
+
# If width or height is 0, something is wrong.
|
31
|
+
return winsize unless winsize.include? 0
|
32
32
|
end
|
33
|
+
[24, 80]
|
33
34
|
end
|
34
35
|
|
35
36
|
# Whether this input method is still readable when there is no more data to
|
@@ -175,10 +176,15 @@ module IRB
|
|
175
176
|
class ReadlineInputMethod < StdioInputMethod
|
176
177
|
class << self
|
177
178
|
def initialize_readline
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
179
|
+
return if defined?(self::Readline)
|
180
|
+
|
181
|
+
begin
|
182
|
+
require 'readline'
|
183
|
+
const_set(:Readline, ::Readline)
|
184
|
+
rescue LoadError
|
185
|
+
const_set(:Readline, ::Reline)
|
186
|
+
end
|
187
|
+
const_set(:HISTORY, self::Readline::HISTORY)
|
182
188
|
end
|
183
189
|
end
|
184
190
|
|
@@ -216,8 +222,8 @@ module IRB
|
|
216
222
|
def gets
|
217
223
|
Readline.input = @stdin
|
218
224
|
Readline.output = @stdout
|
219
|
-
if l = readline(@prompt, false)
|
220
|
-
HISTORY.push(l) if !l.empty?
|
225
|
+
if l = Readline.readline(@prompt, false)
|
226
|
+
Readline::HISTORY.push(l) if !l.empty?
|
221
227
|
@line[@line_no += 1] = l + "\n"
|
222
228
|
else
|
223
229
|
@eof = true
|
@@ -239,7 +245,7 @@ module IRB
|
|
239
245
|
|
240
246
|
# For debug message
|
241
247
|
def inspect
|
242
|
-
readline_impl =
|
248
|
+
readline_impl = Readline == ::Reline ? 'Reline' : 'ext/readline'
|
243
249
|
str = "ReadlineInputMethod with #{readline_impl} #{Readline::VERSION}"
|
244
250
|
inputrc_path = File.expand_path(ENV['INPUTRC'] || '~/.inputrc')
|
245
251
|
str += " and #{inputrc_path}" if File.exist?(inputrc_path)
|
data/lib/irb/pager.rb
CHANGED
@@ -189,7 +189,7 @@ module IRB
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
@buffer.clear
|
192
|
-
@buffer << @lines.pop
|
192
|
+
@buffer << @lines.pop if !@lines.empty? && !@lines.last.end_with?("\n")
|
193
193
|
@col = Reline::Unicode.calculate_width(@buffer, true)
|
194
194
|
end
|
195
195
|
if overflow || @lines.size > @height || (@lines.size == @height && @col > 0)
|
data/lib/irb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aycabta
|
8
8
|
- Keiju ISHITSUKA
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reline
|