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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08f949b006c169864a0af78d57f3a1d3a78c360d1c3b7eb0e0e8cdb578f02d6c'
4
- data.tar.gz: 179eb9d08ca51c7b6ecaa807bc07d7eb4b26f5a56ea440f74361fa2d6cbaa7d2
3
+ metadata.gz: 2ea14a93083cae06cb1b6acb7df716a4b674fe0179df78133a5e9d515f814de5
4
+ data.tar.gz: e5c48bf9b0407c3bf8c278a999a333bcf6cc514d467292eb578f0a434992d06c
5
5
  SHA512:
6
- metadata.gz: a8d294bbba94abd593eb1f5f73e1825c4272bf3b24370b6f38f7458a617481af0b28104a873a03cbc8147d3f0b2d70d159c3021f40b56acb19b6ff51f4b352c1
7
- data.tar.gz: 0410eaefa871fe48b295f59bc81c04e47afe510444a2ba205a4e93a5092134aacf363b43d2ee167a1e447edc0e9aa0a219ae2edd9cbde2d959ca9efdadcdcde9
6
+ metadata.gz: 57da5191caf04ded2eebea073a511f721bb66c511c0821fe4055aa582333209e9293380af20680fcebee290d109e30df73d1752cc32893729e8df0a7712c1192
7
+ data.tar.gz: eab5b941d5db5d0582e32d7dc3fb77955024c3ca852e83816fc4bf8c4c3442910dff2a3cba7c41a9e0e357943371e371646e8c1b23721fd2e1d8e2c3cfa2fa84
@@ -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.object_id)
142
- seen[obj.object_id] = true
141
+ return false if seen.key?(obj)
142
+ seen[obj] = true
143
143
  block.call
144
144
  ensure
145
- seen.delete(obj.object_id)
145
+ seen.delete(obj)
146
146
  end
147
147
 
148
148
  # Ripper::Lexer::Elem#state is supported on Ruby 2.5+
@@ -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
@@ -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
- home = Dir.pwd
278
- yield proc{|rc| home+"/.irb#{rc}"}
279
- yield proc{|rc| home+"/irb#{rc.sub(/\A_?/, '.')}"}
280
- yield proc{|rc| home+"/_irb#{rc}"}
281
- yield proc{|rc| home+"/$irb#{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
@@ -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].allbits?(Ripper::EXPR_CMDARG)
310
- # method_with_bock do; end
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].allbits?(Ripper::EXPR_CMDARG)
353
- # method_with_bock do; end
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
@@ -11,7 +11,7 @@
11
11
  #
12
12
 
13
13
  module IRB # :nodoc:
14
- VERSION = "1.1.0.pre.4"
14
+ VERSION = "1.1.0"
15
15
  @RELEASE_VERSION = VERSION
16
- @LAST_UPDATE_DATE = "2019-09-01"
16
+ @LAST_UPDATE_DATE = "2019-11-21"
17
17
  end
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.pre.4
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-17 00:00:00.000000000 Z
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: 1.3.1
134
+ version: '0'
135
135
  requirements: []
136
136
  rubygems_version: 3.0.6
137
137
  signing_key: