irb 1.3.7 → 1.3.8.pre.1

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: ddb63fc9d57700014a7da313e20504596ca42dfee0952547fa545d726f08d7d6
4
- data.tar.gz: cc4ee2f880d56dc7f792ecc406f489f8555601d19499f45d8f8828cc260ed1b0
3
+ metadata.gz: 98ac31009e423fdea5f0151f5b48e3199dc98427484d5465088e1a9e0bac88fd
4
+ data.tar.gz: 180d9637906858acb3abba279ee49934d397979da0f4e9e7fab373c4d7313d4d
5
5
  SHA512:
6
- metadata.gz: c5b128b8ce5457862489e313231af33167802619c3847da526dda30c83f7fc96d1a248d2916e17da4cbd45f8d30aee8c181237182b97b5741cf4bc4c13568bfb
7
- data.tar.gz: 61147b2b4e76f34076043feaa84feeb2e893a140d3d7d1e5013a00f87f27f694802f8ae21788709a7ee03c5b41ee445735aec93bfedbeaa9fcf02d6bf06f705d
6
+ metadata.gz: 89acce9899ac0fefa699639a514ada88bb2b9e3c18e3a1b5f83e139800d99b18445269ef5703b45c794f69a186c99cfd4f02fbfd24a883ed2164c9d1eacceb21
7
+ data.tar.gz: a16a4ba0f9505da943a29a6138b29b8d92e9fff6cad5fcea14ca3666095d0e02b467eaaf83eb425b4da4971c047b10eab73ba28bde5794d2e46f58d67476a182
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.7"
39
+ spec.add_dependency "reline", ">= 0.2.8.pre.1"
40
40
  end
@@ -14,6 +14,7 @@ require_relative 'magic-file'
14
14
  require_relative 'completion'
15
15
  require 'io/console'
16
16
  require 'reline'
17
+ require 'rdoc'
17
18
 
18
19
  module IRB
19
20
  STDIN_FILE_NAME = "(line)" # :nodoc:
@@ -308,6 +309,50 @@ module IRB
308
309
  @auto_indent_proc = block
309
310
  end
310
311
 
312
+ SHOW_DOC_DIALOG = ->() {
313
+ begin
314
+ require 'rdoc'
315
+ rescue LoadError
316
+ return nil
317
+ end
318
+ if just_cursor_moving and completion_journey_data.nil?
319
+ return nil
320
+ end
321
+ cursor_pos_to_render, result, pointer = context.pop(3)
322
+ return nil if result.nil? or pointer.nil?
323
+ name = result[pointer]
324
+
325
+ driver = RDoc::RI::Driver.new
326
+ begin
327
+ name = driver.expand_name(name)
328
+ rescue RDoc::RI::Driver::NotFoundError
329
+ return nil
330
+ end
331
+ doc = nil
332
+ used_for_class = false
333
+ if not name =~ /#|\./
334
+ found, klasses, includes, extends = driver.classes_and_includes_and_extends_for(name)
335
+ if not found.empty?
336
+ doc = driver.class_document(name, found, klasses, includes, extends)
337
+ used_for_class = true
338
+ end
339
+ end
340
+ unless used_for_class
341
+ doc = RDoc::Markup::Document.new
342
+ begin
343
+ driver.add_method(doc, name)
344
+ rescue RDoc::RI::Driver::NotFoundError
345
+ doc = nil
346
+ end
347
+ end
348
+ return nil if doc.nil?
349
+ formatter = RDoc::Markup::ToAnsi.new
350
+ formatter.width = 40
351
+ str = doc.accept(formatter)
352
+
353
+ [Reline::CursorPos.new(cursor_pos_to_render.x + 40, cursor_pos_to_render.y + pointer), str.split("\n"), nil, '49']
354
+ }
355
+
311
356
  # Reads the next line from this input method.
312
357
  #
313
358
  # See IO#gets for more information.
@@ -316,6 +361,7 @@ module IRB
316
361
  Reline.output = @stdout
317
362
  Reline.prompt_proc = @prompt_proc
318
363
  Reline.auto_indent_proc = @auto_indent_proc if @auto_indent_proc
364
+ Reline.add_dialog_proc(:show_doc, SHOW_DOC_DIALOG, Reline::DEFAULT_DIALOG_CONTEXT)
319
365
  if l = readmultiline(@prompt, false, &@check_termination_proc)
320
366
  HISTORY.push(l) if !l.empty?
321
367
  @line[@line_no += 1] = l + "\n"
data/lib/irb/version.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #
12
12
 
13
13
  module IRB # :nodoc:
14
- VERSION = "1.3.7"
14
+ VERSION = "1.3.8.pre.1"
15
15
  @RELEASE_VERSION = VERSION
16
- @LAST_UPDATE_DATE = "2021-08-12"
16
+ @LAST_UPDATE_DATE = "2021-08-29"
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.3.7
4
+ version: 1.3.8.pre.1
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-08-12 00:00:00.000000000 Z
11
+ date: 2021-08-29 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.7
19
+ version: 0.2.8.pre.1
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.7
26
+ version: 0.2.8.pre.1
27
27
  description: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
28
28
  email:
29
29
  - keiju@ruby-lang.org
@@ -108,9 +108,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  version: '2.5'
109
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ">="
111
+ - - ">"
112
112
  - !ruby/object:Gem::Version
113
- version: '0'
113
+ version: 1.3.1
114
114
  requirements: []
115
115
  rubygems_version: 3.2.22
116
116
  signing_key: