irb 1.15.3 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/doc/COMMAND_LINE_OPTIONS.md +1 -1
- data/doc/Configurations.md +4 -5
- data/doc/irb/irb.rd.ja +1 -1
- data/lib/irb/context.rb +8 -7
- data/lib/irb/ext/multi-irb.rb +2 -0
- data/lib/irb/lc/help-message +2 -2
- data/lib/irb/lc/ja/help-message +1 -1
- data/lib/irb/source_finder.rb +6 -3
- data/lib/irb/version.rb +2 -2
- data/lib/irb/workspace.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ab1ed5aa7bab885e57c409b5267ae77c02dd4dfce34fe1099bf2407c0f78c82
|
|
4
|
+
data.tar.gz: 84b33ebb88359bc8eea1480f08f46b930e2e18e350121f9cf06934d3b51f631e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ce74e4d4954c7606b2b74f5a7138e5c4e21690a819d63256c21ed2f6f05d077355ab59b9fa91407beec6e5db74d2b117b6dd434805aae53878041fd871c123f
|
|
7
|
+
data.tar.gz: d1fcf2223fdda3720fcc2c2d0e6d980e8b16a204ad6c31b503002e19047eb70b4f385b902de2dc6d6a5d7471a731371e8c99e86df1f02a3d975d639e74fda657
|
data/Gemfile
CHANGED
data/doc/COMMAND_LINE_OPTIONS.md
CHANGED
|
@@ -21,7 +21,7 @@ These are the IRB command-line options, with links to explanatory text:
|
|
|
21
21
|
- `--colorize`: Use {color-highlighting}[rdoc-ref:IRB@Color+Highlighting]
|
|
22
22
|
for input and output.
|
|
23
23
|
- `--context-mode _n_`: Select method to create Binding object
|
|
24
|
-
for new {workspace}[rdoc-ref:IRB@Commands]; `n` in range `0..
|
|
24
|
+
for new {workspace}[rdoc-ref:IRB@Commands]; `n` in range `0..5`.
|
|
25
25
|
- `--echo`: Print ({echo}[rdoc-ref:IRB@Return-Value+Printing+-28Echoing-29])
|
|
26
26
|
return values.
|
|
27
27
|
- `--extra-doc-dir _dirpath_`:
|
data/doc/Configurations.md
CHANGED
|
@@ -16,11 +16,10 @@ IRB searches for a configuration file in the following order:
|
|
|
16
16
|
1. `$IRBRC`
|
|
17
17
|
2. `$XDG_CONFIG_HOME/irb/irbrc`
|
|
18
18
|
3. `$HOME/.irbrc`
|
|
19
|
-
4. `$HOME/.config/irb/irbrc`
|
|
19
|
+
4. `$HOME/.config/irb/irbrc` (only if `XDG_CONFIG_HOME` is _not_ set)
|
|
20
20
|
5. `.irbrc` in the current directory
|
|
21
|
-
6. `
|
|
22
|
-
7. `
|
|
23
|
-
8. `$irbrc` in the current directory
|
|
21
|
+
6. `_irbrc` in the current directory
|
|
22
|
+
7. `$irbrc` in the current directory
|
|
24
23
|
|
|
25
24
|
If the `-f` command-line option is used, no configuration file is loaded.
|
|
26
25
|
|
|
@@ -34,7 +33,7 @@ Method `conf.rc?` returns `true` if a configuration file was read, `false` other
|
|
|
34
33
|
- `IRB_COPY_COMMAND`: Overrides the default program used to interface with the system clipboard.
|
|
35
34
|
- `VISUAL` / `EDITOR`: Specifies the editor for the `edit` command.
|
|
36
35
|
- `IRBRC`: Specifies the rc-file for configuration.
|
|
37
|
-
- `XDG_CONFIG_HOME`: Used to locate the rc-file
|
|
36
|
+
- `XDG_CONFIG_HOME`: Used to locate the user-specific rc-file (i.e. `$XDG_CONFIG_HOME/irb/irbrc` instead of `$HOME/.config/irb/irbrc`).
|
|
38
37
|
- `RI_PAGER` / `PAGER`: Specifies the pager for documentation.
|
|
39
38
|
- `IRB_LANG`, `LC_MESSAGES`, `LC_ALL`, `LANG`: Determines the locale.
|
|
40
39
|
|
data/doc/irb/irb.rd.ja
CHANGED
|
@@ -48,7 +48,7 @@ irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本
|
|
|
48
48
|
-w ruby -w と同じ.
|
|
49
49
|
-W[level=2] ruby -W と同じ.
|
|
50
50
|
--context-mode n 新しいワークスペースを作成した時に関連する Binding
|
|
51
|
-
オブジェクトの作成方法を 0 から
|
|
51
|
+
オブジェクトの作成方法を 0 から 5 のいずれかに設定する.
|
|
52
52
|
--echo 実行結果を表示する(デフォルト).
|
|
53
53
|
--noecho 実行結果を表示しない.
|
|
54
54
|
--echo-on-assignment
|
data/lib/irb/context.rb
CHANGED
|
@@ -632,14 +632,15 @@ module IRB
|
|
|
632
632
|
command_class = Command.load_command(command)
|
|
633
633
|
end
|
|
634
634
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
635
|
+
if command_class
|
|
636
|
+
# Check whether the command conflicts with existing methods
|
|
637
|
+
public_method = !!KERNEL_PUBLIC_METHOD.bind_call(main, command) rescue false
|
|
638
|
+
private_method = !public_method && !!KERNEL_METHOD.bind_call(main, command) rescue false
|
|
639
|
+
if Command.execute_as_command?(command, public_method: public_method, private_method: private_method)
|
|
640
|
+
return Statement::Command.new(code, command_class, arg)
|
|
641
|
+
end
|
|
642
642
|
end
|
|
643
|
+
Statement::Expression.new(code, is_assignment_expression)
|
|
643
644
|
end
|
|
644
645
|
|
|
645
646
|
def colorize_input(input, complete:)
|
data/lib/irb/ext/multi-irb.rb
CHANGED
|
@@ -65,6 +65,7 @@ module IRB
|
|
|
65
65
|
@current_job = irb
|
|
66
66
|
th.run
|
|
67
67
|
Thread.stop
|
|
68
|
+
Thread.pass
|
|
68
69
|
@current_job = irb(Thread.current)
|
|
69
70
|
end
|
|
70
71
|
|
|
@@ -220,6 +221,7 @@ module IRB
|
|
|
220
221
|
end
|
|
221
222
|
end
|
|
222
223
|
Thread.stop
|
|
224
|
+
Thread.pass
|
|
223
225
|
@JobManager.current_job = @JobManager.irb(Thread.current)
|
|
224
226
|
end
|
|
225
227
|
|
data/lib/irb/lc/help-message
CHANGED
|
@@ -6,10 +6,10 @@ Usage: irb.rb [options] [programfile] [arguments]
|
|
|
6
6
|
-U Set external and internal encodings to UTF-8.
|
|
7
7
|
-E ex[:in] Set default external (ex) and internal (in) encodings
|
|
8
8
|
(same as 'ruby -E').
|
|
9
|
-
-w
|
|
9
|
+
-w Enable warnings (same as 'ruby -w' or 'ruby -W1').
|
|
10
10
|
-W[level=2] Set warning level: 0=silence, 1=medium, 2=verbose
|
|
11
11
|
(same as 'ruby -W').
|
|
12
|
-
--context-mode n Set n[0-
|
|
12
|
+
--context-mode n Set n[0-5] to method to create Binding Object,
|
|
13
13
|
when new workspace was created.
|
|
14
14
|
--extra-doc-dir Add an extra doc dir for the doc dialog.
|
|
15
15
|
--echo Show result (default).
|
data/lib/irb/lc/ja/help-message
CHANGED
|
@@ -8,7 +8,7 @@ Usage: irb.rb [options] [programfile] [arguments]
|
|
|
8
8
|
-w ruby -w と同じ.
|
|
9
9
|
-W[level=2] ruby -W と同じ.
|
|
10
10
|
--context-mode n 新しいワークスペースを作成した時に関連する Binding
|
|
11
|
-
オブジェクトの作成方法を 0 から
|
|
11
|
+
オブジェクトの作成方法を 0 から 5 のいずれかに設定する.
|
|
12
12
|
--extra-doc-dir 指定したディレクトリのドキュメントを追加で読み込む.
|
|
13
13
|
--echo 実行結果を表示する(デフォルト).
|
|
14
14
|
--noecho 実行結果を表示しない.
|
data/lib/irb/source_finder.rb
CHANGED
|
@@ -29,10 +29,13 @@ module IRB
|
|
|
29
29
|
|
|
30
30
|
def colorized_content
|
|
31
31
|
if !binary_file? && file_exist?
|
|
32
|
-
end_line = find_end
|
|
33
32
|
# To correctly colorize, we need to colorize full content and extract the relevant lines.
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
colored_lines = IRB::Color.colorize_code(file_content).lines
|
|
34
|
+
|
|
35
|
+
# Handle wrong line number case: line_no passed to eval is wrong, file is edited after load, etc
|
|
36
|
+
return if colored_lines.size < @line
|
|
37
|
+
|
|
38
|
+
colored_lines[@line - 1...find_end].join
|
|
36
39
|
elsif @ast_source
|
|
37
40
|
IRB::Color.colorize_code(@ast_source)
|
|
38
41
|
end
|
data/lib/irb/version.rb
CHANGED
data/lib/irb/workspace.rb
CHANGED
|
@@ -55,6 +55,15 @@ EOF
|
|
|
55
55
|
# Note that this will typically be IRB::TOPLEVEL_BINDING
|
|
56
56
|
# This is to avoid RubyGems' local variables (see issue #17623)
|
|
57
57
|
@binding = TOPLEVEL_BINDING.dup
|
|
58
|
+
|
|
59
|
+
when 5 # binding in Ruby::Box
|
|
60
|
+
unless defined?(Ruby::Box)
|
|
61
|
+
puts 'Context-mode 5 (binding in Ruby::Box) requires Ruby 4.0 or later.'
|
|
62
|
+
raise NameError, 'Ruby::Box not defined'
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
puts 'Context-mode 5 (binding in Ruby::Box) is experimental. It may be removed or changed without notice.'
|
|
66
|
+
@binding = Ruby::Box.new.eval('Kernel.binding')
|
|
58
67
|
end
|
|
59
68
|
end
|
|
60
69
|
|