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

66405 Коммитов

Автор SHA1 Сообщение Дата
Jean Boussier 2de594ca98
[flori/json] Deduplicate strings inside json_string_unescape
[ci 2]

https://github.com/flori/json/commit/1982070cb8
2021-05-17 19:51:51 +09:00
Jean Boussier 1d2b4ccaf2
[flori/json] Refactor json_string_unescape
https://github.com/flori/json/commit/f398769332
2021-05-17 19:51:50 +09:00
Masafumi Koba 8a974dc83c [flori/json] Fix incorrect `#` position in API doc
This change fixes an incorrect `#` position in the API documentation of the `JSON` module.

https://github.com/flori/json/commit/dc4b62424f
2021-05-17 19:26:03 +09:00
Hiroshi SHIBATA 1f91627c8e
Removed EOL version from .github/workflows/spec_guards.yml 2021-05-17 19:22:52 +09:00
Yusuke Endoh 93fb186dd0 spec/ruby/library/yaml: Test YAML.unsafe_load instead of YAML.load in 3.1 2021-05-17 15:42:22 +09:00
Yusuke Endoh 008a63c477 Revert "Use YAML.unsafe_load instead of YAML.load."
This reverts commit a0e97b0e2e.
2021-05-17 15:32:41 +09:00
Hiroshi SHIBATA e36da7ba18
Revert an accidentally commits at df86a13cc1 2021-05-17 15:28:47 +09:00
Yusuke Endoh 31a757a442 Make the test pass with the old libyaml
I have no idea what result is right, but it fails with libyaml 0.1.7
(bundled with Ubuntu 18.04) anyway.
2021-05-17 14:31:34 +09:00
Yusuke Endoh f367b4ffe7 assert_equal accepts an expected value as the first argument 2021-05-17 14:31:34 +09:00
Hiroshi SHIBATA a0e97b0e2e
Use YAML.unsafe_load instead of YAML.load.
This is a temporary workaround. We should rewrite the examples with
  permitted_classes.
2021-05-17 13:36:55 +09:00
Hiroshi SHIBATA dfecc650c3
Workaround with fbb4e3f96c in yaml/store.rb 2021-05-17 12:57:41 +09:00
Yusuke Endoh ffdf0232ef lib/rdoc/rdoc.rb: Allow only RDoc::Options in .rdoc_options
Follow-up of d8fd92f620. Instead of using
unsafe_load blindly, RDoc::Options is only supposed to be allowed.
2021-05-17 12:53:42 +09:00
Hiroshi SHIBATA d8fd92f620
Workaround with fbb4e3f96c in rdoc 2021-05-17 12:04:40 +09:00
Hiroshi SHIBATA 8e91b969df
Workaround with fbb4e3f96c 2021-05-17 12:00:05 +09:00
Yusuke Endoh da5b283963 test/ostruct/test_ostruct.rb: Use YAML.unsafe_load instead of YAML.load
Follow-up of fbb4e3f96c
2021-05-17 11:36:16 +09:00
Aaron Patterson 42b20bdbfe
[ruby/psych] remove deprecated interface
https://github.com/ruby/psych/commit/0767227051
2021-05-17 11:20:46 +09:00
Aaron Patterson b0e21197ce
[ruby/psych] Bump version
https://github.com/ruby/psych/commit/1df86a2e81
2021-05-17 11:20:46 +09:00
Aaron Patterson fbb4e3f96c
[ruby/psych] Use Psych.safe_load by default
Psych.load is not safe for use with untrusted data.  Too many
applications make the mistake of using `Psych.load` with untrusted data
and that ends up with some kind of security vulnerability.

This commit changes the default `Psych.load` to use `safe_load`.  Users
that want to parse trusted data can use Psych.unsafe_load.

https://github.com/ruby/psych/commit/176494297f
2021-05-17 11:20:45 +09:00
Aaron Patterson c7c2ad5749
[ruby/psych] Introduce `Psych.unsafe_load`
In future versions of Psych, the `load` method will be mostly the same
as the `safe_load` method.  In other words, the `load` method won't
allow arbitrary object deserialization (which can be used to escalate to
an RCE).  People that need to load *trusted* documents can use the
`unsafe_load` method.

This commit introduces the `unsafe_load` method so that people can
incrementally upgrade.  For example, if they try to upgrade to 4.0.0 and
something breaks, they can downgrade, audit callsites, change to
`safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0
smoothly.

https://github.com/ruby/psych/commit/cb50aa8d3f
2021-05-17 11:20:45 +09:00
Hiroshi SHIBATA bcaa6aecea
[ruby/psych] Removed needless platform detection
https://github.com/ruby/psych/commit/57d704fd63
2021-05-17 11:20:45 +09:00
Hiroshi SHIBATA df86a13cc1
[ruby/psych] Import test assertions from ruby/ruby
https://github.com/ruby/psych/commit/01dda86681
2021-05-17 11:20:45 +09:00
Jean Boussier a3ceed50b8
[ruby/psych] Fix symabolize_name with non-string keys
https://github.com/ruby/psych/commit/1c5c29e81f
2021-05-17 11:20:45 +09:00
Jeremy Ebler 830778db95
[ruby/psych] feat: allow scalars and sequences to be styled when dumped
https://github.com/ruby/psych/commit/546154ddb7
2021-05-17 11:20:45 +09:00
Yusuke Endoh 167cff6a5d NEWS.md: mention lib/objspace/trace.rb [Feature #17762] 2021-05-17 08:50:23 +09:00
git 35981cb5e9 * 2021-05-17 [ci skip] 2021-05-17 08:33:31 +09:00
Gabriel Nagy 229cb0fcdb
[Win32] long path name support [Bug #12551]
Implement long path support on Windows by applying Microsoft's
recommended application manifest.

To make this work on both Visual C++ and MinGW, include the manifest as
a resource when generating the resource files. This way it will be
embedded into the executables generated by both compilers.

It's important for the manifest resource to have ID 1, otherwise GCC
will embed a default manifest.

Note that in addition to this, the user needs to have [long paths enabled]
either by modifying the registry or by enabling a group policy.

[long paths enabled]: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-05-17 08:33:08 +09:00
Nobuyoshi Nakada adafa8105f
PAGE_SIZE is never used on msys/mingw 2021-05-16 18:27:47 +09:00
git de6e76ff25 * 2021-05-16 [ci skip] 2021-05-16 00:07:50 +09:00
Kazuhiro NISHIYAMA 8560f34246
Fix a typo [ci skip] 2021-05-16 00:07:22 +09:00
git 3e1d32a233 * 2021-05-15 [ci skip] 2021-05-15 19:13:13 +09:00
aycabta eef406acf4 [ruby/irb] IRB should use the latest Reline, 0.2.5
https://github.com/ruby/irb/commit/34496e20e8
2021-05-15 19:12:57 +09:00
Yusuke Endoh 5f8bca3257 tool/lib/minitest/mock.rb: define Object#stub only when not defined
Recently, lib/rubygems/test_case.rb also defines the method.
2021-05-14 18:10:07 +09:00
Yusuke Endoh f210d456a8 test/objspace/test_objspace.rb: check stderr before stdout
When `require "objspace/trace"` fails, previously the failure says:
```
  1) Failure:
TestObjSpace#test_objspace_trace [/tmp/ruby/v3/src/trunk-mjit/test/objspace/test_objspace.rb:621]:
<3> expected but was
<0>.
```
but this is hard to debug.
2021-05-14 18:07:58 +09:00
Yusuke Endoh 702961a88b test/ruby/test_refinement.rb: prevent "assigned but unused variable" 2021-05-14 15:44:13 +09:00
Yusuke Endoh f691c15792 ext/objspace/lib/objspace/trace.rb: Remove the original Kernel#p
... to disable a "method redefined" warning.

http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210514T050008Z.fail.html.gz
```
  1) Failure:
TestObjSpace#test_objspace_trace [/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/test/objspace/test_objspace.rb:621]:
<["objspace/trace is enabled"]> expected but was
<["/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/.ext/common/objspace/trace.rb:29: warning: method redefined; discarding old p",
 "objspace/trace is enabled"]>.
```
2021-05-14 15:39:57 +09:00
Yusuke Endoh cf1e1879f1 ext/objspace/lib/objspace/trace.rb: Added
This file, when require'ed, starts tracing the object allocations, and
redefines `Kernel#p` to show the allocation site.

This commit is experimental; the library name and APIs may change.

[Feature #17762]
2021-05-14 13:40:32 +09:00
Nobuyoshi Nakada 7cf90f99f5
Refix PAGE_SIZE
* honor actually used headers
* include sys/user.h only when `PAGE_SIZE` is not defined
2021-05-14 09:33:20 +09:00
Nobuyoshi Nakada a168c47728
Make USE_MMAP_ALIGNED_ALLOC static const 2021-05-14 09:31:09 +09:00
Burdette Lamar 434cd3c399
What's Here for BasicObject (#4499)
* What's Here for BasicObject
2021-05-13 17:19:07 -05:00
Burdette Lamar 879cc64d06
What's Here for Kernel (#4488) 2021-05-13 12:09:07 -05:00
git 4155a93c2d * 2021-05-14 [ci skip] 2021-05-14 00:14:52 +09:00
John Hawthorn 0aa4ca1477 Fix compilation with jemalloc on macos
On darwin we avoid including sys/user.h to avoid a conflict. Previously
we still ended up with PAGE_SIZE being defined because the headers for
system malloc define it. However, when compiling with jemalloc nothing
would define PAGE_SIZE.

This commit changes configure.ac so that we never use the PAGE_SIZE
constant on darwin and to always use the sysconf fallback.
2021-05-13 11:14:30 -04:00
Koichi Sasada 2420119f47 skip rb_bug for inconsistent zombies count
It seems a bug but it takes more time to debug.
To stop CI failures, skip this rb_bug on
`RGENGC_CHECK_MODE=2` temporarily.
2021-05-13 18:19:28 +09:00
Nobuyoshi Nakada 110f242ef9
Also `\U` after control/meta is invalid [Bug #17861]
As well as `\u`, `\U` should be invalid there too.
And highlight including `u`/`U` not only the backslash before it.
2021-05-13 12:54:56 +09:00
Jeremy Evans 9ce29c94d8 Avoid improper optimization of case statements mixed integer/rational/complex
Fixes [Bug #17857]
2021-05-12 19:30:05 -07:00
Jeremy Evans 11ae581a4a Fix handling of control/meta escapes in literal regexps
Ruby uses a recursive algorithm for handling control/meta escapes
in strings (read_escape).  However, the equivalent code for regexps
(tokadd_escape) in did not use a recursive algorithm.  Due to this,
Handling of control/meta escapes in regexp did not have the same
behavior as in strings, leading to behavior such as the following
returning nil:

```ruby
/\c\xFF/ =~ "\c\xFF"
```

Switch the code for handling \c, \C and \M in literal regexps to
use the same code as for strings (read_escape), to keep behavior
consistent between the two.

Fixes [Bug #14367]
2021-05-12 18:55:43 -07:00
Yusuke Endoh 9484f9ebdf [rubygems/rubygems] Use `Time.stub :now` to avoid a random failure
Essentially this reverts 45464bfcbdf9f9cfb440950bc57a27d237627a17.
The commit removed a mock of Time.now, which caused a random failure.

http://rubyci.s3.amazonaws.com/ubuntu1804/ruby-master/log/20210512T123004Z.fail.html.gz
```
  1) Failure:
TestGemPackageTarWriter#test_add_file_signer [/home/chkbuild/chkbuild/tmp/build/20210512T123004Z/ruby/test/rubygems/test_gem_package_tar_writer.rb:117]:
Field mtime of the tar header differs..
<"14046746312\u0000"> expected but was
<"14046746311\x00">.
```

Object#stub is defined at f1af59fe02ef2cc58f13e2742e4cc6cf8c2a1a20, so
now `Time.stub :now` works.

https://github.com/rubygems/rubygems/commit/85f60a9ed0
2021-05-13 09:26:13 +09:00
git 9225352bf1 * 2021-05-13 [ci skip] 2021-05-13 00:17:34 +09:00
Yusuke Endoh 31794d2e73 parse.y: Allow "command" syntax in endless method definition
This change allows `def hello = puts "Hello"` without parentheses.

Note that `private def hello = puts "Hello"` does not parse for
technical reason.

[Feature #17398]
2021-05-13 00:14:50 +09:00
git 81513c9dab * remove trailing spaces. [ci skip] 2021-05-12 17:40:52 +09:00