irb 1.7.3 → 1.7.4
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/lib/irb/context.rb +5 -7
- data/lib/irb/history.rb +0 -2
- data/lib/irb/input-method.rb +13 -0
- 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: ea4ae752c3ffee02c55d78d1da5032244d6c9574fc8a7e64bcd4d0798e89b619
|
4
|
+
data.tar.gz: 24eb6d55d8c1fdead9230a92d3f70016936ccbe99a69bdef60de9d68108e0336
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aec5c7c99c1dc58ed3f427cd6ef397c1310b1b43f42923999d6dc7b12b6d9334af6660c7cc1cd2b0d1b8b3b5a6411d5e85bad84513a8230688924850f48819c
|
7
|
+
data.tar.gz: e54020f1e5c7a777905d0218fcf1a1634acfe89fe9a64a27199154bbda4557b3af0b43444d2e36d5d124021783092ffe089df3ead84da45c053879cc7a5d5a1d
|
data/lib/irb/context.rb
CHANGED
@@ -154,8 +154,12 @@ module IRB
|
|
154
154
|
|
155
155
|
def save_history=(val)
|
156
156
|
IRB.conf[:SAVE_HISTORY] = val
|
157
|
+
|
157
158
|
if val
|
158
|
-
(IRB.conf[:MAIN_CONTEXT] || self)
|
159
|
+
context = (IRB.conf[:MAIN_CONTEXT] || self)
|
160
|
+
if context.io.support_history_saving? && !context.io.singleton_class.include?(HistorySavingAbility)
|
161
|
+
context.io.extend(HistorySavingAbility)
|
162
|
+
end
|
159
163
|
end
|
160
164
|
end
|
161
165
|
|
@@ -576,11 +580,5 @@ module IRB
|
|
576
580
|
command = command_aliases.fetch(command.to_sym, command)
|
577
581
|
ExtendCommandBundle.load_command(command)&.respond_to?(:transform_args)
|
578
582
|
end
|
579
|
-
|
580
|
-
def init_save_history# :nodoc:
|
581
|
-
unless (class<<@io;self;end).include?(HistorySavingAbility)
|
582
|
-
@io.extend(HistorySavingAbility)
|
583
|
-
end
|
584
|
-
end
|
585
583
|
end
|
586
584
|
end
|
data/lib/irb/history.rb
CHANGED
@@ -7,7 +7,6 @@ module IRB
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def load_history
|
10
|
-
return unless self.class.const_defined?(:HISTORY)
|
11
10
|
history = self.class::HISTORY
|
12
11
|
if history_file = IRB.conf[:HISTORY_FILE]
|
13
12
|
history_file = File.expand_path(history_file)
|
@@ -31,7 +30,6 @@ module IRB
|
|
31
30
|
end
|
32
31
|
|
33
32
|
def save_history
|
34
|
-
return unless self.class.const_defined?(:HISTORY)
|
35
33
|
history = self.class::HISTORY
|
36
34
|
if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) != 0
|
37
35
|
if history_file = IRB.conf[:HISTORY_FILE]
|
data/lib/irb/input-method.rb
CHANGED
@@ -46,6 +46,10 @@ module IRB
|
|
46
46
|
false
|
47
47
|
end
|
48
48
|
|
49
|
+
def support_history_saving?
|
50
|
+
false
|
51
|
+
end
|
52
|
+
|
49
53
|
# For debug message
|
50
54
|
def inspect
|
51
55
|
'Abstract InputMethod'
|
@@ -229,6 +233,10 @@ module IRB
|
|
229
233
|
true
|
230
234
|
end
|
231
235
|
|
236
|
+
def support_history_saving?
|
237
|
+
true
|
238
|
+
end
|
239
|
+
|
232
240
|
# Returns the current line number for #io.
|
233
241
|
#
|
234
242
|
# #line counts the number of times #gets is called.
|
@@ -255,6 +263,7 @@ module IRB
|
|
255
263
|
end
|
256
264
|
|
257
265
|
class RelineInputMethod < InputMethod
|
266
|
+
HISTORY = Reline::HISTORY
|
258
267
|
# Creates a new input method object using Reline
|
259
268
|
def initialize
|
260
269
|
IRB.__send__(:set_encoding, Reline.encoding_system_needs.name, override: false)
|
@@ -457,6 +466,10 @@ module IRB
|
|
457
466
|
str += " and #{inputrc_path}" if File.exist?(inputrc_path)
|
458
467
|
str
|
459
468
|
end
|
469
|
+
|
470
|
+
def support_history_saving?
|
471
|
+
true
|
472
|
+
end
|
460
473
|
end
|
461
474
|
|
462
475
|
class ReidlineInputMethod < RelineInputMethod
|
data/lib/irb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aycabta
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-07-
|
12
|
+
date: 2023-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: reline
|