irb 1.14.3 → 1.15.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f1a9b1cbe12db08853604fff0b28f7b66ae1e724d54580ce507e15feb9e0f63
4
- data.tar.gz: ce18f088328360ab8d39c4c3902984f0110e704b5a6d953e171d8d35c7b545a8
3
+ metadata.gz: 7c3e1957674939d29308f3f534aa65b0a85557c1b7cd47ca6709fef260486eba
4
+ data.tar.gz: f60b6b8752639425dc0e8aec1443fdc88b82c9799e6c71edf4dd88945efbbd23
5
5
  SHA512:
6
- metadata.gz: a3a46b3c4b9b03dd97175f71cb1a41b02482b996f63b98fa1128c91e741dd17eff1c5af6d314c6756050f4b0e92c398aed1a3ad7adac035d1df0c266e8bd8de0
7
- data.tar.gz: 57a389d3e32a394e256beb720d9e124f0f48d9bddb26cc8f4913eba2bb7cdd258f30cda97c87cc3bd028f0501d6247a9cbc97eff7279652805d65cdadef67d4c
6
+ metadata.gz: fc15c91bd69233b5cbe962cec327c918805db5553c81c4ba450836d626ab56a3745fd04ca4e185470434bd1e69fe94bab9536bf3bf4704538bbf39681b2291ac
7
+ data.tar.gz: 4b655b0a770eb2524757b8033e5796892dd43944ee7157dd7523f31d4fe6ffe6fed49ca281faa4990ba2c0dd014e662b1fc54445ee80ea5aa135cf097102d005
data/.rdoc_options ADDED
@@ -0,0 +1,5 @@
1
+ page_dir: doc
2
+ warn_missing_rdoc_ref: true
3
+
4
+ autolink_excluded_words:
5
+ - IRB
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,52 @@
1
+ # Contributing to IRB
2
+
3
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/ruby/irb](https://github.com/ruby/irb).
4
+
5
+ ## Set up the environment
6
+
7
+ 1. Fork the project to your GitHub account.
8
+ 2. Clone the fork with `git clone git@github.com:[your_username]/irb.git`.
9
+ 3. Run `bundle install`.
10
+ 4. Run `bundle exec rake` to make sure tests pass locally.
11
+
12
+ ## Run integration tests
13
+
14
+ If your changes affect component rendering, such as the autocompletion's dialog/dropdown, you may need to run IRB's integration tests, known as `yamatanooroti`.
15
+
16
+ Before running these tests, ensure that you have `libvterm` installed. If you're using Homebrew, you can install it by running:
17
+
18
+ ```bash
19
+ brew install libvterm
20
+ ```
21
+
22
+ After installing `libvterm`, you can run the integration tests using the following commands:
23
+
24
+ ```bash
25
+ WITH_VTERM=1 bundle install
26
+ WITH_VTERM=1 bundle exec rake test test_yamatanooroti
27
+ ```
28
+
29
+ ## Update documentation
30
+
31
+ IRB's documentation is generated by [RDoc](https://ruby.github.io/rdoc/) and published to [ruby.github.io/irb](https://ruby.github.io/irb/). Most of the documentation source lives under the `doc/` directory.
32
+
33
+ Run the following command to generate the documentation site locally.
34
+
35
+ ```bash
36
+ bundle exec rake rdoc
37
+ bundle exec rake rerdoc # to force regeneration
38
+ ```
39
+
40
+ Follow the output message to open the documentation site in your browser.
41
+
42
+ > [!Note]
43
+ >
44
+ > Please ensure that the changes are rendered correctly on the documentation site.
45
+ > RDoc's Markdown support is limited, so the rendered result on GitHub might differ from what’s rendered on [https://ruby.github.io/irb](https://ruby.github.io/irb).
46
+
47
+ We welcome any improvements to the documentation, including:
48
+
49
+ - Fixing typos and grammatical errors.
50
+ - Adding missing documentation for features.
51
+ - Adding missing documentation for configuration options.
52
+ - Adding demo images/gifs for features.
data/EXTEND_IRB.md ADDED
@@ -0,0 +1,3 @@
1
+ # Extend IRB
2
+
3
+ This page has been moved to the [IRB Extension Guide](https://ruby.github.io/irb/EXTEND_IRB_md.html).
data/Gemfile CHANGED
@@ -22,6 +22,10 @@ gem "rubocop"
22
22
  gem "tracer" if !is_truffleruby
23
23
  gem "debug", github: "ruby/debug", platforms: [:mri, :mswin]
24
24
 
25
+ gem "rdoc", ">= 6.11.0"
26
+
25
27
  if RUBY_VERSION >= "3.0.0" && !is_truffleruby
28
+ # TODO: Remove this after rbs is released with tsort in its dependencies
29
+ gem "rbs", github: "ruby/rbs" if RUBY_VERSION >= "3.2"
26
30
  gem "repl_type_completor"
27
31
  end
data/README.md CHANGED
@@ -1,33 +1,14 @@
1
1
  # IRB
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/irb.svg)](https://badge.fury.io/rb/irb)
4
+ [![Static Badge](https://img.shields.io/badge/RDoc-flat?style=flat&label=documentation&link=https%3A%2F%2Fruby.github.io%2Firb%2F)](https://ruby.github.io/irb/)
4
5
  [![build](https://github.com/ruby/irb/actions/workflows/test.yml/badge.svg)](https://github.com/ruby/irb/actions/workflows/test.yml)
5
6
 
7
+
6
8
  IRB stands for "interactive Ruby" and is a tool to interactively execute Ruby expressions read from the standard input.
7
9
 
8
10
  The `irb` command from your shell will start the interpreter.
9
11
 
10
- - [Installation](#installation)
11
- - [Usage](#usage)
12
- - [The `irb` Executable](#the-irb-executable)
13
- - [The `binding.irb` Breakpoint](#the-bindingirb-breakpoint)
14
- - [Commands](#commands)
15
- - [Debugging with IRB](#debugging-with-irb)
16
- - [More about `debug.gem`](#more-about-debuggem)
17
- - [Advantages Over `debug.gem`'s Console](#advantages-over-debuggems-console)
18
- - [Type Based Completion](#type-based-completion)
19
- - [How to Enable IRB::TypeCompletor](#how-to-enable-irbtypecompletor)
20
- - [Advantage over Default IRB::RegexpCompletor](#advantage-over-default-irbregexpcompletor)
21
- - [Difference between Steep's Completion](#difference-between-steeps-completion)
22
- - [Configuration](#configuration)
23
- - [Environment Variables](#environment-variables)
24
- - [Documentation](#documentation)
25
- - [Extending IRB](#extending-irb)
26
- - [Development](#development)
27
- - [Contributing](#contributing)
28
- - [Releasing](#releasing)
29
- - [License](#license)
30
-
31
12
  ## Installation
32
13
 
33
14
  > [!Note]
@@ -58,7 +39,7 @@ $ gem install irb
58
39
 
59
40
  > [!Note]
60
41
  >
61
- > We're working hard to match Pry's variety of powerful features in IRB, and you can track our progress or find contribution ideas in [this document](https://github.com/ruby/irb/blob/master/COMPARED_WITH_PRY.md).
42
+ > We're working hard to match Pry's variety of powerful features in IRB, and you can track our progress or find contribution ideas in [this document](https://ruby.github.io/irb/COMPARED_WITH_PRY_md.html).
62
43
 
63
44
  ### The `irb` Executable
64
45
 
@@ -105,310 +86,32 @@ irb(main):002:0> exit
105
86
  Hello World
106
87
  ```
107
88
 
108
- ## Commands
109
-
110
- The following commands are available on IRB. You can get the same output from the `help` command.
111
-
112
- ```txt
113
- Help
114
- help List all available commands. Use `help <command>` to get information about a specific command.
115
-
116
- IRB
117
- context Displays current configuration.
118
- exit Exit the current irb session.
119
- exit! Exit the current process.
120
- irb_load Load a Ruby file.
121
- irb_require Require a Ruby file.
122
- source Loads a given file in the current session.
123
- irb_info Show information about IRB.
124
- history Shows the input history. `-g [query]` or `-G [query]` allows you to filter the output.
125
- disable_irb Disable binding.irb.
126
-
127
- Workspace
128
- cwws Show the current workspace.
129
- chws Change the current workspace to an object.
130
- workspaces Show workspaces.
131
- pushws Push an object to the workspace stack.
132
- popws Pop a workspace from the workspace stack.
133
- cd Move into the given object or leave the current context.
134
-
135
- Multi-irb (DEPRECATED)
136
- irb Start a child IRB.
137
- jobs List of current sessions.
138
- fg Switches to the session of the given number.
139
- kill Kills the session with the given number.
140
-
141
- Debugging
142
- debug Start the debugger of debug.gem.
143
- break Start the debugger of debug.gem and run its `break` command.
144
- catch Start the debugger of debug.gem and run its `catch` command.
145
- next Start the debugger of debug.gem and run its `next` command.
146
- delete Start the debugger of debug.gem and run its `delete` command.
147
- step Start the debugger of debug.gem and run its `step` command.
148
- continue Start the debugger of debug.gem and run its `continue` command.
149
- finish Start the debugger of debug.gem and run its `finish` command.
150
- backtrace Start the debugger of debug.gem and run its `backtrace` command.
151
- info Start the debugger of debug.gem and run its `info` command.
152
-
153
- Misc
154
- edit Open a file or source location.
155
- measure `measure` enables the mode to measure processing time. `measure :off` disables it.
156
-
157
- Context
158
- show_doc Look up documentation with RI.
159
- ls Show methods, constants, and variables.
160
- show_source Show the source code of a given method, class/module, or constant.
161
- whereami Show the source code around binding.irb again.
162
-
163
- Helper methods
164
- conf Returns the current IRB context.
165
-
166
- Aliases
167
- $ Alias for `show_source`
168
- @ Alias for `whereami`
169
- ```
170
-
171
- ## Debugging with IRB
172
-
173
- ### Getting Started
174
-
175
- - In `binding.irb`, use the `debug` command to start a `irb:rdbg` session with access to all `debug.gem` commands.
176
- - Use `RUBY_DEBUG_IRB_CONSOLE=1` environment variable to make `debug.gem` use IRB as the debugging console.
177
-
178
- ### Details
179
-
180
- Starting from version 1.8.0, IRB boasts a powerful integration with `debug.gem`, providing a debugging experience akin to `pry-byebug`.
181
-
182
- After hitting a `binding.irb` breakpoint, you can activate the debugger with the `debug` command. Alternatively, if the `debug` method happens to already be defined in the current scope, you can call `irb_debug`.
183
-
184
- ```shell
185
- From: test.rb @ line 3 :
186
-
187
- 1:
188
- 2: def greet(word)
189
- => 3: binding.irb
190
- 4: puts "Hello #{word}"
191
- 5: end
192
- 6:
193
- 7: greet("World")
194
-
195
- irb(main):001> debug
196
- irb:rdbg(main):002>
197
- ```
198
-
199
- Once activated, the prompt's header changes from `irb` to `irb:rdbg`, enabling you to use any of `debug.gem`'s [commands](https://github.com/ruby/debug#debug-command-on-the-debug-console):
200
-
201
- ```shell
202
- irb:rdbg(main):002> info # use info command to see available variables
203
- %self = main
204
- _ = nil
205
- word = "World"
206
- irb:rdbg(main):003> next # use next command to move to the next line
207
- [1, 7] in test.rb
208
- 1|
209
- 2| def greet(word)
210
- 3| binding.irb
211
- => 4| puts "Hello #{word}"
212
- 5| end
213
- 6|
214
- 7| greet("World")
215
- =>#0 Object#greet(word="World") at test.rb:4
216
- #1 <main> at test.rb:7
217
- irb:rdbg(main):004>
218
- ```
219
-
220
- Simultaneously, you maintain access to IRB's commands, such as `show_source`:
221
-
222
- ```shell
223
- irb:rdbg(main):004> show_source greet
224
-
225
- From: test.rb:2
226
-
227
- def greet(word)
228
- binding.irb
229
- puts "Hello #{word}"
230
- end
231
- ```
232
-
233
- ### More about `debug.gem`
89
+ ### Debugging
234
90
 
235
- `debug.gem` offers many advanced debugging features that simple REPLs can't provide, including:
91
+ You can use IRB as a debugging console with `debug.gem` with these options:
236
92
 
237
- - Step-debugging
238
- - Frame navigation
239
- - Setting breakpoints with commands
240
- - Thread control
241
- - ...and many more
93
+ - In `binding.irb`, use the `debug` command to start an `irb:rdbg` session with access to all `debug.gem` commands.
94
+ - Use the `RUBY_DEBUG_IRB_CONSOLE=1` environment variable to make `debug.gem` use IRB as the debugging console.
242
95
 
243
- To learn about these features, please refer to `debug.gem`'s [commands list](https://github.com/ruby/debug#debug-command-on-the-debug-console).
244
-
245
- In the `irb:rdbg` session, the `help` command will also display all commands from `debug.gem`.
246
-
247
- ### Advantages Over `debug.gem`'s Console
248
-
249
- This integration offers several benefits over `debug.gem`'s native console:
250
-
251
- 1. Access to handy IRB commands like `show_source` or `show_doc`.
252
- 2. Support for multi-line input.
253
- 3. Symbol shortcuts such as `@` (`whereami`) and `$` (`show_source`).
254
- 4. Autocompletion.
255
- 5. Customizable prompt.
256
-
257
- However, there are also some limitations to be aware of:
258
-
259
- 1. `binding.irb` doesn't support `pre` and `do` arguments like [`binding.break`](https://github.com/ruby/debug#bindingbreak-method).
260
- 2. As IRB [doesn't currently support remote-connection](https://github.com/ruby/irb/issues/672), it can't be used with `debug.gem`'s remote debugging feature.
261
- 3. Access to the previous return value via the underscore `_` is not supported.
262
-
263
- ## Type Based Completion
264
-
265
- IRB's default completion `IRB::RegexpCompletor` uses Regexp. IRB has another experimental completion `IRB::TypeCompletor` that uses type analysis.
266
-
267
- ### How to Enable IRB::TypeCompletor
268
-
269
- Install [ruby/repl_type_completor](https://github.com/ruby/repl_type_completor/) with:
270
- ```
271
- $ gem install repl_type_completor
272
- ```
273
- Or add these lines to your project's Gemfile.
274
- ```ruby
275
- gem 'irb'
276
- gem 'repl_type_completor', group: [:development, :test]
277
- ```
278
-
279
- Now you can use type based completion by:
280
-
281
- Running IRB with the `--type-completor` option
282
- ```
283
- $ irb --type-completor
284
- ```
285
-
286
- Or writing this line to IRB's rc-file (e.g. `~/.irbrc`)
287
- ```ruby
288
- IRB.conf[:COMPLETOR] = :type # default is :regexp
289
- ```
96
+ To learn more about debugging with IRB, see [Debugging with IRB](https://ruby.github.io/irb/#label-Debugging+with+IRB).
290
97
 
291
- Or setting the environment variable `IRB_COMPLETOR`
292
- ```ruby
293
- ENV['IRB_COMPLETOR'] = 'type'
294
- IRB.start
295
- ```
296
-
297
- To check if it's enabled, type `irb_info` into IRB and see the `Completion` section.
298
- ```
299
- irb(main):001> irb_info
300
- ...
301
- # Enabled
302
- Completion: Autocomplete, ReplTypeCompletor: 0.1.0, Prism: 0.18.0, RBS: 3.3.0
303
- # Not enabled
304
- Completion: Autocomplete, RegexpCompletor
305
- ...
306
- ```
307
- If you have `sig/` directory or `rbs_collection.lock.yaml` in current directory, IRB will load it.
308
-
309
- ### Advantage over Default IRB::RegexpCompletor
310
-
311
- IRB::TypeCompletor can autocomplete chained methods, block parameters and more if type information is available.
312
- These are some examples IRB::RegexpCompletor cannot complete.
313
-
314
- ```ruby
315
- irb(main):001> 'Ruby'.upcase.chars.s # Array methods (sample, select, shift, size)
316
- ```
317
-
318
- ```ruby
319
- irb(main):001> 10.times.map(&:to_s).each do |s|
320
- irb(main):002> s.up # String methods (upcase, upcase!, upto)
321
- ```
322
-
323
- ```ruby
324
- irb(main):001> class User < ApplicationRecord
325
- irb(main):002> def foo
326
- irb(main):003> sa # save, save!
327
- ```
328
-
329
- As a trade-off, completion calculation takes more time than IRB::RegexpCompletor.
330
-
331
- ### Difference between Steep's Completion
332
-
333
- Compared with Steep, IRB::TypeCompletor has some difference and limitations.
334
- ```ruby
335
- [0, 'a'].sample.
336
- # Steep completes intersection of Integer methods and String methods
337
- # IRB::TypeCompletor completes both Integer and String methods
338
- ```
339
-
340
- Some features like type narrowing is not implemented.
341
- ```ruby
342
- def f(arg = [0, 'a'].sample)
343
- if arg.is_a?(String)
344
- arg. # Completes both Integer and String methods
345
- ```
98
+ ## Documentation
346
99
 
347
- Unlike other static type checker, IRB::TypeCompletor uses runtime information to provide better completion.
348
- ```ruby
349
- irb(main):001> a = [1]
350
- => [1]
351
- irb(main):002> a.first. # Completes Integer methods
352
- ```
100
+ https://ruby.github.io/irb/ provides a comprehensive guide to IRB's features and usage.
353
101
 
354
102
  ## Configuration
355
103
 
356
- ### Environment Variables
357
-
358
- - `NO_COLOR`: Assigning a value to it disables IRB's colorization.
359
- - `IRB_USE_AUTOCOMPLETE`: Setting it to `false` disables IRB's autocompletion.
360
- - `IRB_COMPLETOR`: Configures IRB's auto-completion behavior, allowing settings for either `regexp` or `type`.
361
- - `VISUAL`: Its value would be used to open files by the `edit` command.
362
- - `EDITOR`: Its value would be used to open files by the `edit` command if `VISUAL` is unset.
363
- - `IRBRC`: The file specified would be evaluated as IRB's rc-file.
364
- - `XDG_CONFIG_HOME`: If it is set and `IRBRC` is unset, the file `$XDG_CONFIG_HOME/irb/irbrc` would be evaluated as IRB's rc-file.
365
- - `RI_PAGER`: The command specified would be used as a pager.
366
- - `PAGER`: The command specified would be used as a pager if `RI_PAGER` is unset.
367
- - `IRB_LANG`, `LC_MESSAGES`, `LC_ALL`, `LANG`: The first of these that is set would be used as the locale value.
368
-
369
- ## Documentation
370
-
371
- https://ruby.github.io/irb/
104
+ See the [Configuration page](https://ruby.github.io/irb/Configurations_md.html) in the documentation.
372
105
 
373
106
  ## Extending IRB
374
107
 
375
108
  IRB `v1.13.0` and later versions allows users/libraries to extend its functionality through official APIs.
376
109
 
377
- For more information, please visit [EXTEND_IRB.md](./EXTEND_IRB.md).
378
-
379
- ## Development
380
-
381
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
382
-
383
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
110
+ For more information, please visit the [IRB Extension Guide](https://ruby.github.io/irb/EXTEND_IRB_md.html).
384
111
 
385
112
  ## Contributing
386
113
 
387
- Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/irb.
388
-
389
- ### Set up the environment
390
-
391
- 1. Fork the project to your GithHub account
392
- 2. Clone the fork with `git clone git@github.com:[your_username]/irb.git`
393
- 3. Run `bundle install`
394
- 4. Run `bundle exec rake` to make sure tests pass locally
395
-
396
- ### Run integration tests
397
-
398
- If your changes affect component rendering, such as the autocompletion's dialog/dropdown, you may need to run IRB's integration tests, known as `yamatanooroti`.
399
-
400
- Before running these tests, ensure that you have `libvterm` installed. If you're using Homebrew, you can install it by running:
401
-
402
- ```bash
403
- brew install libvterm
404
- ```
405
-
406
- After installing `libvterm`, you can run the integration tests using the following commands:
407
-
408
- ```bash
409
- WITH_VTERM=1 bundle install
410
- WITH_VTERM=1 bundle exec rake test test_yamatanooroti
411
- ```
114
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.
412
115
 
413
116
  ## Releasing
414
117
 
@@ -0,0 +1,69 @@
1
+ # Index of Command-Line Options
2
+
3
+ These are the IRB command-line options, with links to explanatory text:
4
+
5
+ - `-d`: Set `$DEBUG` and {$VERBOSE}[rdoc-ref:IRB@Verbosity]
6
+ to `true`.
7
+ - `-E _ex_[:_in_]`: Set initial external (ex) and internal (in)
8
+ {encodings}[rdoc-ref:IRB@Encodings] (same as `ruby -E`).
9
+ - `-f`: Don't initialize from {configuration file}[rdoc-ref:IRB@Configuration+File].
10
+ - `-I _dirpath_`: Specify {$LOAD_PATH directory}[rdoc-ref:IRB@Load+Modules]
11
+ (same as `ruby -I`).
12
+ - `-r _load-module_`: Require {load-module}[rdoc-ref:IRB@Load+Modules]
13
+ (same as `ruby -r`).
14
+ - `-U`: Set external and internal {encodings}[rdoc-ref:IRB@Encodings] to UTF-8.
15
+ - `-w`: Suppress {warnings}[rdoc-ref:IRB@Warnings] (same as `ruby -w`).
16
+ - `-W[_level_]`: Set {warning level}[rdoc-ref:IRB@Warnings];
17
+ 0=silence, 1=medium, 2=verbose (same as `ruby -W`).
18
+ - `--autocomplete`: Use {auto-completion}[rdoc-ref:IRB@Automatic+Completion].
19
+ - `--back-trace-limit _n_`: Set a {backtrace limit}[rdoc-ref:IRB@Tracer];
20
+ display at most the top `n` and bottom `n` entries.
21
+ - `--colorize`: Use {color-highlighting}[rdoc-ref:IRB@Color+Highlighting]
22
+ for input and output.
23
+ - `--context-mode _n_`: Select method to create Binding object
24
+ for new {workspace}[rdoc-ref:IRB@Commands]; `n` in range `0..4`.
25
+ - `--echo`: Print ({echo}[rdoc-ref:IRB@Return-Value+Printing+-28Echoing-29])
26
+ return values.
27
+ - `--extra-doc-dir _dirpath_`:
28
+ Add a {documentation directory}[rdoc-ref:IRB@RI+Documentation+Directories]
29
+ for the documentation dialog.
30
+ - `--inf-ruby-mode`: Set prompt mode to {:INF_RUBY}[rdoc-ref:IRB@Pre-Defined+Prompts]
31
+ (appropriate for `inf-ruby-mode` on Emacs);
32
+ suppresses --multiline and --singleline.
33
+ - `--inspect`: Use method `inspect` for printing ({echoing}[rdoc-ref:IRB@Return-Value+Printing+-28Echoing-29])
34
+ return values.
35
+ - `--multiline`: Use the multiline editor as the {input method}[rdoc-ref:IRB@Input+Method].
36
+ - `--noautocomplete`: Don't use {auto-completion}[rdoc-ref:IRB@Automatic+Completion].
37
+ - `--nocolorize`: Don't use {color-highlighting}[rdoc-ref:IRB@Color+Highlighting]
38
+ for input and output.
39
+ - `--noecho`: Don't print ({echo}[rdoc-ref:IRB@Return-Value+Printing+-28Echoing-29])
40
+ return values.
41
+ - `--noecho-on-assignment`: Don't print ({echo}[rdoc-ref:IRB@Return-Value+Printing+-28Echoing-29])
42
+ result on assignment.
43
+ - `--noinspect`: Don't se method `inspect` for printing ({echoing}[rdoc-ref:IRB@Return-Value+Printing+-28Echoing-29])
44
+ return values.
45
+ - `--nomultiline`: Don't use the multiline editor as the {input method}[rdoc-ref:IRB@Input+Method].
46
+ - `--noprompt`: Don't print {prompts}[rdoc-ref:IRB@Prompt+and+Return+Formats].
47
+ - `--noscript`: Treat the first command-line argument as a normal
48
+ {command-line argument}[rdoc-ref:IRB@Initialization+Script],
49
+ and include it in `ARGV`.
50
+ - `--nosingleline`: Don't use the singleline editor as the {input method}[rdoc-ref:IRB@Input+Method].
51
+ - `--noverbose`: Don't print {verbose}[rdoc-ref:IRB@Verbosity] details.
52
+ - `--prompt _mode_`, `--prompt-mode _mode_`:
53
+ Set {prompt and return formats}[rdoc-ref:IRB@Prompt+and+Return+Formats];
54
+ `mode` may be a {pre-defined prompt}[rdoc-ref:IRB@Pre-Defined+Prompts]
55
+ or the name of a {custom prompt}[rdoc-ref:IRB@Custom+Prompts].
56
+ - `--script`: Treat the first command-line argument as the path to an
57
+ {initialization script}[rdoc-ref:IRB@Initialization+Script],
58
+ and omit it from `ARGV`.
59
+ - `--simple-prompt`, `--sample-book-mode`:
60
+ Set prompt mode to {:SIMPLE}[rdoc-ref:IRB@Pre-Defined+Prompts].
61
+ - `--singleline`: Use the singleline editor as the {input method}[rdoc-ref:IRB@Input+Method].
62
+ - `--tracer`: Use {Tracer}[rdoc-ref:IRB@Tracer] to print a stack trace for each input command.
63
+ - `--truncate-echo-on-assignment`: Print ({echo}[rdoc-ref:IRB@Return-Value+Printing+-28Echoing-29])
64
+ truncated result on assignment.
65
+ - `--verbose`Print {verbose}[rdoc-ref:IRB@Verbosity] details.
66
+ - `-v`, `--version`: Print the {IRB version}[rdoc-ref:IRB@Version].
67
+ - `-h`, `--help`: Print the {IRB help text}[rdoc-ref:IRB@Help].
68
+ - `--`: Separate options from {arguments}[rdoc-ref:IRB@Command-Line+Arguments]
69
+ on the command-line.
@@ -0,0 +1,22 @@
1
+ # Comparison with Pry
2
+
3
+ 👋 IRB is on a mission to match feature parity with Pry. This document is here to help us track the similarities and differences between the two.
4
+
5
+ Feel free to chip in and update this table - we appreciate your help!
6
+
7
+ | Feature | Pry | IRB | Note |
8
+ | ------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
9
+ | Supported Rubies | `>= 2.0` | `>= 2.7` | |
10
+ | Source code browsing | `show-source` | `show_source` | IRB's `show_source` can't display C source. See [#664](https://github.com/ruby/irb/issues/664) |
11
+ | Document browsing | `ri` | `show_doc` | |
12
+ | Live help system | `help` or `command_name --help` | `help` | IRB doesn't support detailed descriptions for individual commands yet |
13
+ | Open methods in editors | `edit` | `edit` | |
14
+ | Syntax highlighting | Yes | Yes | |
15
+ | Command shell integration | Yes | No | Currently, there's no plan to support such features in IRB |
16
+ | Navigation | - `cd object` to enter `object` <br/> - `cd ..` to leave the current object <br/> - `nesting` to list nesting levels | - `pushws object` <br/> - `popws` <br/> - `workspaces` <br /> - `cd object`/`cd ..` (since [1.14.0](https://github.com/ruby/irb/releases/tag/v1.14.0)) | We plan to refine IRB's commands in the future |
17
+ | Runtime invocation | `binding.pry` | `binding.irb` | |
18
+ | Command system | Yes | No | Planned in #513 and #588 |
19
+ | Input history | [Comprehensive support](https://github.com/pry/pry/wiki/History) | Supports retrieving previous input and the `history` command | The history command doesn't support as many flags yet, but contributions are welcome. |
20
+ | Pager support | Command output and return value | Command output and return value | |
21
+ | Debugger integration | With `byebug` through [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) gem | Supports [`irb:rdbg`](https://github.com/ruby/irb#debugging-with-irb) sessions | |
22
+ | Rails console | Through [`pry-rails`](https://github.com/pry/pry-rails) gem | Rails' default | Rails console with IRB doesn't have commands like `show-routes` or `show-models` |