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

128 Коммитов

Автор SHA1 Сообщение Дата
aycabta 0faf02718a Use simple assersion 2020-07-22 03:13:17 +09:00
Nobuhiro IMAI f6e789e3b0 [ruby/irb] handle rescue modifier properly
https://github.com/ruby/irb/commit/6de1341f5e
2020-07-22 02:31:47 +09:00
aycabta 22d38d5475 [ruby/irb] Add test_eval_object_without_inspect_method
https://github.com/ruby/irb/commit/c0d9a26bce
2020-07-22 02:31:47 +09:00
aycabta 4268084d69 [ruby/irb] Add encoding magic comments of editors
https://github.com/ruby/irb/commit/f8c10ea24b
2020-07-22 02:31:47 +09:00
aycabta 1dfd24a7fc [ruby/irb] Suppress incomplete encoding magic comment error
https://github.com/ruby/irb/commit/443e90af80
2020-07-22 02:31:46 +09:00
aycabta 78ccab2530 [ruby/irb] Suppress incomplete coding magic comment error
https://github.com/ruby/irb/commit/6a457edbd1
2020-07-22 02:31:46 +09:00
Koichi Sasada c87ee8005b rubygems is needed to run solo-file test 2020-07-15 11:21:14 +09:00
Kazuhiro NISHIYAMA 4314c05377
Fix typos 2020-05-09 14:22:04 +09:00
Yusuke Endoh 1084b679bd Restore the external and internal encodings of STDIN, STDOUT, and STDERR
IRB::ReadlineInputMethod#initialize changes them via IRB.set_encoding.
2020-05-08 00:19:54 +09:00
Yusuke Endoh 3b147c4213 test/irb/test_cmd.rb: clear IRB.@CONF on setup
It caches a path to .irbrc file, which has caused random failure:

```
  1) Failure:
TestIRB::ExtendCommand#test_irb_info_multiline [/home/mame/work/ruby/test/irb/test_cmd.rb:49]:
Expected /
        Ruby\sversion: .+\n
        IRB\sversion:\sirb .+\n
        InputMethod:\sReidlineInputMethod\swith\sReline .+ and .+\n
        \.irbrc\spath: .+
      /x to match "Ruby version: 2.8.0\n" +
"IRB version: irb 1.2.3 (2020-02-15)\n" +
"InputMethod: ReidlineInputMethod with Reline 0.1.4 and /tmp/test_reline_config_155659/.inputrc\n".
```
2020-05-08 00:15:01 +09:00
Nobuyoshi Nakada 4a8acf4625
[ruby/irb] Restore the default encodings
IRB::ReadlineInputMethod#initialize sets via IRB.set_encoding.
2020-04-30 22:54:42 +09:00
Nobuyoshi Nakada 9d1b272b01
[ruby/irb] Suppress messages switching inspect mode 2020-04-30 11:57:08 +09:00
Nobuyoshi Nakada b3ce6fa099
[ruby/irb] Relaxed regexp for readline
Readline::VERSION may not be a single word, e.g EditLine wrapper
when linked with editline.
2020-04-30 11:44:22 +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 22477128cd [ruby/irb] Suppress crashing when EncodingError has occurred without lineno
https://github.com/ruby/irb/commit/13572d8cdc
2020-03-26 17:41:21 +09:00
Kazuhiro NISHIYAMA f5b7896921
Fix a typo [ci skip] 2020-02-29 15:14:01 +09:00
Nobuyoshi Nakada 5e7322b866 [ruby/irb] `yield` outside method definition is a syntax error
https://github.com/ruby/irb/commit/dbc7b059c7
2020-02-21 23:16:15 +09:00
Nobuhiro IMAI 961630126b [ruby/irb] fix reserved words and completion for them
https://github.com/ruby/irb/commit/6184b227ad
2020-02-15 21:52:03 +09:00
Yusuke Endoh fad98c6c61 test/irb/test_completion.rb: suppress a warning: unused literal ignored 2020-02-14 00:07:28 +09:00
aycabta 15cacf1f55 Add test_complete_symbol
The previous version of the test method used a symbol, ":abcdefg" to complete
but longer symbols that can be completed are defined by other test methods of
other libs.
2020-02-12 19:40:10 +09:00
Hiroshi SHIBATA 166c4a6a28
Revert "[ruby/irb] Add test_complete_symbol"
This reverts commit 3af3431c2c.
2020-02-12 14:38:40 +09:00
aycabta 8b8cc01229 [ruby/irb] Fix auto indent with closed brace
A closed brace in auto-indent shouldn't affect the next brace in the same line,
but it behaves like below:

  p() {
    }

It's a bug.

https://github.com/ruby/irb/commit/fbe59e344f
2020-02-12 13:14:28 +09:00
aycabta 0719e1be11 [ruby/irb] Check doc namespace correctly
IRB::InputCompletor::PerfectMatchedProc crashes when doc not found because a
variable name was incorrect.

https://github.com/ruby/irb/commit/889fd4928f
2020-02-12 13:14:28 +09:00
aycabta 3af3431c2c [ruby/irb] Add test_complete_symbol
https://github.com/ruby/irb/commit/dbbf086c1f
2020-02-12 13:14:28 +09:00
Kenta Murata 51a8055d7d [ruby/irb] Add newline_before_multiline_output
https://github.com/ruby/irb/commit/9eb1801a66
2020-01-21 09:51:16 +09:00
Ben c94025b630 [ruby/irb] Fix crashing when multiple open braces per line
https://github.com/ruby/irb/issues/55

If we had put multiple open braces on a line the with no closing brace
spaces_of_nest array keeps getting '0' added to it. This means that when
we pop off of this array we are saying that we should be in position zero
for the next line. This is an issue because we don't always want to be
in position 0 after a closing brace.

Example:
```
[[[
]
]
]
```
In the above example the 'spaces_of_nest' array looks like this after
the first line is entered: [0,0,0]. We really want to be indented 4
spaces for the 1st closing brace 2 for the 2nd and 0 for the 3rd. i.e.
we want it to be: [0,2,4].

We also saw this issue with a heredoc inside of an array.

```
[<<FOO]
hello
FOO
```

https://github.com/ruby/irb/commit/80c69c8272
2020-01-14 15:40:38 +09:00
Ben 9994eb8a5e [ruby/irb] Fix newline depth with multiple braces
This commit fixes the check_newline_depth_difference method to multiple
open braces on one line into account. Before this change we were
subtracting from the depth in check_newline_depth_difference on
every open brace. This is the right thing to do if the opening and
closing brace are on the same line. For example in a method definition we
have an opening and closing parentheses we want to add 1 to our depth,
and then remove it.

```
def foo()
end
```

However this isn't the correct behavior when the brace spans multiple
lines. If a brace spans multiple lines we don't want to subtract from
check_newline_depth_difference and we want to treat the braces the same
way as we do `end` and allow check_corresponding_token_depth to pop the
correct depth.

Example of bad behavior:

```
def foo()
  [
  ]
puts 'bar'
end
```

Example of desired behavior:

```
def foo()
  [
  ]
  puts 'bar'
end
```

https://github.com/ruby/irb/commit/7dc8af01e0
2020-01-14 15:40:38 +09:00
aycabta 049292e302 Add load path and require for ruby/ruby 2020-01-01 02:04:41 +09:00
aycabta 66e6055c11 [ruby/irb] Fix lib name of OpenStruct
https://github.com/ruby/irb/commit/1f3a84ab6b
2020-01-01 01:38:37 +09:00
aycabta 9deb942715 Add "require 'openstruct'" what is forgotten 2019-12-31 23:32:24 +09:00
Ben a118bb805f [ruby/irb] Add tests for RubyLex
The set_auto_indent method calculates the correct number of spaces for
indenting a line. We think there might be a few bugs in this method so
we are testing the current functionality to make sure nothing breaks
when we address those bugs.

Example test failure:

```
  1) Failure:
TestIRB::TestRubyLex#test_auto_indent [/Users/Ben/Projects/irb/test/irb/test_ruby_lex.rb:75]:
Calculated the wrong number of spaces for:
 def each_top_level_statement
  initialize_input
  catch(:TERM_INPUT) do
    loop do
      begin
        prompt
        unless l = lex
          throw :TERM_INPUT if @line == ''
        else
.
<10> expected but was
<12>.
```

https://github.com/ruby/irb/commit/752d5597ab
2019-12-31 23:32:24 +09:00
Nobuyoshi Nakada 84b873e381 [ruby/irb] Restore environment variables
https://github.com/ruby/irb/commit/236590882c
2019-12-14 00:39:53 +09:00
aycabta 4325f08086 Add require "irb" to test/irb/test_completion.rb 2019-11-28 15:32:21 +09:00
aycabta 7d75e94ea9 Fix regexp to complete complex literal
IRB completion logic always needed exponential notation for complex literal
such as 3e6i but it's bug. I fixed to support complex literal without
exponential notation such as 3i.
2019-11-28 15:22:38 +09:00
aycabta 91bf3b7a77 Use singleline/multiline instead of readline/reidline 2019-11-21 02:44:35 +09:00
aycabta bc0da8e3ff Generate history file path correctly when $HOME/.irbrc doesn't exist 2019-11-20 08:19:58 +09:00
aycabta a5b6d7bca8 Suppress warnings except for when last evaluation
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
2019-11-13 15:15:28 +09:00
Takashi Kokubun fcd9bc28e3
qsymbols and symbols should be colored as Symbol 2019-11-10 13:54:44 -08:00
Takashi Kokubun 25c53a8eec
Colorize on_symbols_beg (%I) 2019-11-10 13:41:41 -08:00
Takashi Kokubun b5996b25ae
Colorize string quotes as bold
like pry
2019-11-10 13:33:23 -08:00
Ary Borenszweig 96617ad1d5 IRB colorize: take into account recursive arrays and hashes (#2555)
[Bug #16250]
2019-10-14 21:25:05 -07:00
Nobuyoshi Nakada ea68bb914a Changed numbered parameter prefix 2019-09-24 21:57:54 +09:00
aycabta 1b02f6c020 Set IRB::Context#return_format on test clarify 2019-08-16 07:10:45 +09:00
Steven Willis 9d2fed2ccd Don't echo results of assignment expressions 2019-08-16 06:02:45 +09:00
Hiroshi SHIBATA b39efb163d
Aliases capture_output to capture_io for test-unit compatiblity. 2019-08-08 17:19:23 +09:00
aycabta 43b52ac0a5 Revert "Don't echo results of assignment expressions"
This reverts commit 1ee88c51b3.
2019-08-06 20:28:48 +09:00
Steven Willis 1ee88c51b3 Don't echo results of assignment expressions 2019-08-06 20:15:07 +09:00
Takashi Kokubun 2a26c1ea24
Clarify the Ruby version support status in IRB more 2019-06-13 00:41:00 +09:00
Takashi Kokubun 1808029061
make sync-default-gems GEM=irb
Upgrade IRB to 41ea43a4a7

Mostly backport changes.
2019-06-13 00:32:20 +09:00