Commit graph

81 commits

Author SHA1 Message Date
Nobuyoshi Nakada
c7601fb9ed [ruby/irb] Deal with different screen sizes
7118b3322f
2021-05-08 15:29:36 +09:00
Masataka Pocke Kuwabara
de96ae9b71 [ruby/irb] Dump ancestors' methods by ls command
73edff287c
2021-05-08 14:00:40 +09:00
Nobuyoshi Nakada
4b92633043 [ruby/irb] Suppress verbose messages in the parallel test
`:VERBOSE` flag needs to be set prior to `IRB::Irb.new`.

0dbe292979
2021-04-05 14:00:21 +09:00
Takashi Kokubun
9e336f73fb [ruby/irb] Add show_source command
108cb04352
2021-04-02 16:40:06 +09:00
Nobuyoshi Nakada
ccb0b7ab7d [ruby/irb] Suppress verbose messages in the parallel test
`:VERBOSE` flag needs to be set prior to `IRB::Irb.new`.

78604682d9
2021-04-02 01:47:58 +09:00
aycabta
a1938ec308 [ruby/irb] Always add input method when calling Irb.new in tests
When passes input method as nil to Context.new through Irb.new,
ReidlineInputMethod.new is executed and the global internal state of Reline is
rewritten, therefore other tests are failed in the Ruby repository. This
commit changes to use TestInputMethod.

010dce9210
2021-03-29 05:10:08 +09:00
Nobuyoshi Nakada
4bc09c9696
Suppress verbose messages
Get rid of warnings in the parallel test.

```
unknown command: "Switch to inspect mode."
```
2021-03-23 08:20:02 +09:00
Takashi Kokubun
450d1f2c5c [ruby/irb] Deal with different screen sizes
e.g. 20210321T063003Z.fail.html.gz

ddb3472ba2
2021-03-21 15:57:10 +09:00
Takashi Kokubun
232433f224 [ruby/irb] Add whereami command
bc822e4aac
2021-03-21 13:40:21 +09:00
Takashi Kokubun
5f72962a09 [ruby/irb] Implement ls command
19b6c20604
2021-03-21 12:59:51 +09:00
Kazuhiro NISHIYAMA
e0dd072978
Fix errors when XDG_CONFIG_HOME points to non-writable directory
`$HOME/.config` is not writable on CI
because I think tests should not corrupt user's data.

And GitHub Actions CI sets `XDG_CONFIG_HOME`
since `Version: 20210309.1`.

2130811016 (step):16:301
```
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
```
2021-03-18 15:20:41 +09:00
aycabta
6eb5b3ac27 [ruby/irb] The command "irb_info" should show RUBY_PLATFORM
39d1cd874f
2021-02-11 20:36:43 +09:00
aycabta
7b354cf67b [ruby/irb] Enable to reassign a new block with "measure" command
b444573aa2
2021-02-06 21:09:31 +09:00
aycabta
5704b5fe5e [ruby/irb] Allow "measure" command to take block
20f1ca23e9
2021-02-06 20:45:08 +09:00
aycabta
80fb4758a9 In test, need to pass a context to IRB::WorkSpace.new explicitly 2021-01-27 18:33:36 +09:00
Nobuhiro IMAI
69b42ae02d [ruby/irb] specify the VERBOSE to false and fix tests to fit
502c590925
2021-01-27 15:02:13 +09:00
Nobuhiro IMAI
e80e5a2f89 [ruby/irb] use RubyLex::TerminateLineInput appropriately [Bug #17564]
* using the appropriciate exception instead of `break` so that the session
  can be continue after the `irb_source` and `irb_load` commands
* suppress extra new line due to one more `#prompt` call

bdefaa7cfd
2021-01-27 15:02:05 +09:00
Nobuyoshi Nakada
8680ae9cbd
irb: Removed unused variables 2020-12-20 19:36:24 +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
Nobuyoshi Nakada
0fad9a9e30
Set non-verbose mode as well as tty mode 2020-12-20 17:15:02 +09:00
aycabta
59b84fbf2e Set :DEFAULT to PROMPT_MODE for CI 2020-12-20 17:07:24 +09:00
aycabta
216a087e93 Suppress errors related to using variables that are not directly related to testing 2020-12-20 16:48:47 +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
  }

3899eaf2e2
2020-12-20 16:23:59 +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
cdbb9dfc9f
2020-04-29 19:13:14 +09:00
aycabta
98a346d065 [ruby/irb] Add irb_info command
a6fe58e916
2020-04-29 19:13:14 +09:00