Commit graph

12086 commits

Author SHA1 Message Date
Nobuyoshi Nakada
75fb0a9afa
Allow mday in Date.iso8601 to be omitted
[Bug #12285]
2019-07-16 09:41:23 +09:00
Nobuyoshi Nakada
0c6c937904
Removed duplicate highlighting 2019-07-15 19:39:47 +09:00
Hiroshi SHIBATA
1b59ed9b49
Move helper file of logger to under the test/logger. 2019-07-15 14:43:08 +09:00
Rafael Mendonça França
58065b8701
[ruby/logger] Add option to set the binary mode of the log device
Without binmode strings with incompatible encoding can't be written in
the file. This is very common in applications that log user provided
parameters.

We need to allow changing the binnary mode because right now it is impossible to use
the built-in log rotation feature when you provide a File object to the
LogDevice, and if you provide a filename you can't have binmode.

9114b3ac7e
2019-07-15 14:43:08 +09:00
Jeremy Evans
f4064a0a0c
[ruby/logger] Set filename when initializing logger with a File object
This should allow reopen to work.  Requested in ruby issue #14595.

bd367aff12
2019-07-15 14:43:08 +09:00
sonots
136196785b
[ruby/logger] Fix to use logger and test-unit in this repo with
`ruby test/logger/test_xxx.rb`

d3c2402340
2019-07-15 14:43:07 +09:00
Samuel Williams
47500f2055
[ruby/logger] Add support for changing severity using bang methods.
ae4c6dfcbb
2019-07-15 14:43:07 +09:00
Tanaka Akira
e4c1b19996 add tests for orphan/not-orphan proc/lambda. 2019-07-15 14:17:27 +09:00
Tanaka Akira
bd494ae79b add tests for "break" in lambda. 2019-07-15 12:59:53 +09:00
aycabta
e2512cff05 Move a test file of Reline to test/reline/ 2019-07-15 10:40:06 +09:00
Tanaka Akira
8f7884761e The default charset of text/* media type is UTF-8.
Thanks for the patch  gareth (Gareth Adams).  [Bug #15933]

-------

Combines two small, but very related changes

1: Treat HTTPS the same as HTTP

Previously, OpenURI followed guidance in RFC2616/3.7.1:

> When no explicit charset parameter is provided by the sender, media
> subtypes of the "text" type are defined to have a default charset
> value of "ISO-8859-1" when received via HTTP.

However this RFC was written before TLS was established and OpenURI was
never updated to treat HTTPS traffic the same way. So, HTTPS documents
received a different default to HTTP documents.

This commit removes the scheme check so that all text/* documents
processed by OpenURI are treated the same way.

In theory this processing gets applied to FTP URIs too, but there's no
mechanism in OpenURI for FTP documents to have Content-Type metadata
appended to them, so this ends up being a no-op.

2: Change default charset for text/* to UTF-8

Replaces the default ISO-8859-1 charset previously defined in RFC2616 (now
obsoleted) with a UTF-8 charset as defined in RFC6838.

Fixes: https://bugs.ruby-lang.org/issues/15933
2019-07-15 09:36:52 +09:00
manga_osyo
04e6b90d5b Remove unused method. 2019-07-15 00:33:16 +09:00
manga_osyo
e6f188ea03 Rename to Reline::History::Test. 2019-07-15 00:18:10 +09:00
manga_osyo
073cc52dcc Add class Reline::History and test. 2019-07-15 00:17:59 +09:00
Kouhei Sutou
198281a71d [ruby/csv] Fix a bug that strip: true removes newlines
5540d35a30
2019-07-14 23:07:31 +09:00
Kouhei Sutou
8392592a0a [ruby/csv] Don't raise on eof?
GitHub: fix #86

Reported by krororo. Thanks!!!

5a8d9d9297
2019-07-14 23:07:31 +09:00
Nobuyoshi Nakada
e8700b596b
Check the result of String#-@ 2019-07-14 20:56:38 +09:00
Takashi Kokubun
d30d404bc4
MJIT Support for getblockparamproxy 2019-07-14 18:04:19 +09:00
Maxime Lapointe
b67b07bd5b Fix links to headings
A previous change made the header's id be fully referenced (for the sidebar I believe) but this broke links to them.
This fixes the issue.
2019-07-14 17:46:16 +09:00
Tanaka Akira
4d9504fe13 Delegates 3 arguments for Pathname.glob.
Thanks for the patch by pocke (Masataka Kuwabara) [Feature #14405].
2019-07-14 17:42:58 +09:00
Tanaka Akira
05aac90a1b Warn open-uri's "open" method at Kernel.
Use URI.open instead.

Thanks for the patch by jeremyevans0 (Jeremy Evans) [Misc #15893].
2019-07-14 17:18:17 +09:00
Koichi Sasada
47b04557b0 Method#inspect with source location.
Method#inspect shows with source location.
[Feature #14145]
2019-07-14 15:46:07 +09:00
Martin Dürst
369ff79394 add encoding conversion from/to CESU-8
Add encoding conversion (transcoding) from UTF-8 to CESU-8
and back. CESU-8 is an encoding similar to UTF-8, but encodes
codepoints above U+FFFF as two surrogates, these surrogates
again being encoded as if they were UTF-8 codepoints. This
preserves the same binary sorting order as in UTF-16. It is
also somewhat similar (although not exactly identical) to an
encoding used internally by Java.

This completes issue #15995.

enc/trans/cesu_8.trans: Add encoding conversion from/to CESU-8
test/ruby/test_transcode.rb: Add tests for above
2019-07-14 10:58:50 +09:00
Nobuyoshi Nakada
e2bee86dc4
Relaxed delta of nanosec from Float time 2019-07-13 09:48:12 +09:00
Nobuyoshi Nakada
00b34b0592
Fixed duplicate test name 2019-07-12 17:52:22 +09:00
Nobuyoshi Nakada
3e7d002118
Check exception flag as a bool [Bug #15987] 2019-07-11 20:04:29 +09:00
Nobuyoshi Nakada
4e038a7e64
Revert "parse.y: Deprecate flip-flops"
This reverts commit bae638ad5b.

[Feature #5400]
2019-07-11 14:52:02 +09:00
Nobuyoshi Nakada
d77b84ca82
$LOAD_PATH.resolve_feature_path
Moved from RubyVM.  [Feature #15903]
2019-07-11 14:05:34 +09:00
Tanaka Akira
d34303ad10 remove an unused variable. 2019-07-11 13:04:07 +09:00
Tanaka Akira
50d85436f8 WEBrick::HTTPResponse create tempfile if required.
WEBrick::HTTPProxyServer implementes HTTP proxy using
WEBrick and Net::HTTP.
WEBrick accepts HTTP/1.0 clients and
Net::HTTP uses always HTTP/1.1.

However HTTP/1.1 supports chunked transfer coding HTTP/1.0 doesn't.

Chunked transfer coding doesn't require that
content-length before the content is sent.
But non-chunked transfer coding require content-length before
the content is sent.

So, when HTTP/1.0 clients connects WEBrick::HTTPProxyServer and
origin server returns chunked response,
WEBrick::HTTPProxyServer needs to store whole content to
know the length of it.

This patch do it using tempfile.
2019-07-11 09:18:41 +09:00
Hiroshi SHIBATA
9f275f7971
Restore support library for only test files that are digest and csv. 2019-07-09 21:16:49 +09:00
Hiroshi SHIBATA
f9a2440866
Restore support library for only test files. 2019-07-09 21:04:07 +09:00
Nobuyoshi Nakada
995ae6d529
Check indent of end against else if present 2019-07-08 17:09:59 +09:00
Nobuyoshi Nakada
e0a3c547dd
Get rid of toplevel methods 2019-07-08 16:05:04 +09:00
Nobuyoshi Nakada
a13636e756
Message to pipe should end with a newline 2019-07-07 18:18:22 +09:00
Nobuyoshi Nakada
d548073f68
Enable indentation warning against if just after else
```ruby
if false
  puts 'false'
else if true
  puts 'true'
end # -:5: warning: mismatched indentations at 'end' with 'if' at 3
end
```

[Feature #15990]
2019-07-07 15:47:40 +09:00
Nobuyoshi Nakada
9d8855b682
Added assertions for Unicode escaped CHAR scanner events 2019-07-06 18:46:00 +09:00
Jeremy Evans
f296c260ef Fix segfault when using method reference operator without using result
Fixes [Bug #15985]
2019-07-05 20:43:38 -07:00
Nobuyoshi Nakada
d746a41e85
Multiple codepoints are not allowed at single character literal
It has unintentionally passed since 2.5.
2019-07-05 22:39:54 +09:00
aycabta
6c2b59f923 Support Control- and Meta- 2019-07-04 20:58:11 +09:00
aycabta
6fa7ed453e Check commented out line in inputrc correctly 2019-07-04 19:29:07 +09:00
Nobuyoshi Nakada
265b9a0edf
Parse key sequence more strictly 2019-07-04 18:54:50 +09:00
Nobuyoshi Nakada
ee861e43f7
Skip indented comment lines [Bug #15981] 2019-07-04 18:47:22 +09:00
Nobuyoshi Nakada
0c3e6e86bd
Suppress uninitialized instance variable warnings 2019-07-04 18:12:08 +09:00
Nobuyoshi Nakada
f19e048d24
Do not dispatch a nil token in ripper
As a comment token includes the newline, so delayed newline token
just follows it should not be dispatched.  [Bug #11485]

Co-Authored-By: Jeremy Evans <code@jeremyevans.net>
2019-07-04 15:58:47 +09:00
Nobuyoshi Nakada
23c92b6f82
Revert self-referencing finalizer warning [Feature #15974]
It has caused CI failures.

* d0cd0866d8

  Disable GC during rb_objspace_reachable_object_p

* 89cef1c56b

  Version guard for [Feature #15974]

* 796eeb6339.

  Fix up [Feature #15974]

* 928260c2a6.

  Warn in verbose mode on defining a finalizer that captures the object
2019-07-04 04:01:06 +09:00
Takashi Kokubun
10cc6bc4d9
Just disable inlining with local varaible for now
This partially reverts commit 712a66b074.

The previous fix made CI strange like:
http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/2124178

Let me just downgrade the behavior for now and deal with it later.

[Bug #15971]
2019-07-03 10:39:22 +09:00
Nobuyoshi Nakada
796eeb6339
Fix up [Feature #15974]
* Fixed warning condition
* Fixed function signature
* Use ident hash
2019-07-03 04:22:41 +09:00
Koichi Sasada
712a66b074 Revert "Avoid corrupting VM stack on inlined setlocal"
This reverts commit ea30dd7025.
because it fails when VM_CHECK_MODE=1.
2019-07-03 03:37:25 +09:00
Jeremy Evans
0f283054e7 Check that String#scrub block does not modify receiver
Similar to the check used for String#gsub.  Can fix possible
segfault.

Fixes [Bug #15941]
2019-07-02 08:34:01 -07:00