Граф коммитов

76 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada aa32465ab3
irb.rb: [DOC] the default prompt includes :PROMPT_N [ci skip] 2019-06-14 15:31:03 +09:00
aycabta f80771f0a9 Use Reline.prompt_proc in IRB 2019-06-14 08:26:06 +09:00
aycabta 260235ce87 Use Reline as Reidline multiline editor in IRB 2019-05-25 02:16:19 +09:00
aycabta 3a9008b984 Add --colorize and --nocolorize options to IRB 2019-05-21 08:57:21 +09:00
aycabta 94b740b249 Use Ripper for IRB
The debug option of IRB is deleted because it's just for IRB's pure Ruby
parser.
2019-04-30 14:40:06 +09:00
Nobuyoshi Nakada e804fcb42c
Fix rdoc in 52cfb17086 2019-04-26 18:54:10 +09:00
Takashi Kokubun 52cfb17086
make sync-default-gems GEM=irb
from e6739d8c66
2019-04-26 18:28:57 +09:00
Takashi Kokubun 94af6cd383
Colorize IRB's code_around_binding
Closes: https://github.com/ruby/ruby/pull/2150
2019-04-26 00:47:39 +09:00
Nobuyoshi Nakada f4f66bd11c
Revert "IRB is improved with Reline and RDoc, take 2"
Accidentally merged when 89271d4a37
"Adjusted indents".
2019-04-23 21:55:29 +09:00
aycabta f2cd4f4cd0
IRB is improved with Reline and RDoc, take 2 2019-04-23 20:08:02 +09:00
aycabta 51cec00953 Revert "IRB is improved with Reline and RDoc"
This reverts commit 7f273ac6d0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21 09:13:49 +00:00
aycabta 7f273ac6d0 IRB is improved with Reline and RDoc
Reline is a readline stdlib compatible library. It also supports
multiline input. IRB is improved with Reline and supports multiline.
Besides, supports showing documents when completed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20 08:51:20 +00:00
nobu 6d18187371 Fix remaining syntax errors in Binding#irb docs
Apologies for catching those so late.

[Fix GH-2067] [ci skip]

From: Olivier Lacan <hi@olivierlacan.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-13 03:27:16 +00:00
hsbt e913ecfded Backport https://github.com/ruby/irb/pull/2
Fix and improve version string by @stomar

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 07:41:10 +00:00
k0kubun 8945eeda8f Fix syntax on Binding.irb documentation [ci skip]
There was incorrect backticks (`) instead of plus signs to denote method
references, and a typo.

[Fix GH-2016]

From: Olivier Lacan <hi@olivierlacan.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-14 21:04:57 +00:00
kazu bc7976f2c6 lib/irb.rb: fix up r65674
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-12 02:00:08 +00:00
k0kubun 623ecdace6 Document binding.irb on Binding [ci skip]
For some reason this very useful method was undocumented since it was added in
493e488974 which makes finding it in the docs
impossible before this change.

I've added a detailed example with sample code because it's one of the most
powerful tools to debug Ruby code and I believe very few people are aware of it
due to the lack of documentation.

[Fix GH-2010]

From: Olivier Lacan <hi@olivierlacan.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-12 00:55:34 +00:00
hsbt 93c4f8b360 Merge irb from github repository.
* IRB::VERSION is available on irb session.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 07:54:58 +00:00
nobu 707c5ffab5 irb.rb: update `_`
* lib/irb.rb (IRB::Irb#eval_input): update `_` after exception.
  [ruby-core:86989] [Bug #14749]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 09:13:45 +00:00
nobu 9fa0d0058d irb.rb: restore the last error
* lib/irb.rb (eval_input): restore the last error `$!`, as the
  previous result.  [Feature #14684]

* lib/irb/context.rb (evaluate): add `exception` keyword argument
  to set the last error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14 13:05:52 +00:00
nobu 282efd1f32 irb.rb: backtrace order
* lib/irb.rb (handle_exception): show backtrace from the topmost
  if stdout is not a tty.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-13 18:11:22 +00:00
nobu fb68dfc40e irb.rb: hoist out handle_exception
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-13 18:06:35 +00:00
nobu 72ac5986bd irb.rb: fix highlight
* lib/irb.rb (IRB::Irb#eval_input): fix highlight for multiple
  lines exception messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-25 07:55:25 +00:00
nobu c03c03cc11 lib/irb.rb: highlight exceptions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-24 02:26:22 +00:00
nobu 43e64b8585 lib/irb.rb: simplified backtrace filtering
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-24 01:52:21 +00:00
sorah daaebaec79 Print backtrace in reverse order on IRB too
[Feature #8861]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-23 18:17:39 +00:00
k0kubun da1ba13714 irb.rb: preserve ARGV on binding.irb
This is not perfectly good solution (at least we don't want to have ARGV
as default value of `argv` argument), but unfortunately IRB.setup and
IRB.parse_opts are public methods and we can't make breaking change to
those methods.

We may deprecate using them and then make them private in the future,
but the removal should not be in Ruby 2.5. So I kept their interface for
now.

[Bug #14162] [close GH-1770]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 11:25:16 +00:00
nobu 5761093ee1 prelude.rb: suppress redefinition warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 03:54:49 +00:00
k0kubun 106c9883e1 irb.rb: show source around binding.irb on start
[Feature #14124] [ruby-dev:50319] [close GH-1764]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24 03:53:27 +00:00
hsbt 52a275ee79 Removed obsoleted safe level checks on irb.
https://github.com/ruby/ruby/pull/1713

  Patch by @y-yagi [fix GH-1713]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 14:11:08 +00:00
hsbt 6a08beef51 Removed math mode from irb.
mathn is deprecated from Ruby 2.2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 09:11:36 +00:00
nobu 7802f01d4f prelude.rb: Binding#irb [ci skip]
* prelude.rb (Binding#irb): [EXPERIMENTAL] automatically require
  irb and run.  [ruby-core:78960] [Bug #13099]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-06 03:11:45 +00:00
nobu 493e488974 irb.rb: Binding#irb
* lib/irb.rb (Binding#irb): new method like Binding#pry.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-06 02:53:25 +00:00
nobu 5e214d40d5 irb.rb: IRB::Irb#run
* lib/irb.rb (IRB::Irb#run): split from IRB.start.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-06 02:49:49 +00:00
hsbt 966e020add * lib/irb.rb: avoid to needless truncation when using back_trace_limit option.
[fix GH-1205][ruby-core:72773][Bug #11969]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-26 01:57:58 +00:00
a_matsuda 3a05da1321 [DOC] Fix typos
* benchmark.rb
* getoptlong.rb
* irb.rb
* net/http.rb
* net/http/header.rb
* net/imap.rb
* optparse.rb
* pstore.rb
* webrick.rb
* xmlrpc.rb

[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 03:43:23 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
hsbt 00d8b1a85d * lib/irb.rb: Ignored assignment of STDOUT.sync = true
when irb.rb loaded. It's affected to IDE such as Jetbrain.
  [fix GH-864] Patch by @os97673

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23 08:55:35 +00:00
gogotanaka 1781c4c1e1 * Fix typo. Patch by @davydovanton
[Fix GH-928][ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 05:06:25 +00:00
hsbt 2afed6ecef * lib/e2mmap.rb: remove needless instance variables.
* lib/irb.rb: ditto.
* lib/irb/**/*.rb: ditto.
* lib/shell.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-24 07:16:25 +00:00
hsbt f741fd2d9d * lib/irb.rb: Prevent irb from crashing when exception with
nil backtrace is raised.
  [fix GH-434][ruby-core:58078][Bug #9063]
* test/irb/test_raise_no_backtrace_exception.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-13 02:19:48 +00:00
hsbt 76515504d5 * lib/irb.rb: removed commented-out code.
* lib/irb/**/*.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09 02:02:58 +00:00
zzak 22e09d1e22 * lib/irb.rb: [DOC] PROMPT_I cannot be nil, patch by @hgillane [ci skip]
Fixes documenting-ruby/ruby#37
  https://github.com/documenting-ruby/ruby/pull/37


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-26 20:13:03 +00:00
zzak 77a8010abd * lib/irb.rb: [DOC] Fixed syntax error in example by @jasdeepsingh.
Patch submitted via documenting-ruby/ruby#32 [ci skip]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25 01:02:59 +00:00
a_matsuda 1f861a6ea8 * lib/irb.rb: [DOC] Fix typo
s/degits/digits/
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-23 05:34:39 +00:00
zzak c366a99cc5 * lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]
Patch by Dave Worth https://github.com/ruby/ruby/pull/341
* lib/webrick.rb: ditto
* lib/scanf.rb: ditto
* lib/xmlrpc/config.rb: ditto
* lib/resolv.rb: ditto
* lib/e2mmap.rb: ditto
* lib/fileutils.rb: ditto
* lib/mkmf.rb: ditto
* lib/cgi/session.rb: ditto
* lib/yaml.rb: ditto
* lib/erb.rb: ditto
* lib/irb.rb: ditto
* lib/tracer.rb: ditto
* lib/net/http.rb: ditto
* ext/syslog/lib/syslog/logger.rb: ditto
* sample/pty/expect_sample.rb: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-18 13:50:32 +00:00
drbrain 0fb6a44da9 * lib/irb.rb: Fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-12 20:49:44 +00:00
zzak 5b15e5a38f * lib/irb.rb: Remove example from restrictions, it works [Github #246]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 15:57:19 +00:00
zzak f11ff34d8f * lib/irb.rb, lib/irb/ext/save-history.rb: Add documentation on how to
enabled irb history [ruby-core:51347] [Bug #7679]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 23:04:09 +00:00
zzak e195e181e6 * lib/irb.rb, lib/irb/context.rb: Add documentation on how to enable
auto-indentation and autocompletion using irbrc and irb_context
  [ruby-core:51209] [Bug #7642] and [ruby-core:51348] [Bug #7680]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 22:36:22 +00:00