aycabta
9a07915ae2
Add aliases for commands for changing text macro
2019-06-04 08:35:01 +09:00
aycabta
4b7213a85a
Implement transpose-words
2019-06-04 07:23:36 +09:00
Takashi Kokubun
0da9205f15
Remove conflict resolution mistake [ci skip]
...
in de541fe196
🙇
2019-06-04 00:32:17 +09:00
Takashi Kokubun
d21a694075
Improve test_color to prevent regression
...
Actually de541fe196
was still needed.
This commit would improve the test coverage using the branch.
2019-06-04 00:29:54 +09:00
Takashi Kokubun
de541fe196
colorize_code must return escaped text
...
This was needed before 0c459af7c2
but it
could be actually useless now. But I added this anyway just in case.
2019-06-04 00:26:02 +09:00
Nobuyoshi Nakada
0c459af7c2
Colorize error characters
...
* lib/irb/color.rb (IRB::Color.scan): ignore "incomplete end of
input" error only, to colorize invalid characters, e.g., control
characters, and invalid symbols, as errors.
2019-06-04 00:14:55 +09:00
Nobuyoshi Nakada
c990b3c41a
Fix the error token on "invalid hex escape"
...
* parse.y (tok_hex): flush token after dispatching the "invalid
hex escape" parse error.
2019-06-03 15:15:54 +09:00
Jeremy Evans
17af8bfce6
Make size on an infinite each_slice enumerator return Infinity
...
Fixes [Bug #15889 ]
2019-06-02 20:00:35 -07:00
Kazuhiro NISHIYAMA
533070bfc6
Use lines instead of split
...
```
% cat ~/bench-split.yml
prelude: |
s = "foo\nbar\nbaz\n"
benchmark:
'/(?<=\n)/': |
s.split(/(?<=\n)/)
'/^/': |
s.split(/^/)
'lines': |
s.lines
Warming up --------------------------------------
/(?<=\n)/ 459.123k i/s - 467.844k times in 1.018994s (2.18μs/i)
/^/ 467.922k i/s - 469.744k times in 1.003894s (2.14μs/i)
lines 2.343M i/s - 2.424M times in 1.034677s (426.84ns/i)
Calculating -------------------------------------
/(?<=\n)/ 422.347k i/s - 1.377M times in 3.261232s (2.37μs/i)
/^/ 477.603k i/s - 1.404M times in 2.939186s (2.09μs/i)
lines 2.485M i/s - 7.028M times in 2.828757s (402.47ns/i)
Comparison:
lines: 2484631.6 i/s
/^/: 477603.3 i/s - 5.20x slower
/(?<=\n)/: 422346.5 i/s - 5.88x slower
```
2019-06-03 10:32:32 +09:00
aycabta
182072b211
The C-q is also quoted insert in emacs mode
2019-06-03 04:17:52 +09:00
aycabta
5524de5ca0
Add aliases for commands for moving macro
2019-06-03 03:41:40 +09:00
aycabta
1bfba99b79
Close leaked file descripters in tests
2019-06-03 03:38:39 +09:00
aycabta
3428922437
The ed_move_to_beg is different from vi_first_print
2019-06-03 03:29:34 +09:00
Nobuyoshi Nakada
3457ce4486
Fix ArgumentError in aliased macro
...
Closes: https://github.com/ruby/ruby/pull/2221
2019-06-03 01:35:48 +09:00
Nobuyoshi Nakada
f4b060d8d7
Check conditional nestings in INPUTRC
...
Closes: https://github.com/ruby/ruby/pull/2222
2019-06-02 22:58:05 +09:00
Kazuhiro NISHIYAMA
4fda39fc87
Use simpler regexp
2019-06-02 22:37:42 +09:00
Nobuyoshi Nakada
d04ebc57f2
Add true condition `Reline`
2019-06-02 20:31:25 +09:00
aycabta
486a2c26d6
Add Reline test for unknown macro
2019-06-02 08:50:01 +09:00
aycabta
e360688c4d
Add new test for Reline within pipe
2019-06-02 07:39:12 +09:00
Jeremy Evans
4b9869e7e0
Update String#crypt tests to work on OpenBSD
...
Skip the webrick httpauth tests that use crypt when testing on
OpenBSD.
Fixes [Bug #11363 ]
2019-06-01 10:50:06 -07:00
Hiroshi SHIBATA
2bad001cfd
Ignore warnings about mismatched indentations.
2019-06-01 15:23:24 +03:00
Hiroshi SHIBATA
464e55f1d0
Ignore warnings about argument prefix with operator symbol.
2019-06-01 15:20:21 +03:00
Hiroshi SHIBATA
3c77ef9adc
Ignore warnings about ambiguous first argument with the negative integer.
2019-06-01 15:07:35 +03:00
Hiroshi SHIBATA
9eecd7a2fd
Ignore warnings about ambiguous first argument of regexp with assert match.
2019-06-01 14:44:24 +03:00
Hiroshi SHIBATA
56660de3c6
Merge rubygems master from upstream.
...
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
2019-06-01 13:50:41 +03:00
aycabta
de01c4ec00
Reset Config at Reline::Config::Test#teardown
2019-06-01 16:47:59 +09:00
aycabta
7df65ef676
Use inputrc data for keystroke setting
2019-06-01 09:06:27 +09:00
Nobuyoshi Nakada
c1e5299787
Fix FrozenError when assigning frozen class to constant
...
* variable.c (set_namespace_path): modules/classes can get named
by assignment to constant, even if frozen. [Bug #15891 ]
2019-06-01 02:41:14 +09:00
Alan Wu
ea42423908
Keep vm->orig_progname alive
...
`vm->orig_progname` can be different from `vm->progname` when user
code assigns to `$0`. While `vm->progname` is kept alive by the
global table, nothing marked `vm->orig_progname`.
[Bug #15887 ]
2019-05-31 14:38:35 +09:00
Jeremy Evans
e8c710b11a
Fix visibility of some methods when using DelegateClass
...
Public instance methods added to a delegated class after the
creation of the delegate class were not returned by the
public_instance_methods class method of the delegate class.
Protected instance methods in the delegated class when the
delegate class is created were returned by the public_methods
instance method of the delegate class.
Patch mostly from Kenichi Kamiya <kachick1@gmail.com> in
GitHub pull request 926. Minor changes to get it to apply,
and to fix tests after applying by me.
Fixes [Bug #11512 ]
2019-05-30 18:34:45 -07:00
Jeremy Evans
1cd93f1cdf
Allow DelegateClass() to module_eval given block
...
Methods that return classes often module_eval the given block
(e.g. Class.new and Struct.new). This allows DelegateClass to
work similarly. This makes it easier to use DelegateClass
directly without subclassing, so as not to create an unnecessary
subclass.
Implements [Feature #15842 ]
2019-05-30 18:34:45 -07: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
Nobuyoshi Nakada
92ecf58b1e
parse.y: adjust here-doc error token
...
* parse.y (here_document): adjust token to the here-doc identifier
in compile_error when a here-document misses the closing
identifier.
2019-05-30 22:03:33 +09:00
Nobuyoshi Nakada
b0e2b7a5ff
Include stack elements left after errors
2019-05-30 21:54:38 +09:00
Nobuyoshi Nakada
4a31c1e45d
parse.y: continue after heredoc error
...
* parse.y: continue parsing the rest of the here-document starting
line, after the terminator was not found.
2019-05-30 12:38:50 +09:00
Nobuyoshi Nakada
5b64d7ac6e
Colorize errors more
...
* lib/irb/color.rb (IRB::Color.colorize_code): colorize
`compile_error` part as same as `on_parse_error`.
2019-05-29 22:09:54 +09:00
Nobuyoshi Nakada
1da5c73932
parse.y: fix state after ivar/cvar
...
* parse.y (parse_atmark): return EXPR_END or EXPR_ENDFN, depending
on the previous state, even incomplete names consistently.
2019-05-29 21:42:58 +09:00
Nobuyoshi Nakada
068d327595
Colorize compile_error as same as on_parse_error
2019-05-29 13:34:19 +09:00
Nobuyoshi Nakada
cc66272e50
parse.y: flush invalid char
2019-05-29 13:24:24 +09:00
Yusuke Endoh
e04d10b28f
test/rubygems/test_gem_stream_ui.rb (test_ask_for_password): extend the timeout
...
for Solaris.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20190528T191908Z.fail.html.gz
2019-05-29 13:01:53 +09:00
aycabta
3f13297923
Remove extra items because Reline::HISTORY is a sized queue
2019-05-29 10:04:58 +09:00
Takashi Kokubun
98ba116d40
Revert 3b7862c8e8
causing various CI hangs
...
and dependent commits c67934b1c3
and
f0d1dc5cee
.
RubyCI and ci.rvm.jp are almost dead by timeout since this commit.
---
Revert "Skip a reline test hanging on Wercker since 3b7862c8e8"
This reverts commit f0d1dc5cee
.
Revert "Remove extra items because Reline::HISTORY is a sized queue"
This reverts commit c67934b1c3
.
Revert "Use existing instances for LineEditor and Config"
This reverts commit 3b7862c8e8
.
2019-05-29 09:05:26 +09:00
Takashi Kokubun
f0d1dc5cee
Skip a reline test hanging on Wercker since 3b7862c8e8
...
like https://app.wercker.com/ruby/ruby/runs/mjit-test1/5cedad11105780001c4e7001?step=5cedaf6b48fad200076fe77b
2019-05-29 08:08:54 +09:00
aycabta
c67934b1c3
Remove extra items because Reline::HISTORY is a sized queue
2019-05-29 05:58:33 +09:00
aycabta
3b7862c8e8
Use existing instances for LineEditor and Config
2019-05-29 05:53:44 +09:00
Nobuyoshi Nakada
c730c25354
parse.y: warn escaped whitespace
...
* parse.y (warn_space_char_code): warn whitespace characters
escaped with meta/control prefix.
2019-05-29 00:00:26 +09:00
Yusuke Endoh
ae2a904ce9
Update the certificate files to make the test pass on Debian 10
...
The old certificate files (for example, test/rubygems/ca_cert.pem) were
signed by SHA1. This message digest is considered too weak and rejected
by OpenSSL 1.1.1 or later. Because of this, the test suite does not
pass on Debian 10.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190527T123003Z.fail.html.gz#test%2Frubygems
This change regenerates the files.
A shell script for the regeneration (util/create_certs.sh) is also
added.
2019-05-28 10:07:29 +09:00
Nobuyoshi Nakada
1cdaa17a06
parse.y: numbered parameter symbol
...
* parse.y (parse_atmark): numbered parameter name is not allowed
as a symbol regardless the context.
2019-05-28 09:00:02 +09:00
aycabta
57b4df07bc
Use Reline.completer_quote_characters to complete
2019-05-28 08:38:55 +09:00
Nobuyoshi Nakada
8a2a5822ca
Colorize error part
2019-05-27 23:08:51 +09:00