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 +4 -4
- data/irb.gemspec +1 -1
- data/lib/irb/input-method.rb +46 -0
- data/lib/irb/version.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ac31009e423fdea5f0151f5b48e3199dc98427484d5465088e1a9e0bac88fd
|
4
|
+
data.tar.gz: 180d9637906858acb3abba279ee49934d397979da0f4e9e7fab373c4d7313d4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89acce9899ac0fefa699639a514ada88bb2b9e3c18e3a1b5f83e139800d99b18445269ef5703b45c794f69a186c99cfd4f02fbfd24a883ed2164c9d1eacceb21
|
7
|
+
data.tar.gz: a16a4ba0f9505da943a29a6138b29b8d92e9fff6cad5fcea14ca3666095d0e02b467eaaf83eb425b4da4971c047b10eab73ba28bde5794d2e46f58d67476a182
|
data/irb.gemspec
CHANGED
data/lib/irb/input-method.rb
CHANGED
@@ -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
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.
|
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-
|
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.
|
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.
|
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:
|
113
|
+
version: 1.3.1
|
114
114
|
requirements: []
|
115
115
|
rubygems_version: 3.2.22
|
116
116
|
signing_key:
|