irb 1.3.8.pre.10 → 1.3.8.pre.11

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: 64245fa0213491e1a1340223cad9978a831a4cb95c30583947d1580f781fa916
4
- data.tar.gz: 971cb2a3ef3631d3489202f13e070c43966d4e981dae846ca2756248afb2285f
3
+ metadata.gz: 11626f5579d5c88f1358bac49d6cfb81663193cf79b19b49e5958bf930fb61de
4
+ data.tar.gz: 75253829683f5dee7208b964abd7ae7924867bf910fcdbba9cd9fdf4a3848751
5
5
  SHA512:
6
- metadata.gz: 1547d50d86acaeeb7edc4dc0d68fd9cf2f025f82f1f7e47728d8212776506cd485dcd96c39c5b429e8b7c2f83afc1698042b976797fa2e26d4ba2b4faba7e186
7
- data.tar.gz: d18b3174329d2c7f253dfcfbff40656ceaf2fd42fa603468e0bb48eba6e4057c6e5fdc06874f1d7701f5be47d072aa0aa2b024bdb7e8a80e6644041e2af5b03e
6
+ metadata.gz: b7faa90700c773424719934303c87ade13c38426c5a604425e9bf5921cb1e7234bd002f7179ecbe64597806b286acbff314e085e93ccb0b02ee69399bda59e77
7
+ data.tar.gz: 05b5f9834f71f15733c7541c66ad7a8ef32a38acdb2101d923db70810c47b4d82382ae187754eaf97931dbe0546b7767985c27a178e2883b5812638825fed376
data/irb.gemspec CHANGED
@@ -36,5 +36,5 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5")
38
38
 
39
- spec.add_dependency "reline", ">= 0.2.8.pre.10"
39
+ spec.add_dependency "reline", ">= 0.2.8.pre.11"
40
40
  end
data/lib/irb/context.rb CHANGED
@@ -478,6 +478,8 @@ module IRB
478
478
  # Exits the current session, see IRB.irb_exit
479
479
  def exit(ret = 0)
480
480
  IRB.irb_exit(@irb, ret)
481
+ rescue UncaughtThrowError
482
+ super
481
483
  end
482
484
 
483
485
  NOPRINTING_IVARS = ["@last_value"] # :nodoc:
@@ -265,7 +265,8 @@ module IRB
265
265
 
266
266
  class ReidlineInputMethod < InputMethod
267
267
  include Reline
268
- # Creates a new input method object using Readline
268
+
269
+ # Creates a new input method object using Reline
269
270
  def initialize
270
271
  IRB.__send__(:set_encoding, Reline.encoding_system_needs.name, override: false)
271
272
  super
@@ -319,11 +320,6 @@ module IRB
319
320
  [Reline::Key.new(nil, 0xE4, true)], # Normal Alt+d.
320
321
  [195, 164] # The "ä" that appears when Alt+d is pressed on xterm.
321
322
  ]
322
- begin
323
- require 'rdoc'
324
- rescue LoadError
325
- return nil
326
- end
327
323
 
328
324
  if just_cursor_moving and completion_journey_data.nil?
329
325
  return nil
@@ -370,14 +366,39 @@ module IRB
370
366
  end
371
367
  return nil if doc.nil?
372
368
  width = 40
369
+
370
+ right_x = cursor_pos_to_render.x + autocomplete_dialog.width
371
+ if right_x + width > screen_width
372
+ right_width = screen_width - (right_x + 1)
373
+ left_x = autocomplete_dialog.column - width
374
+ left_x = 0 if left_x < 0
375
+ left_width = width > autocomplete_dialog.column ? autocomplete_dialog.column : width
376
+ if right_width.positive? and left_width.positive?
377
+ if right_width >= left_width
378
+ width = right_width
379
+ x = right_x
380
+ else
381
+ width = left_width
382
+ x = left_x
383
+ end
384
+ elsif right_width.positive? and left_width <= 0
385
+ width = right_width
386
+ x = right_x
387
+ elsif right_width <= 0 and left_width.positive?
388
+ width = left_width
389
+ x = left_x
390
+ else # Both are negative width.
391
+ return nil
392
+ end
393
+ else
394
+ x = right_x
395
+ end
373
396
  formatter = RDoc::Markup::ToAnsi.new
374
397
  formatter.width = width
375
398
  dialog.trap_key = alt_d
376
399
  message = 'Press Alt+d to read the full document'
377
400
  contents = [message] + doc.accept(formatter).split("\n")
378
401
 
379
- x = cursor_pos_to_render.x + autocomplete_dialog.width
380
- x = autocomplete_dialog.column - width if x + width >= screen_width
381
402
  y = cursor_pos_to_render.y
382
403
  DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')
383
404
  }
data/lib/irb/ruby-lex.rb CHANGED
@@ -477,7 +477,7 @@ class RubyLex
477
477
 
478
478
  def take_corresponding_syntax_to_kw_do(tokens, index)
479
479
  syntax_of_do = nil
480
- # Finding a syntax correnponding to "do".
480
+ # Finding a syntax corresponding to "do".
481
481
  index.downto(0) do |i|
482
482
  tk = tokens[i]
483
483
  # In "continue", the token isn't the corresponding syntax to "do".
@@ -508,7 +508,7 @@ class RubyLex
508
508
 
509
509
  def is_the_in_correspond_to_a_for(tokens, index)
510
510
  syntax_of_in = nil
511
- # Finding a syntax correnponding to "do".
511
+ # Finding a syntax corresponding to "do".
512
512
  index.downto(0) do |i|
513
513
  tk = tokens[i]
514
514
  # In "continue", the token isn't the corresponding syntax to "do".
data/lib/irb/version.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #
12
12
 
13
13
  module IRB # :nodoc:
14
- VERSION = "1.3.8.pre.10"
14
+ VERSION = "1.3.8.pre.11"
15
15
  @RELEASE_VERSION = VERSION
16
- @LAST_UPDATE_DATE = "2021-10-03"
16
+ @LAST_UPDATE_DATE = "2021-10-09"
17
17
  end
data/lib/irb.rb CHANGED
@@ -613,7 +613,7 @@ module IRB
613
613
  ret = conv.primitive_convert(str, dst)
614
614
  case ret
615
615
  when :invalid_byte_sequence
616
- conv.insert_output(conf.primitive_errinfo[3].dump[1..-2])
616
+ conv.insert_output(conv.primitive_errinfo[3].dump[1..-2])
617
617
  redo
618
618
  when :undefined_conversion
619
619
  c = conv.primitive_errinfo[3].dup.force_encoding(conv.primitive_errinfo[1])
@@ -867,7 +867,7 @@ module IRB
867
867
 
868
868
  # If the expression is invalid, Ripper.sexp should return nil which will
869
869
  # result in false being returned. Any valid expression should return an
870
- # s-expression where the second selement of the top level array is an
870
+ # s-expression where the second element of the top level array is an
871
871
  # array of parsed expressions. The first element of each expression is the
872
872
  # expression's type.
873
873
  verbose, $VERBOSE = $VERBOSE, nil
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.3.8.pre.10
4
+ version: 1.3.8.pre.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keiju ISHITSUKA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-03 00:00:00.000000000 Z
11
+ date: 2021-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reline
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.8.pre.10
19
+ version: 0.2.8.pre.11
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.8.pre.10
26
+ version: 0.2.8.pre.11
27
27
  description: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
28
28
  email:
29
29
  - keiju@ruby-lang.org