irb 1.1.0.pre.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/irb/color.rb +4 -4
- data/lib/irb/context.rb +6 -0
- data/lib/irb/init.rb +6 -6
- data/lib/irb/ruby-lex.rb +6 -6
- data/lib/irb/version.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ea14a93083cae06cb1b6acb7df716a4b674fe0179df78133a5e9d515f814de5
|
4
|
+
data.tar.gz: e5c48bf9b0407c3bf8c278a999a333bcf6cc514d467292eb578f0a434992d06c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57da5191caf04ded2eebea073a511f721bb66c511c0821fe4055aa582333209e9293380af20680fcebee290d109e30df73d1752cc32893729e8df0a7712c1192
|
7
|
+
data.tar.gz: eab5b941d5db5d0582e32d7dc3fb77955024c3ca852e83816fc4bf8c4c3442910dff2a3cba7c41a9e0e357943371e371646e8c1b23721fd2e1d8e2c3cfa2fa84
|
data/lib/irb/color.rb
CHANGED
@@ -71,7 +71,7 @@ module IRB # :nodoc:
|
|
71
71
|
$stdout.tty? && supported? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
|
72
72
|
end
|
73
73
|
|
74
|
-
def inspect_colorable?(obj, seen: {})
|
74
|
+
def inspect_colorable?(obj, seen: {}.compare_by_identity)
|
75
75
|
case obj
|
76
76
|
when String, Symbol, Regexp, Integer, Float, FalseClass, TrueClass, NilClass
|
77
77
|
true
|
@@ -138,11 +138,11 @@ module IRB # :nodoc:
|
|
138
138
|
private
|
139
139
|
|
140
140
|
def without_circular_ref(obj, seen:, &block)
|
141
|
-
return false if seen.key?(obj
|
142
|
-
seen[obj
|
141
|
+
return false if seen.key?(obj)
|
142
|
+
seen[obj] = true
|
143
143
|
block.call
|
144
144
|
ensure
|
145
|
-
seen.delete(obj
|
145
|
+
seen.delete(obj)
|
146
146
|
end
|
147
147
|
|
148
148
|
# Ripper::Lexer::Elem#state is supported on Ruby 2.5+
|
data/lib/irb/context.rb
CHANGED
@@ -82,6 +82,12 @@ module IRB
|
|
82
82
|
case use_multiline?
|
83
83
|
when nil
|
84
84
|
if STDIN.tty? && IRB.conf[:PROMPT_MODE] != :INF_RUBY && !use_singleline?
|
85
|
+
# Both of multiline mode and singleline mode aren't specified.
|
86
|
+
puts <<~EOM
|
87
|
+
This version of IRB is drastically different from the previous version.
|
88
|
+
If you hit any issues, you can use "irb --legacy" to run the old version.
|
89
|
+
If you want to just erase this message, please use "irb --multiline".
|
90
|
+
EOM
|
85
91
|
@io = ReidlineInputMethod.new
|
86
92
|
else
|
87
93
|
@io = nil
|
data/lib/irb/init.rb
CHANGED
@@ -161,7 +161,7 @@ module IRB # :nodoc:
|
|
161
161
|
end
|
162
162
|
when "--noinspect"
|
163
163
|
@CONF[:INSPECT_MODE] = false
|
164
|
-
when "--singleline", "--readline"
|
164
|
+
when "--singleline", "--readline", "--legacy"
|
165
165
|
@CONF[:USE_SINGLELINE] = true
|
166
166
|
when "--nosingleline", "--noreadline"
|
167
167
|
@CONF[:USE_SINGLELINE] = false
|
@@ -274,11 +274,11 @@ module IRB # :nodoc:
|
|
274
274
|
if home = ENV["HOME"]
|
275
275
|
yield proc{|rc| home+"/.irb#{rc}"}
|
276
276
|
end
|
277
|
-
|
278
|
-
yield proc{|rc|
|
279
|
-
yield proc{|rc|
|
280
|
-
yield proc{|rc|
|
281
|
-
yield proc{|rc|
|
277
|
+
current_dir = Dir.pwd
|
278
|
+
yield proc{|rc| current_dir+"/.irb#{rc}"}
|
279
|
+
yield proc{|rc| current_dir+"/irb#{rc.sub(/\A_?/, '.')}"}
|
280
|
+
yield proc{|rc| current_dir+"/_irb#{rc}"}
|
281
|
+
yield proc{|rc| current_dir+"/$irb#{rc}"}
|
282
282
|
end
|
283
283
|
|
284
284
|
# loading modules
|
data/lib/irb/ruby-lex.rb
CHANGED
@@ -306,8 +306,8 @@ class RubyLex
|
|
306
306
|
next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
|
307
307
|
case t[2]
|
308
308
|
when 'do'
|
309
|
-
if index > 0 and @tokens[index - 1][3].
|
310
|
-
#
|
309
|
+
if index > 0 and @tokens[index - 1][3].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN)
|
310
|
+
# method_with_block do; end
|
311
311
|
indent += 1
|
312
312
|
else
|
313
313
|
# while cond do; end # also "until" or "for"
|
@@ -332,7 +332,7 @@ class RubyLex
|
|
332
332
|
depth_difference = 0
|
333
333
|
@tokens.each_with_index do |t, index|
|
334
334
|
case t[1]
|
335
|
-
when :on_ignored_nl, :on_nl
|
335
|
+
when :on_ignored_nl, :on_nl, :on_comment
|
336
336
|
if index != (@tokens.size - 1)
|
337
337
|
depth_difference = 0
|
338
338
|
end
|
@@ -349,8 +349,8 @@ class RubyLex
|
|
349
349
|
next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
|
350
350
|
case t[2]
|
351
351
|
when 'do'
|
352
|
-
if index > 0 and @tokens[index - 1][3].
|
353
|
-
#
|
352
|
+
if index > 0 and @tokens[index - 1][3].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN)
|
353
|
+
# method_with_block do; end
|
354
354
|
depth_difference += 1
|
355
355
|
else
|
356
356
|
# while cond do; end # also "until" or "for"
|
@@ -381,7 +381,7 @@ class RubyLex
|
|
381
381
|
@tokens.each_with_index do |t, index|
|
382
382
|
corresponding_token_depth = nil
|
383
383
|
case t[1]
|
384
|
-
when :on_ignored_nl, :on_nl
|
384
|
+
when :on_ignored_nl, :on_nl, :on_comment
|
385
385
|
spaces_at_line_head = 0
|
386
386
|
is_first_spaces_of_line = true
|
387
387
|
is_first_printable_of_line = true
|
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.1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keiju ISHITSUKA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reline
|
@@ -129,9 +129,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '2.4'
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
|
-
- - "
|
132
|
+
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
134
|
+
version: '0'
|
135
135
|
requirements: []
|
136
136
|
rubygems_version: 3.0.6
|
137
137
|
signing_key:
|