1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

494 commits

Author SHA1 Message Date
Takashi Kokubun
6d07785127 [ruby/irb] Remove unnecessary ignore_error in dispatch_seq
Just forgotten in a5804c3560

https://github.com/ruby/irb/commit/e42e548793
2020-12-28 23:29:29 -08:00
Takashi Kokubun
f30a3a0629
[ruby/irb] Do not colorize partially-correct inspect
This is to prevent a yellow-mixed output for ActiveSupport::TimeWithZone.

Follows up https://github.com/ruby/irb/pull/159 and https://github.com/ruby/ruby/pull/3967.

a5804c3560
2020-12-28 23:29:08 -08:00
Nobuhiro IMAI
9b7ceb6765
irb: add more syntax errors colorizing support () 2020-12-28 23:07:20 -08:00
Takashi Kokubun
f9e80af28a [ruby/irb] Add color_printer.rb to gemspec
https://github.com/ruby/irb/commit/b4df0fd8b2
2020-12-28 23:01:01 -08:00
Takashi Kokubun
c715fb46c2 [ruby/irb] Enhance colored inspect output
https://github.com/ruby/irb/commit/dffcdb5269
2020-12-28 23:01:00 -08:00
aycabta
32616229e3 [ruby/irb] Version 1.3.0
https://github.com/ruby/irb/commit/ec83280e66
2020-12-25 01:29:18 +09:00
aycabta
167dc37632 [ruby/irb] Try not to register the exact same measuring method twice
https://github.com/ruby/irb/commit/cc66b5573e
2020-12-24 23:26:22 +09:00
aycabta
28e9344fa4 [ruby/irb] Change StdioInputMethod#eof? to non-blocking
This fixes --inf-ruby-mode.

https://github.com/ruby/irb/commit/0e4a818955
2020-12-23 22:08:30 +09:00
aycabta
31bd172185 [ruby/irb] Suppress "shadowing outer" warning
https://github.com/ruby/irb/commit/8b83fbef69
2020-12-23 21:26:25 +09:00
aycabta
841d22ea47 [ruby/reline] [ruby/irb] Handle multiple newlines in a token correctly
Co-authored-by: manga_osyo <manga.osyo@gmail.com>
Co-authored-by: ima1zumi <mariimaizumi5@gmail.com>

https://github.com/ruby/irb/commit/c59a9be82f

https://github.com/ruby/reline/commit/a7922da16b
2020-12-23 06:06:07 +09:00
Takeru Naito
be5faa2519 [ruby/irb] Make it possible to use measure even if it is installed as gem
Include the file that implements this command in the irb gem.

Co-Authored-By: scivola <scivola@users.noreply.github.com>

https://github.com/ruby/irb/commit/d8dfea5b57
2020-12-23 06:06:07 +09:00
aycabta
0b14abe8e7 [ruby/irb] Suppress "shadowing outer" warning
https://github.com/ruby/irb/commit/27b149c599
2020-12-22 23:45:43 +09:00
aycabta
fbcdcbff0d [ruby/irb] Version 1.2.9
https://github.com/ruby/irb/commit/9668e5fe6b
2020-12-22 23:45:43 +09:00
aycabta
4131cd05be [ruby/irb] Support arg for measure command
https://github.com/ruby/irb/commit/b43f35d8f3
2020-12-22 23:45:43 +09:00
aycabta
47b26795d0 [ruby/irb] Change variables handling for compatibility
https://github.com/ruby/irb/commit/26fd1a75cf
2020-12-22 23:45:43 +09:00
Nobuyoshi Nakada
4b6e3f7b82
irb: Define extension command on the given object 2020-12-20 19:35:59 +09:00
Nobuyoshi Nakada
feea436feb
irb: Define extension command only on the given object
Not to interfer in class variables.
2020-12-20 18:26:38 +09:00
aycabta
24fcbc92b4 [ruby/irb] Version 1.2.8
https://github.com/ruby/irb/commit/bcd96834c7
2020-12-20 16:23:59 +09:00
aycabta
9f08e3c703 [ruby/irb] Add measure command
You can use "measure" command to check performance in IRB like below:

  irb(main):001:0> 3
  => 3
  irb(main):002:0> measure
  TIME is added.
  => nil
  irb(main):003:0> 3
  processing time: 0.000058s
  => 3
  irb(main):004:0> measure :off
  => nil
  irb(main):005:0> 3
  => 3

You can set "measure :on" by "IRB.conf[:MEASURE] = true" in .irbrc, and, also,
set custom performance check method:

  IRB.conf[:MEASURE_PROC][:CUSTOM] = proc { |context, code, line_no, &block|
    time = Time.now
    result = block.()
    now = Time.now
    puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE]
    result
  }

https://github.com/ruby/irb/commit/3899eaf2e2
2020-12-20 16:23:59 +09:00
aycabta
8b6aaeaddf [ruby/irb] Handle rest of tokens correctly if no newline at last
https://github.com/ruby/irb/commit/f3c8edad2a
2020-12-20 16:23:58 +09:00
aycabta
dc61affd67 [ruby/reline] [ruby/irb] Call ripper only once when generating dynamic prompt
https://github.com/ruby/irb/commit/babb122a48

https://github.com/ruby/reline/commit/e6dbcb3b42
2020-12-19 02:12:11 +09:00
Marc-Andre Lafortune
980f994b3b [ruby/irb] Change context-mode's default to new mode 4.
This new mode uses a copy of the TOPLEVEL_BINDING. This is compatible with refinements (contrary to mode 3), while keeping nested IRB sessions separate

https://github.com/ruby/irb/commit/25c731cb2f
2020-12-17 20:24:08 +09:00
Jeremy Evans
753222d72c [ruby/irb] Enable deprecation warnings when using -W or -w
Requested in Ruby Bug 17377

https://github.com/ruby/irb/commit/698f6eb34a
2020-12-17 20:23:49 +09:00
Nobuyoshi Nakada
b5effe07bd [ruby/irb] Fixed a typo in a comment [ci skip]
https://github.com/ruby/irb/commit/ce373417f3
2020-12-17 20:22:55 +09:00
Nobuhiro IMAI
cbf6a7f906 [ruby/irb] workaround for lack of tokens from Ripper.lex
* Fixes 

https://github.com/ruby/irb/commit/905fb8e52e
2020-12-17 20:22:29 +09:00
Benoit Daloze
afb8aba4af [ruby/irb] Add a fallback for check_code_block that does not depend on implementation-private APIs
* Fixes https://github.com/ruby/irb/issues/133

https://github.com/ruby/irb/commit/5eb3ef3293
2020-11-22 21:00:11 +09:00
Nobuhiro IMAI
5218f17737 [ruby/irb] support more body argument for oneliner method definition
https://github.com/ruby/irb/commit/2ff1295533
2020-11-22 21:00:11 +09:00
NARUSE, Yui
3407b7d8a6 Revert "Prefer #send over #__send__ when it is clear there is no possible conflict"
This reverts commit 4dba0c1a8e.

Matz's comment is "send is not deprecated. __send__ is safer".
But "Prefer #send over #__send__" is not reasonable.
2020-11-05 20:54:34 +09:00
Benoit Daloze
4dba0c1a8e Prefer #send over #__send__ when it is clear there is no possible conflict
* Reverts part of 3198e7abd7.
* If the rule is #send should be deprecated, that should be ruled by matz,
  there is no such rule currently and gems seem to prefer #send
  overwhelmingly.
2020-11-05 11:23:27 +01:00
Nobuyoshi Nakada
3198e7abd7
Separate send into public_send and __send__ 2020-10-27 16:12:45 +09:00
aycabta
e193dd1e3d [ruby/irb] Version 1.2.7
https://github.com/ruby/irb/commit/0eaa06838b
2020-09-19 05:13:08 +09:00
aycabta
555ea83344 [ruby/irb] Drop OMIT_ON_ASSIGNMENT and add :truncate option for ECHO_ON_ASSIGNMENT
https://github.com/ruby/irb/commit/4c89b0775b
2020-09-19 05:13:08 +09:00
aycabta
b682e0fc21 [ruby/irb] Version 1.2.6
https://github.com/ruby/irb/commit/5a7dd8c3bf
2020-09-14 02:14:02 +09:00
aycabta
5bb9e12573 [ruby/irb] Need calculate_width and split_by_width of Reline::Unicode of reline 0.1.5 or later
https://github.com/ruby/irb/commit/c05bc9e595
2020-09-14 02:13:32 +09:00
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
5d841f5631 [ruby/irb] Version 1.2.5
https://github.com/ruby/irb/commit/07beb3964d
2020-09-14 02:12:58 +09:00
aycabta
8882927036 [ruby/irb] Discard newlines at end of file
https://github.com/ruby/irb/commit/0b2773d91d
2020-08-28 11:05:18 +09:00
Hiroshi SHIBATA
8fb02b7a97
Update the license for the default gems to dual licenses 2020-08-18 20:26:39 +09:00
aycabta
a30dea5852 [ruby/irb] Support shortening lambda notetion for nesting level of prompt
https://github.com/ruby/irb/commit/f1a775af47
2020-08-18 14:38:02 +09:00
aycabta
43c648c832 [ruby/irb] Support shortening lambda notation
https://github.com/ruby/irb/commit/8e3f81d428
2020-08-18 14:38:02 +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
7fa86de15b [ruby/irb] Workaround a bug of ruby-mode.el
https://github.com/ruby/irb/commit/6dfd59400d
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada
82d4da7816 [ruby/irb] Yet another unnecessary readline
https://github.com/ruby/irb/commit/933841af11
2020-08-18 14:38:01 +09:00
Nobuyoshi Nakada
0fcbd07247 [ruby/irb] Directly check if the method is available instead of version
https://github.com/ruby/irb/commit/3ea9fd9ed0
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
Nobuyoshi Nakada
d32229e338 [ruby/irb] Prefer require_relative to load the files in this library
https://github.com/ruby/irb/commit/0ac3bc7296
2020-08-18 14:38:01 +09:00
aycabta
126e1fc296 [ruby/irb] Make history infinite if set SAVE_HISTORY to negative
https://github.com/ruby/irb/commit/824473e880
2020-08-18 14:38:01 +09:00
aycabta
ef498a016b [ruby/irb] Suppress crash when bignum is set to SAVE_HISTORY
https://github.com/ruby/irb/commit/5044eb2730
2020-08-18 14:38:01 +09:00
aycabta
6f0ef83de7 [ruby/irb] Symbol.all_symbols was adopted by Ruby 1.8.0 or later
https://github.com/ruby/irb/commit/71ba754e8e
2020-08-18 14:38:01 +09:00
aycabta
5474007d61 [ruby/irb] Support oneline method definition
https://github.com/ruby/irb/commit/826ae909c9
2020-08-18 14:38:01 +09:00