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

47 Коммитов

Автор SHA1 Сообщение Дата
aycabta e468d9f49c [ruby/irb] Add OMIT_ON_ASSIGNMENT
Omit the results evaluated at assignment if they are too long.

The behavior of ECHO_ON_ASSIGNMENT being on by default is hard to understand,
so I change it to off by default. Instead, we turn OMIT_ON_ASSIGNMENT on by
default. The result is displayed on assignment, but it will always be short
and within one line of the screen.

https://github.com/ruby/irb/commit/c5ea79d5ce
2020-09-14 02:13:11 +09:00
aycabta b3f84b4a5b [ruby/irb] Expand path to run separated test correctly
https://github.com/ruby/irb/commit/be2937abd5
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada 6aa786b8a3 [ruby/irb] Get rid of loading readline unnecessarily
https://github.com/ruby/irb/commit/420e7d2270
2020-08-18 14:38:01 +09:00
aycabta 3864fbc6d8 [ruby/irb] Check existence of rc files in irb_info command
https://github.com/ruby/irb/commit/cdbb9dfc9f
2020-04-29 19:13:14 +09:00
aycabta 98a346d065 [ruby/irb] Add irb_info command
https://github.com/ruby/irb/commit/a6fe58e916
2020-04-29 19:13:14 +09:00
aycabta 8c3efa4940 Use Reline.encoding_system_needs if exists 2020-01-14 15:40:38 +09:00
aycabta ad6837dd60 [ruby/irb] Revert "Reidline mode needs Reline what needs String#grapheme_clusters"
This reverts commit 2b0b19b87c60d2cdb329979acbb96e12a1f940e7.

New IRB parser needs new Ripper what has lex_state too. The new Ripper is
adopted by Ruby 2.5 or later.

https://github.com/ruby/irb/commit/9ab6e35a2c
2019-12-07 21:55:31 +09:00
aycabta c2afddccb3 [ruby/irb] Reidline mode needs Reline what needs String#grapheme_clusters
https://github.com/ruby/irb/commit/2b0b19b87c
2019-12-07 20:01:53 +09:00
aycabta f8cc05dec3 Use @eof variable for ReidlineInputMethod#eof?
"IRB::InputMethod#eof?" requires eof status each user input but
"ReidlineInputMethod#eof?" used "Reline.eof?" what is singleton data.
"ReidlineInputMethod#eof?" is changed to use the result of user input.
2019-11-30 11:20:39 +09:00
aycabta 8b20829396 Remove an unnecessary variable 2019-11-26 19:22:38 +09:00
aycabta 51ea1abb5f Remove e2mmap dependency 2019-11-25 05:38:09 +09:00
aycabta d009e321a0 Use IRB.conf[:AUTO_INDENT] setting in multiline mode 2019-06-19 09:19:41 +09:00
aycabta 235e72f17e Implement auto indent for multiline 2019-06-18 20:58:18 +09:00
aycabta f80771f0a9 Use Reline.prompt_proc in IRB 2019-06-14 08:26:06 +09:00
Takashi Kokubun cb40a21da0
Warn compile_error only when input is finished
Let's say we are in progress to write `"foo"`:

```
irb> "fo
```

at this moment, nothing is wrong.
It would be just a normal way to write `"foo"`.

Prior to this commit, the `fo` part was warned because of
5b64d7ac6e. But I think warning such a
normal input is not valuable for users.

However, we'd like to warn `:@1` or `@@1` which is also a syntax error.
Then this commit switches the syntax highlight based on whether the
input text is finished or not. When it's not finished yet, it does not
warn compile_error.
2019-05-31 06:54:00 +09:00
aycabta 9840f52c77 Use IRB::InputMethod#eof? to quit 2019-05-27 10:18:09 +09:00
Takashi Kokubun e2db9f4cc3
Add and use Reline::Unicode.escape_for_print 2019-05-25 07:10:09 -07:00
Takashi Kokubun e691b4da5d
Respect --nocolorize on REPL source highlight 2019-05-25 06:31:13 -07:00
Takashi Kokubun b83119be9e
Incremental syntax highlight for IRB source lines
Closes: https://github.com/ruby/ruby/pull/2202
2019-05-24 23:54:52 -07:00
aycabta 559dca509d Show documents when completion 2019-05-25 03:30:01 +09:00
aycabta 260235ce87 Use Reline as Reidline multiline editor in IRB 2019-05-25 02:16:19 +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
marcandre b9d42af0f2 lib/*: Prefer require_relative over require, remove explicit extension
[#15206] [Fix GH-1976]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 17:52:43 +00:00
marcandre e859e668d2 lib/*: Prefer require_relative over require.
[#15206] [Fix GH-1976]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 17:52:33 +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 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 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
hsbt 8e5af8b628 * lib/cmath.rb: fixed indent.
* lib/drb/ssl.rb: ditto.
* lib/irb/**/*.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09 01:36:49 +00:00
zzak e8a7607ed0 * lib/irb/input-method.rb, lib/irb.rb: Typo in
InputMethod#readable_atfer_eof? to #readable_after_eof?
  [ruby-core:51069] [Bug #7599]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21 17:29:18 +00:00
zzak 7e9eb32669 * lib/irb.rb, lib/irb/*: Documentation for IRB
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21 05:45:50 +00:00
keiju c7fa0c727c * bin/irb, lib/irb.rb lib/irb/*: irb-0.9.6, extend inspect-mode
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 11:36:20 +00:00
nobu 287a34ae0d * {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00
yugui a5fdc9de34 * lib/irb/input-method.rb: IRB did not prompt for MSwin32.
[ruby-dev:37686].
  Patch by arton <artonx AT yahoo.co.jp>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13 03:37:15 +00:00
yugui 3beeeffb97 * lib/irb/input-method.rb (IRB::StdioInputMethod#initialize):
removed a 'p' for debugging.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-26 08:06:33 +00:00
yugui 5c1bd53c92 * lib/irb/init.rb (IRB.opt_parse): (M17N) adds -U and -E as command
line options. [ruby-dev:37161]. Fixes #711.
  improved long optinos.

* lib/irb/init.rb (IRB.set_encoding): new subroutine for IRB.opt_parse

* lib/irb/input-method.rb (IRB::StdioInputMethod): (M17N) regards
  scripts that user types as encoded in the external_encoding.

* lib/irb/input-method.rb (IRB::ReadlineInputMethod): ditto.

* lib/irb/input-method.rb (IRB::FileInputMethod): (M17N) respects
  magic comment.

* lib/irb/help.rb (IRB.print_usage): (M17N) respects magic comment
  in the resource file.

* lib/irb/lc/help-message: adds -U and -E.

* lib/irb/lc/ja/help-message: ditto. re-encoded from ISO-2022-JP into UTF-8.

* lib/irb/lc/ja/encoding_aliases.rb: new file. provides Japanese specific
  character encoding name table for backward compatibility.

* lib/irb/lc/ja/error.rb: re-eoncoded from ISO-2022-JP into UTF-8.
  magic comment.

* lib/irb/locale.rb: integrated with Ruby 1.9's M17N support.

* lib/irb/magic-file.rb: new file. utility to handle files with magic
  comment and opens in the correct encoding.

* lib/irb/ruby-lex.rb (RubyLex#each_top_level_statement): recovers
  character encoding for a statement after it lexed so that irb can
  eval the statement in correct encoding.

* lib/irb/src_encoding.rb: new file. utility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-18 13:09:26 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
shugo 4a3fffdccb * ext/readline/readline.c (readline_readline): do not set rl_{in,out}stream.
* ext/readline/readline.c (readline_s_set_input): new method.
* ext/readline/readline.c (readline_s_set_output): new method.
* lib/irb/input-method.rb: set Readline.input and Readline.output.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-17 16:18:56 +00:00
shugo 3fd16970f3 * ext/readline/readline.c: supported libedit. fixed: [ruby-core:4858]
* ext/readline/extconf.rb: added new option --enable-libedit.

* test/readline/test_readline.rb: added assertions for
  Readline::HISTORY.

* lib/irb/input-method.rb: do not use Readline::HISTORY.pop.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-19 14:36:20 +00:00
keiju 622b522047 * bin/irb lib/irb.rb lib/irb/...: IRB 0.9.5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-13 15:27:09 +00:00
nobu 776206b3e7 * lib/irb/init.rb (IRB.rc_files): yield possible rc file names.
* lib/irb/input-method.rb (IRB::ReadlineInputMethod::initialize):
  load and save history automatically.  [ruby-core:02352]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-07 10:56:16 +00:00
matz e5282ef182 update NotImplementError to NotImplementedError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-23 17:58:57 +00:00
keiju af064b04b1 * irb 0.9
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-09 11:17:17 +00:00
knu 859a7a9277 Merge from irb 0.7.3.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-04-30 17:54:55 +00:00
matz 9da4f78db4 2000-05-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-05-12 09:07:57 +00:00