irb 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +4 -0
- data/irb.gemspec +2 -2
- data/lib/irb/cmd/chws.rb +4 -2
- data/lib/irb/cmd/fork.rb +5 -2
- data/lib/irb/cmd/help.rb +4 -2
- data/lib/irb/cmd/info.rb +4 -2
- data/lib/irb/cmd/load.rb +3 -2
- data/lib/irb/cmd/ls.rb +4 -2
- data/lib/irb/cmd/measure.rb +4 -2
- data/lib/irb/cmd/nop.rb +4 -2
- data/lib/irb/cmd/pushws.rb +4 -2
- data/lib/irb/cmd/show_source.rb +4 -2
- data/lib/irb/cmd/subirb.rb +4 -2
- data/lib/irb/cmd/whereami.rb +4 -2
- data/lib/irb/color.rb +42 -29
- data/lib/irb/color_printer.rb +4 -1
- data/lib/irb/completion.rb +37 -8
- data/lib/irb/context.rb +21 -17
- data/lib/irb/ext/multi-irb.rb +0 -1
- data/lib/irb/ext/save-history.rb +3 -3
- data/lib/irb/extend-command.rb +25 -25
- data/lib/irb/init.rb +12 -4
- data/lib/irb/input-method.rb +20 -7
- data/lib/irb/inspector.rb +3 -11
- data/lib/irb/lc/error.rb +4 -7
- data/lib/irb/lc/help-message +43 -53
- data/lib/irb/lc/ja/encoding_aliases.rb +4 -2
- data/lib/irb/lc/ja/error.rb +4 -7
- data/lib/irb/lc/ja/help-message +0 -12
- data/lib/irb/ruby-lex.rb +24 -36
- data/lib/irb/version.rb +2 -2
- data/lib/irb/workspace.rb +6 -13
- data/lib/irb.rb +11 -59
- metadata +5 -3
data/lib/irb.rb
CHANGED
@@ -51,61 +51,17 @@ require_relative "irb/easter-egg"
|
|
51
51
|
#
|
52
52
|
# == Command line options
|
53
53
|
#
|
54
|
-
#
|
55
|
-
# -f Suppress read of ~/.irbrc
|
56
|
-
# -d Set $DEBUG to true (same as `ruby -d')
|
57
|
-
# -r load-module Same as `ruby -r'
|
58
|
-
# -I path Specify $LOAD_PATH directory
|
59
|
-
# -U Same as `ruby -U`
|
60
|
-
# -E enc Same as `ruby -E`
|
61
|
-
# -w Same as `ruby -w`
|
62
|
-
# -W[level=2] Same as `ruby -W`
|
63
|
-
# --context-mode n Set n[0-4] to method to create Binding Object,
|
64
|
-
# when new workspace was created
|
65
|
-
# --extra-doc-dir Add an extra doc dir for the doc dialog
|
66
|
-
# --echo Show result (default)
|
67
|
-
# --noecho Don't show result
|
68
|
-
# --echo-on-assignment
|
69
|
-
# Show result on assignment
|
70
|
-
# --noecho-on-assignment
|
71
|
-
# Don't show result on assignment
|
72
|
-
# --truncate-echo-on-assignment
|
73
|
-
# Show truncated result on assignment (default)
|
74
|
-
# --inspect Use `inspect' for output
|
75
|
-
# --noinspect Don't use inspect for output
|
76
|
-
# --multiline Use multiline editor module
|
77
|
-
# --nomultiline Don't use multiline editor module
|
78
|
-
# --singleline Use singleline editor module
|
79
|
-
# --nosingleline Don't use singleline editor module
|
80
|
-
# --colorize Use colorization
|
81
|
-
# --nocolorize Don't use colorization
|
82
|
-
# --autocomplete Use autocompletion
|
83
|
-
# --noautocomplete Don't use autocompletion
|
84
|
-
# --prompt prompt-mode/--prompt-mode prompt-mode
|
85
|
-
# Switch prompt mode. Pre-defined prompt modes are
|
86
|
-
# `default', `simple', `xmp' and `inf-ruby'
|
87
|
-
# --inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs.
|
88
|
-
# Suppresses --multiline and --singleline.
|
89
|
-
# --sample-book-mode/--simple-prompt
|
90
|
-
# Simple prompt mode
|
91
|
-
# --noprompt No prompt mode
|
92
|
-
# --single-irb Share self with sub-irb.
|
93
|
-
# --tracer Display trace for each execution of commands.
|
94
|
-
# --back-trace-limit n
|
95
|
-
# Display backtrace top n and tail n. The default
|
96
|
-
# value is 16.
|
97
|
-
# --verbose Show details
|
98
|
-
# --noverbose Don't show details
|
99
|
-
# -v, --version Print the version of irb
|
100
|
-
# -h, --help Print help
|
101
|
-
# -- Separate options of irb from the list of command-line args
|
54
|
+
# :include: ./irb/lc/help-message
|
102
55
|
#
|
103
56
|
# == Configuration
|
104
57
|
#
|
105
|
-
# IRB reads
|
106
|
-
#
|
107
|
-
# If <code>~/.irbrc</code> doesn't exist, +irb+ will try to read in the following order:
|
58
|
+
# IRB reads a personal initialization file when it's invoked.
|
59
|
+
# IRB searches a file in the following order and loads the first one found.
|
108
60
|
#
|
61
|
+
# * <tt>$IRBRC</tt> (if <tt>$IRBRC</tt> is set)
|
62
|
+
# * <tt>$XDG_CONFIG_HOME/irb/irbrc</tt> (if <tt>$XDG_CONFIG_HOME</tt> is set)
|
63
|
+
# * <tt>~/.irbrc</tt>
|
64
|
+
# * +.config/irb/irbrc+
|
109
65
|
# * +.irbrc+
|
110
66
|
# * +irb.rc+
|
111
67
|
# * +_irbrc+
|
@@ -433,11 +389,7 @@ module IRB
|
|
433
389
|
#
|
434
390
|
# Will raise an Abort exception, or the given +exception+.
|
435
391
|
def IRB.irb_abort(irb, exception = Abort)
|
436
|
-
|
437
|
-
irb.context.thread.raise exception, "abort then interrupt!"
|
438
|
-
else
|
439
|
-
raise exception, "abort then interrupt!"
|
440
|
-
end
|
392
|
+
irb.context.thread.raise exception, "abort then interrupt!"
|
441
393
|
end
|
442
394
|
|
443
395
|
class Irb
|
@@ -825,11 +777,11 @@ module IRB
|
|
825
777
|
if diff_size.positive? and output_width > winwidth
|
826
778
|
lines, _ = Reline::Unicode.split_by_width(first_line, winwidth - diff_size - 3)
|
827
779
|
str = "%s..." % lines.first
|
828
|
-
str += "\e[0m" if
|
780
|
+
str += "\e[0m" if Color.colorable?
|
829
781
|
multiline_p = false
|
830
782
|
else
|
831
783
|
str = str.gsub(/(\A.*?\n).*/m, "\\1...")
|
832
|
-
str += "\e[0m" if
|
784
|
+
str += "\e[0m" if Color.colorable?
|
833
785
|
end
|
834
786
|
else
|
835
787
|
output_width = Reline::Unicode.calculate_width(@context.return_format % str, true)
|
@@ -837,7 +789,7 @@ module IRB
|
|
837
789
|
if diff_size.positive? and output_width > winwidth
|
838
790
|
lines, _ = Reline::Unicode.split_by_width(str, winwidth - diff_size - 3)
|
839
791
|
str = "%s..." % lines.first
|
840
|
-
str += "\e[0m" if
|
792
|
+
str += "\e[0m" if Color.colorable?
|
841
793
|
end
|
842
794
|
end
|
843
795
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- aycabta
|
7
8
|
- Keiju ISHITSUKA
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: reline
|
@@ -26,6 +27,7 @@ dependencies:
|
|
26
27
|
version: 0.3.0
|
27
28
|
description: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
|
28
29
|
email:
|
30
|
+
- aycabta@gmail.com
|
29
31
|
- keiju@ruby-lang.org
|
30
32
|
executables:
|
31
33
|
- irb
|
@@ -112,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
114
|
- !ruby/object:Gem::Version
|
113
115
|
version: '0'
|
114
116
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
117
|
+
rubygems_version: 3.4.0.dev
|
116
118
|
signing_key:
|
117
119
|
specification_version: 4
|
118
120
|
summary: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
|