Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ruby/irb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.3
Choose a base ref
...
head repository: ruby/irb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 15,151 additions and 9,362 deletions.
  1. +0 −4 .document
  2. +19 −0 .github/ISSUE_TEMPLATE.md
  3. +6 −0 .github/dependabot.yml
  4. +16 −0 .github/release.yml
  5. +46 −0 .github/workflows/gh-pages.yml
  6. +105 −0 .github/workflows/test.yml
  7. +30 −0 .github/workflows/truffle-ruby-test.yml
  8. +1 −1 .gitignore
  9. +5 −0 .rdoc_options
  10. +39 −0 .rubocop.yml
  11. +0 −9 .travis.yml
  12. +52 −0 CONTRIBUTING.md
  13. +3 −0 EXTEND_IRB.md
  14. +24 −5 Gemfile
  15. +90 −20 README.md
  16. +43 −1 Rakefile
  17. +1 −0 doc/.document
  18. +69 −0 doc/COMMAND_LINE_OPTIONS.md
  19. +22 −0 doc/COMPARED_WITH_PRY.md
  20. +273 −0 doc/Configurations.md
  21. +122 −0 doc/EXTEND_IRB.md
  22. +705 −0 doc/Index.md
  23. +31 −17 doc/irb/irb.rd.ja
  24. +0 −2 exe/irb
  25. +15 −51 irb.gemspec
  26. +3 −0 lib/.document
  27. +511 −651 lib/irb.rb
  28. +1 −0 lib/irb/.document
  29. +0 −34 lib/irb/cmd/chws.rb
  30. +0 −39 lib/irb/cmd/fork.rb
  31. +0 −46 lib/irb/cmd/help.rb
  32. +0 −67 lib/irb/cmd/load.rb
  33. +3 −38 lib/irb/cmd/nop.rb
  34. +0 −41 lib/irb/cmd/pushws.rb
  35. +0 −43 lib/irb/cmd/subirb.rb
  36. +75 −45 lib/irb/color.rb
  37. +56 −0 lib/irb/color_printer.rb
  38. +23 −0 lib/irb/command.rb
  39. +17 −0 lib/irb/command/backtrace.rb
  40. +60 −0 lib/irb/command/base.rb
  41. +17 −0 lib/irb/command/break.rb
  42. +17 −0 lib/irb/command/catch.rb
  43. +51 −0 lib/irb/command/cd.rb
  44. +40 −0 lib/irb/command/chws.rb
  45. +16 −0 lib/irb/command/context.rb
  46. +17 −0 lib/irb/command/continue.rb
  47. +73 −0 lib/irb/command/copy.rb
  48. +73 −0 lib/irb/command/debug.rb
  49. +17 −0 lib/irb/command/delete.rb
  50. +19 −0 lib/irb/command/disable_irb.rb
  51. +63 −0 lib/irb/command/edit.rb
  52. +18 −0 lib/irb/command/exit.rb
  53. +17 −0 lib/irb/command/finish.rb
  54. +18 −0 lib/irb/command/force_exit.rb
  55. +83 −0 lib/irb/command/help.rb
  56. +45 −0 lib/irb/command/history.rb
  57. +17 −0 lib/irb/command/info.rb
  58. +27 −0 lib/irb/command/internal_helpers.rb
  59. +33 −0 lib/irb/command/irb_info.rb
  60. +91 −0 lib/irb/command/load.rb
  61. +167 −0 lib/irb/command/ls.rb
  62. +49 −0 lib/irb/command/measure.rb
  63. +17 −0 lib/irb/command/next.rb
  64. +65 −0 lib/irb/command/pushws.rb
  65. +51 −0 lib/irb/command/show_doc.rb
  66. +74 −0 lib/irb/command/show_source.rb
  67. +17 −0 lib/irb/command/step.rb
  68. +123 −0 lib/irb/command/subirb.rb
  69. +23 −0 lib/irb/command/whereami.rb
  70. +288 −118 lib/irb/completion.rb
  71. +352 −80 lib/irb/context.rb
  72. +127 −0 lib/irb/debug.rb
  73. +101 −0 lib/irb/debug/ui.rb
  74. +279 −0 lib/irb/default_commands.rb
  75. +24 −9 lib/irb/easter-egg.rb
  76. +6 −15 lib/irb/ext/change-ws.rb
  77. +7 −15 lib/irb/ext/{history.rb → eval_history.rb}
  78. +29 −31 lib/irb/ext/loader.rb
  79. +5 −12 lib/irb/ext/multi-irb.rb
  80. +0 −117 lib/irb/ext/save-history.rb
  81. +14 −60 lib/irb/ext/tracer.rb
  82. +7 −17 lib/irb/ext/use-loader.rb
  83. +10 −41 lib/irb/ext/workspaces.rb
  84. +0 −328 lib/irb/extend-command.rb
  85. +1 −7 lib/irb/frame.rb
  86. +4 −13 lib/irb/help.rb
  87. +29 −0 lib/irb/helper_method.rb
  88. +16 −0 lib/irb/helper_method/base.rb
  89. +11 −0 lib/irb/helper_method/conf.rb
  90. +116 −0 lib/irb/history.rb
  91. +292 −67 lib/irb/init.rb
  92. +351 −131 lib/irb/input-method.rb
  93. +55 −61 lib/irb/inspector.rb
  94. +5 −24 lib/irb/lc/error.rb
  95. +51 −48 lib/irb/lc/help-message
  96. +0 −11 lib/irb/lc/ja/encoding_aliases.rb
  97. +6 −25 lib/irb/lc/ja/error.rb
  98. +19 −16 lib/irb/lc/ja/help-message
  99. +13 −51 lib/irb/locale.rb
  100. +0 −38 lib/irb/magic-file.rb
  101. +239 −0 lib/irb/nesting_parser.rb
  102. +1 −7 lib/irb/notifier.rb
  103. +2 −14 lib/irb/output-method.rb
  104. +213 −0 lib/irb/pager.rb
  105. +405 −422 lib/irb/ruby-lex.rb
  106. +116 −36 lib/irb/ruby_logo.aa
  107. +138 −0 lib/irb/source_finder.rb
  108. +0 −7 lib/irb/src_encoding.rb
  109. +101 −0 lib/irb/statement.rb
  110. +3 −9 lib/irb/version.rb
  111. +43 −53 lib/irb/workspace.rb
  112. +1 −7 lib/irb/ws-for-case-2.rb
  113. +4 −10 lib/irb/xmp.rb
  114. +88 −3 man/irb.1
  115. +84 −0 test/irb/command/test_cd.rb
  116. +50 −0 test/irb/command/test_command_aliasing.rb
  117. +70 −0 test/irb/command/test_copy.rb
  118. +194 −0 test/irb/command/test_custom_command.rb
  119. +28 −0 test/irb/command/test_disable_irb.rb
  120. +51 −0 test/irb/command/test_force_exit.rb
  121. +75 −0 test/irb/command/test_help.rb
  122. +50 −0 test/irb/command/test_multi_irb_commands.rb
  123. +410 −0 test/irb/command/test_show_source.rb
  124. +253 −0 test/irb/helper.rb
  125. +133 −51 test/irb/test_color.rb
  126. +82 −0 test/irb/test_color_printer.rb
  127. +985 −0 test/irb/test_command.rb
  128. +292 −26 test/irb/test_completion.rb
  129. +620 −134 test/irb/test_context.rb
  130. +513 −0 test/irb/test_debugger_integration.rb
  131. +53 −0 test/irb/test_eval_history.rb
  132. +44 −0 test/irb/test_evaluation.rb
  133. +119 −0 test/irb/test_helper_method.rb
  134. +579 −0 test/irb/test_history.rb
  135. +372 −37 test/irb/test_init.rb
  136. +195 −0 test/irb/test_input_method.rb
  137. +936 −0 test/irb/test_irb.rb
  138. +118 −0 test/irb/test_locale.rb
  139. +339 −0 test/irb/test_nesting_parser.rb
  140. +5 −3 test/irb/test_option.rb
  141. +86 −0 test/irb/test_pager.rb
  142. +84 −0 test/irb/test_raise_exception.rb
  143. +0 −16 test/irb/test_raise_no_backtrace_exception.rb
  144. +221 −107 test/irb/test_ruby_lex.rb
  145. +90 −0 test/irb/test_tracer.rb
  146. +109 −0 test/irb/test_type_completor.rb
  147. +27 −4 test/irb/test_workspace.rb
  148. +494 −0 test/irb/yamatanooroti/test_rendering.rb
  149. +0 −14 test/lib/-test-/integer.rb
  150. +0 −298 test/lib/envutil.rb
  151. +0 −22 test/lib/find_executable.rb
  152. +14 −0 test/lib/helper.rb
  153. +0 −75 test/lib/iseq_loader_checker.rb
  154. +0 −57 test/lib/jit_support.rb
  155. +0 −240 test/lib/leakchecker.rb
  156. +0 −149 test/lib/memory_status.rb
  157. +0 −457 test/lib/minitest/README.txt
  158. +0 −14 test/lib/minitest/autorun.rb
  159. +0 −418 test/lib/minitest/benchmark.rb
  160. +0 −196 test/lib/minitest/mock.rb
  161. +0 −1,417 test/lib/minitest/unit.rb
  162. +0 −91 test/lib/profile_test_all.rb
  163. +0 −1,175 test/lib/test/unit.rb
  164. +0 −943 test/lib/test/unit/assertions.rb
  165. +0 −208 test/lib/test/unit/parallel.rb
  166. +0 −36 test/lib/test/unit/testcase.rb
  167. +0 −126 test/lib/tracepointchecker.rb
  168. +0 −18 test/lib/with_different_ofs.rb
  169. +0 −13 test/lib/zombie_hunter.rb
4 changes: 0 additions & 4 deletions .document

This file was deleted.

19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,25 @@

What are your expected behavior and actual behavior of your environment?

## Result of irb_info

Please paste the result of `irb_info` command in IRB.

ex.)

```
irb(main):001:0> irb_info
=>
Ruby version: 3.0.0
IRB version: irb 1.2.7 (2020-09-19)
InputMethod: RelineInputMethod with Reline 0.1.9 and /home/aycabta/.inputrc
.irbrc path: /home/aycabta/.irbrc
```

## Terminal Emulator

What's your terminal emulator?

## Setting Files

Are you using `~/.irbrc` and `~/.inputrc`?
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# release.yml

changelog:
categories:
- title: ✨ Enhancements
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 📚 Documentation
labels:
- documentation
- title: 🛠 Other Changes
labels:
- "*"
46 changes: 46 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy IRB documentation to GitHub Pages

on:
push:
branches: ["master"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.repository == 'ruby/irb' && !startsWith(github.event_name, 'pull') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # v1.196.0
with:
ruby-version: "3.3"
bundler-cache: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with IRB
run: bundle exec rake rdoc
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
105 changes: 105 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: build

on:
push:
pull_request:
schedule:
- cron: "30 14 * * *"

jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby
min_version: 2.7
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop
irb:
needs: ruby-versions
name: rake test ${{ matrix.ruby }} ${{ matrix.with_latest_reline && '(latest reline)' || '' }}
strategy:
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
with_latest_reline: [true, false]
fail-fast: false
runs-on: ubuntu-latest
env:
WITH_LATEST_RELINE: ${{matrix.with_latest_reline}}
timeout-minutes: 30
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# Added to make Ruby 2.7 correctly require installed default gems, like `pp`.
rubygems: latest
- name: Run tests
run: bundle exec rake test
- name: Run tests in isolation
run: bundle exec rake test_in_isolation
debug-test:
name: Debug compatibility test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Install dependencies
run: bundle install
- name: Install IRB
run: |
rake install
- name: Download ruby/debug
run: |
git clone https://github.com/ruby/debug
- name: Run debug tests
working-directory: ./debug
run: |
bundle install
bundle exec rake
vterm-yamatanooroti:
needs: ruby-versions
name: >-
vterm-yamatanooroti ${{ matrix.ruby }} ${{ matrix.with_latest_reline && '(latest reline)' || '' }}
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
with_latest_reline: [true, false]
fail-fast: false
env:
WITH_LATEST_RELINE: ${{matrix.with_latest_reline}}
WITH_VTERM: 1
timeout-minutes: 30
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Install libvterm
run: |
sudo apt install -y libtool-bin
wget http://www.leonerd.org.uk/code/libvterm/libvterm-0.1.4.tar.gz
tar xvzf libvterm-0.1.4.tar.gz
cd libvterm-0.1.4
sed -i -e 's/^PREFIX=.*$/PREFIX=\/usr/g' Makefile
make
sudo make install
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: rake test_yamatanooroti
run: bundle exec rake test_yamatanooroti
30 changes: 30 additions & 0 deletions .github/workflows/truffle-ruby-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build-with-truffleruby-head

on:
push:
pull_request:
schedule:
- cron: "30 14 * * *"

jobs:
irb:
name: rake test truffleruby-head ${{ matrix.with_latest_reline && '(latest reline)' || '' }}
strategy:
matrix:
with_latest_reline: [true, false]
fail-fast: false
runs-on: ubuntu-latest
env:
WITH_LATEST_RELINE: ${{matrix.with_latest_reline}}
timeout-minutes: 30
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: truffleruby-head
bundler-cache: true
- name: Run tests
run: bundle exec rake test
- name: Run tests in isolation
run: bundle exec rake test_in_isolation
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
Gemfile.lock
_site/
5 changes: 5 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
page_dir: doc
warn_missing_rdoc_ref: true

autolink_excluded_words:
- IRB
39 changes: 39 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
AllCops:
TargetRubyVersion: 3.0
DisabledByDefault: true
SuggestExtensions: false

Layout/TrailingWhitespace:
Enabled: true

Layout/TrailingEmptyLines:
Enabled: true

Layout/IndentationConsistency:
Enabled: true

Layout/CaseIndentation:
Enabled: true
EnforcedStyle: end

Layout/CommentIndentation:
Enabled: true

Layout/IndentationStyle:
Enabled: true

Layout/SpaceAroundKeyword:
Enabled: true

Layout/SpaceBeforeComma:
Enabled: true

Layout/SpaceAfterComma:
Enabled: true

Style/ClassMethodsDefinitions:
Enabled: true
EnforcedStyle: self_class

Layout/EmptyLines:
Enabled: true
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

52 changes: 52 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Contributing to IRB

Bug reports and pull requests are welcome on GitHub at [https://github.com/ruby/irb](https://github.com/ruby/irb).

## Set up the environment

1. Fork the project to your GitHub account.
2. Clone the fork with `git clone git@github.com:[your_username]/irb.git`.
3. Run `bundle install`.
4. Run `bundle exec rake` to make sure tests pass locally.

## Run integration tests

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`.

Before running these tests, ensure that you have `libvterm` installed. If you're using Homebrew, you can install it by running:

```bash
brew install libvterm
```

After installing `libvterm`, you can run the integration tests using the following commands:

```bash
WITH_VTERM=1 bundle install
WITH_VTERM=1 bundle exec rake test test_yamatanooroti
```

## Update documentation

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.

Run the following command to generate the documentation site locally.

```bash
bundle exec rake rdoc
bundle exec rake rerdoc # to force regeneration
```

Follow the output message to open the documentation site in your browser.

> [!Note]
>
> Please ensure that the changes are rendered correctly on the documentation site.
> 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).
We welcome any improvements to the documentation, including:

- Fixing typos and grammatical errors.
- Adding missing documentation for features.
- Adding missing documentation for configuration options.
- Adding demo images/gifs for features.
3 changes: 3 additions & 0 deletions EXTEND_IRB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Extend IRB

This page has been moved to the [IRB Extension Guide](https://ruby.github.io/irb/EXTEND_IRB_md.html).
29 changes: 24 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gemspec

# TODO: remove this when reline with `Reline::Unicode.escape_for_print` is released.
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0')
gem "reline", github: "ruby/reline"
is_unix = RUBY_PLATFORM =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
is_truffleruby = RUBY_DESCRIPTION =~ /truffleruby/

if is_unix && ENV['WITH_VTERM']
gem "vterm", github: "ruby/vterm-gem"
gem "yamatanooroti", github: "ruby/yamatanooroti"
end

gem "stackprof" if is_unix && !is_truffleruby

gem "reline", github: "ruby/reline" if ENV["WITH_LATEST_RELINE"] == "true"
gem "rake"
gem "test-unit"
gem "test-unit-ruby-core"

gem "rubocop"

gem "tracer" if !is_truffleruby
gem "debug", github: "ruby/debug", platforms: [:mri, :mswin]

gem "rdoc", ">= 6.11.0"

if RUBY_VERSION >= "3.0.0" && !is_truffleruby
gem "repl_type_completor"
end
Loading