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
7686e33ee4
JSON like label ends by differs from the start
...
pp Ripper.lex('{ "a": 3 }')
=>
[[[1, 0], :on_lbrace, "{", EXPR_BEG|EXPR_LABEL],
[[1, 1], :on_sp, " ", EXPR_BEG|EXPR_LABEL],
[[1, 2], :on_tstring_beg, "\"", EXPR_BEG|EXPR_LABEL],
[[1, 3], :on_tstring_content, "a", EXPR_BEG|EXPR_LABEL],
[[1, 4], :on_label_end, "\":", EXPR_BEG|EXPR_LABEL],
[[1, 6], :on_sp, " ", EXPR_BEG|EXPR_LABEL],
[[1, 7], :on_int, "3", EXPR_END],
[[1, 8], :on_sp, " ", EXPR_END],
[[1, 9], :on_rbrace, "}", EXPR_END]]
2019-05-25 10:42:57 +09: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
NAKAMURA Usaku
c5cbabf8a8
Use colorized IRB on Windows without checking TERM
2019-05-23 15:33:40 +09:00
Takashi Kokubun
32ed85f601
Copy config to make IRB::Context#use_colorize? functional
...
on initialize
This fixes https://github.com/ruby/ruby/pull/2188
2019-05-21 04:32:17 -07:00
aycabta
4613c4bd5c
Symbol beginning token may take a constant token
2019-05-21 18:55:31 +09:00
aycabta
fd95ab44c6
IRB should eval and show an error when only .
is inputted
2019-05-21 18:37:35 +09:00
aycabta
29c81265c1
Check whether IRB.conf is nil in IRB::WorkSpace#code_around_binding
2019-05-21 09:14:08 +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
Takashi Kokubun
f2d7ba6a74
make sync-default-gems GEM=irb
...
from e8e79d569e
.
This colorizes Range object on IRB inspect.
2019-04-28 21:51:37 +09:00
Takashi Kokubun
588f212c26
make sync-default-gems GEM=irb
...
from 44301d3827
.
This includes some fixes for string interpolation highlight fixes.
2019-04-28 20:18:45 +09:00
Takashi Kokubun
cae0b73214
make sync-default-gems GEM=irb
...
from 89e9add06d
.
This adds syntax highlight support for Module on inspect.
In addition to that, I'm adding a trailing space in test_color.rb for
testing ruby-commit-hook's auto-style.
2019-04-28 02:01:04 +09:00
Takashi Kokubun
9348643575
make sync-default-gems GEM=irb
...
Synced from 5feb361ed8
.
This includes a support to colorize named Class instance on IRB inspect.
2019-04-27 22:01:11 +09:00
Takashi Kokubun
569c1ef6f1
make sync-default-gems GEM=irb
...
Backport changes from ruby/irb.
2019-04-27 11:42:40 +09:00
naruse
c8b675adb9
suppress redefinition warnings
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-27 09:17:24 +09:00
nobu
8990779d36
Prefer block_given? to iterator?
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-27 09:15:49 +09:00
Takashi Kokubun
a429b3601f
Revert "Class instance should be also colorable on IRB"
...
This reverts commit 6669c966d2
.
It seems to make tests fail... let me fix this later.
2019-04-26 18:46:43 +09:00
Takashi Kokubun
6669c966d2
Class instance should be also colorable on IRB
...
inspect.
Change is made with: `$ make -C .ruby sync-default-gems GEM=irb`
2019-04-26 18:42:51 +09:00
Takashi Kokubun
52cfb17086
make sync-default-gems GEM=irb
...
from e6739d8c66
2019-04-26 18:28:57 +09:00
Takashi Kokubun
0408b8b390
Syntax-highlight yield in IRB
2019-04-26 01:43:14 +09:00
Takashi Kokubun
5fe99aefd3
Support highlighting Regexp in inspect
2019-04-26 01:15:30 +09:00
Pocket7878
022cbb278f
Do not color IRB output on 'dumb' TERM
...
Co-Authored-By: k0kubun <takashikkbn@gmail.com>
Closes: https://github.com/ruby/ruby/pull/2150
2019-04-26 00:47:42 +09:00
Takashi Kokubun
b55201dd09
Colorize IRB's inspect result
...
Closes: https://github.com/ruby/ruby/pull/2150
2019-04-26 00:47:40 +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
naruse
9a83922b66
suppress redefinition warnings
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21 05:48:35 +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
c20aae965e
Prefer block_given? to iterator?
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-18 09:52:50 +00:00
hsbt
301ae01bb5
Bump version to 1.0.0.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-18 06:49:12 +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
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
hsbt
ca32fe1673
Try to load version file of github repository at first.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-31 12:56:17 +00:00
kazu
a832dc0fe6
Fix filename in comment [ci skip]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 10:00:29 +00:00
hsbt
70785c1c5a
Promote irb library to default gems.
...
* lib/irb/irb.gemspec: init.
* lib/irb/version.rb: Set @RELEASE_VERSION value to IRB::VERSION for gemspec.
* doc/*.rdoc: Move IRB entry to default gems category.
* tool/sync_default_gems.rb: Add irb support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-09 14:01:05 +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
d6dc676d07
irb/{context,workspace}.rb: use local_variable_set
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14 12:49:30 +00:00
nobu
698407450b
irb/context.rb: using input-method
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14 12:36:05 +00:00
nobu
89e82a75a8
Hash instead of Set
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 01:28:28 +00:00
nobu
583d903c2b
Speed up func1.func2 completion by using Set for ignored modules
...
And thus avoiding Module#name calls. Those are slow, especially in
larger projects, with lots of anonymous modules.
[Fix GH-1798]
From: Dmitry Gutov <dgutov@yandex.ru>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 01:28:27 +00:00
mame
571e48b744
proc.c (bind_location): Add Binding#source_location
...
Fixes #14230
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26 08:38:35 +00:00
kazu
38054f99aa
Remove unnecessary :
...
Before:
`.../irb/init.rb:280: warning: :LoadError: cannot load such file -- hoge`
After:
`.../irb/init.rb:280: warning: LoadError: cannot load such file -- hoge`
[ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:07 +00:00
shyouhei
f2a91397fd
Add uplevel keyword to Kernel#warn and use it
...
If uplevel keyword is given, the warning message is prepended
with caller file and line information and the string "warning: ".
The use of the uplevel keyword makes Kernel#warn format output
similar to how rb_warn formats output.
This patch modifies net/ftp and net/imap to use Kernel#warn
instead of $stderr.puts or $stderr.printf, since they are used
for printing warnings.
This makes lib/cgi/core and tempfile use $stderr.puts instead of
warn for debug logging, since they are used for debug printing
and not for warning.
This does not modify bundler, rubygems, or rdoc, as those are
maintained outside of ruby and probably wish to remain backwards
compatible with older ruby versions.
rb_warn_m code is originally from nobu, but I've changed it
so that it only includes the path and lineno from uplevel
(not the method), and also prepends the string "warning: ",
to make it more similar to rb_warn.
From: Jeremy Evans code@jeremyevans.net
Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 11:56:25 +00:00
k0kubun
4fe2ca38c1
irb/init.rb: make sure ARGV refers to toplevel one
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 11:32:37 +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
kazu
6d14c47c20
Fix TOCTTOU and avoid to read existing unreadable file
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24 11:00:10 +00:00