irb 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/irb.rb CHANGED
@@ -51,61 +51,17 @@ require_relative "irb/easter-egg"
51
51
  #
52
52
  # == Command line options
53
53
  #
54
- # Usage: irb.rb [options] [programfile] [arguments]
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 from <code>~/.irbrc</code> when it's invoked.
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
- if defined? Thread
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 @context.use_colorize
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 @context.use_colorize
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 @context.use_colorize
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.1
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: 2021-12-25 00:00:00.000000000 Z
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.2.22
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).