Commit graph

7335 commits

Author SHA1 Message Date
Nobuyoshi Nakada
f90b22e3dc
Revert the line for nextafter.c for FreeBSD make 2019-11-20 15:37:05 +09:00
Nobuyoshi Nakada
c53aec73dd
Configure static extensions only if in charge
Get rid of races in parallel configuration when using the
ext/Setup file.
2019-11-19 15:11:41 +09:00
Nobuyoshi Nakada
e1b2341488
Update dependencies 2019-11-18 23:16:22 +09:00
Jeremy Evans
d03da13b17 [ruby/strscan] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.
2019-11-18 01:00:25 +02:00
Jeremy Evans
afbd8f384a [ruby/openssl] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.
2019-11-18 01:00:25 +02:00
Jeremy Evans
17e8a6eff4 [ruby/io-console] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.
2019-11-18 01:00:25 +02:00
Jeremy Evans
398cd3cc7d [ruby/etc] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

Still untaint the tmpdir object on Ruby <2.7, as returning
a tainted string there could cause problems.
2019-11-18 01:00:25 +02:00
Jeremy Evans
ffd0820ab3 Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
2019-11-18 01:00:25 +02:00
Jeremy Evans
c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
Yuichiro Kaneko
ae33f93836 Update comment of Ripper.lex
This is follow up of 1f7cb4bee9.
2019-11-13 09:50:58 +09:00
Nobuyoshi Nakada
fb6a489af2
Revert "Method reference operator"
This reverts commit 67c5747369.
[Feature #16275]
2019-11-12 17:24:48 +09:00
Jeremy Evans
b38b26c62d
[ruby/bigdecimal] Remove taint checking
This removes the taint checking.  Taint support is deprecated in
Ruby 2.7 and has no effect.  I don't think removing the taint
checks in earlier ruby versions will cause any problems.

1918d466f3
2019-11-12 11:16:07 +09:00
Aaron Patterson
db33ab470c
[ruby/psych] Add a note about safe_load
0910ae5575
2019-11-12 10:43:54 +09:00
Jeremy Evans
30fdee65d9
[ruby/psych] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

I'm not sure if the untaint calls in deduplicate are still needed
after the removal of tainting in the parser.  If they are not
needed, they should be removed.

73c1a2b4e0
2019-11-12 10:35:47 +09:00
Jean Boussier
5ef41c91f0 [ruby/psych] Set required_ruby_version to 2.4.0
4f1746a3c6
2019-11-12 10:30:45 +09:00
Koichi Sasada
fd6445b7e8 Monitor#exit: check monitor ownership.
Monitor#exit should be called by only onwer Thread. However, there
is not check for it.
2019-11-12 10:07:45 +09:00
Nobuyoshi Nakada
65f7e3156f
Removed duplicate file
"./tests/test_helper.rb" and "tests/test_helper.rb" in `s.files`
are same.
2019-11-11 15:57:21 +09:00
David Rodríguez
f48655d04d Remove unneeded exec bits from some files
I noticed that some files in rubygems were executable, and I could think
of no reason why they should be.

In general, I think ruby files should never have the executable bit set
unless they include a shebang, so I run the following command over the
whole repo:

```bash
find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \;
```
2019-11-09 21:36:30 +09:00
Hiroshi SHIBATA
3d731c3694
Promote readline to default gems named readline-ext 2019-11-09 07:32:34 +09:00
Nobuyoshi Nakada
d62abc47c8
Suppress unused variable warning 2019-11-07 23:33:45 +09:00
Nobuyoshi Nakada
929a4aa722
Adjust a fucntion signature 2019-11-05 02:05:46 +09:00
Justin McNally
10c2a08548 Clean up implementation of SOCKSSocket, its confusing and undocumented 2019-11-01 18:40:24 +09:00
Justin McNally
68e0bfcd4a Prefer libsocksd over libsocks 2019-11-01 18:39:59 +09:00
Justin McNally
b800410387 Support libsocksd socks library for SOCKSSocket 2019-11-01 18:39:59 +09:00
Nobuyoshi Nakada
6abf4c4802 [ruby/date] Added update-zonetab target
9bc6e30a82
2019-11-01 17:30:17 +09:00
Jeremy Evans
469545307f [ruby/date] Add more timezone abbreviations
This gets the time zone abbreviations from
https://www.timeanddate.com/time/zones/, and adds unambiguous time
zones not already present in zonetab.list.  See bin/update-abbr
for the program used.

This regenerates zonetab.h using prereq.mk (requires gperf).

Only one test line is added, just to make sure a new time zone
abbreviation is picked up.

Fixes Ruby Bug 16286

702e8b3033
2019-11-01 17:30:14 +09:00
Nobuyoshi Nakada
63f70eb651 [ruby/zlib] Removed no longer used variables
3e98e4cac3
2019-10-31 22:24:00 +09:00
Alan Wu
0aaa15f636 [ruby/zlib] Fix setting mtime to zero in GzipWriter
Before this change, it was not possible to write out zero for the
timestamp part of a Gzip file's header, as calling GzipWriter#mtime with
zero was ignored.

Judging from the docs for `GzipWriter#mtime=`, it should be possible to
indicate that no timestamp is available by calling the method with zero.

310be39cac
2019-10-31 22:23:58 +09:00
Jeremy Evans
ebc884461b
[ruby/stringio] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

60ee9ccd95
2019-10-31 16:24:02 +09:00
Jeremy Evans
3895e548bd [ruby/date] Revert "Simplify #inspect"
This reverts commit af01edd7d8575f544f647dbe8cde5b6ae535d459.

Revert requested by Yui Naruse.

875d563557
2019-10-31 15:51:30 +09:00
glaszig
fce940aac7 [ruby/date] introduce Date::Error, raise Date::Error for every
"invalid <anything>" type of exception

3e55c09ba4
2019-10-31 15:51:25 +09:00
Hiroshi SHIBATA
39281d5774
[ruby/gdbm] Use Gemfile instead of Gem::Specification#add_development_dependency.
bd2e7f6647
2019-10-31 15:34:01 +09:00
Jeremy Evans
b93ab7d693
[ruby/gdbm] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

f9aaa1a08d
2019-10-31 15:34:01 +09:00
Jeremy Evans
290903dba0
[ruby/zlib] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

21711ed0ce
2019-10-31 15:34:01 +09:00
Hiroshi SHIBATA
6c3ed0d71c
Update the latest versions from upstream repository of racc 2019-10-30 21:36:59 +09:00
zverok
2746fd5d50 Update StringIO docs:
* More explanations/examples in class docs;
* Fix links to other methods (remove <code> tag);
* Fix wording of method docs (remove *stringio*
  receiver name, as it is not rendered by modern
  RDoc);
* Add  option mention to linereading
  methods (added in 2.4);
* Several other small fixes.
2019-10-26 10:24:20 -07:00
Jeremy Evans
0c579b0a97 [ruby/dbm] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

1f0ff0bce1
2019-10-26 07:03:33 +09:00
Jeremy Evans
5fe8943fda Fix typo causing Date.new(year, month) to fail
Add a test for this case.
2019-10-24 12:34:51 -07:00
Hiroshi SHIBATA
efd641ffab Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"
This reverts commit ce6caade7c.
2019-10-24 20:58:32 +09:00
Jeremy Evans
b809784817 [ruby/fiddle] Remove taint support (#21)
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.
18d6fb6915
2019-10-24 19:34:49 +09:00
Vít Ondruch
ce6caade7c [ruby/fiddle] Use ffi_closure_free by default. (#20)
* Use ffi_closure_free unconditionally.

The current conditionals reflect historic heritage of FFI. Usage of
ffi_closure_free should be better default nowadays, because libffi 3.0.5
fixing issues of ffi_closure_free should be widely available.

* RUBY_LIBFFI_MODVERSION is not used anymore.

Because `ffi_closure_free()` is not used unconditionally, there is no
other use for RUBY_LIBFFI_MODVERSION define, so drop its usage.

* Use more meaningful variable name.

`ver` variable used to be used to pupulate RUBY_LIBFFI_MODVERSION
define. Since the define was removed, the `libffi_dir` variable name
should better describe the remaining usage of the variable.

c49cc79eb8
2019-10-24 19:34:43 +09:00
Aaron Patterson
7733db665a [ruby/fiddle] Fiddle::Function must maintain a reference to the closure
If the first parameter to Fiddle::Function is a closure object (rather
than an interger), `rb_Integer` will cast it to an integer but not
maintain a reference to the closure.  Then if the closure gets GC'd, we
have a segv.  This commit keeps a reference to the original parameter to
initialize so that the object will not be GC'd.

Fixes: https://bugs.ruby-lang.org/issues/13286

0fc697bbc5
2019-10-24 19:34:15 +09:00
Hiroshi SHIBATA
487d96c6b1
[ruby/date] Use Gemfile instead of Gem::Specification#add_development_dependency.
13c94362c2
2019-10-24 18:39:04 +09:00
zverok
9d3a4ab05b
[ruby/date] Update docs
8c02586a98
2019-10-24 18:39:04 +09:00
zverok
913807bd6c
[ruby/date] Simplify #inspect
af01edd7d8
2019-10-24 18:39:04 +09:00
Jeremy Evans
2e37c1960a
[ruby/date] Remove taint support
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous versions.

519470dc3b
2019-10-24 18:39:04 +09:00
Jeremy Evans
fc0e8d00bc
[ruby/date] Support -Float::INFINITY...date ranges
Fixes Ruby Bug 12961

7f533c2552
2019-10-24 18:39:04 +09:00
Jeremy Evans
4e40ca301c
[ruby/date] Check for numeric arguments in constructors
Previously, the type of these arguments were not checked, leading to
NoMethodErrors in some cases, and TypeErrors in other cases, but not
showing what field was having the problems.  This change makes it so
the field with the problem is included in the error message.

For the valid_*? methods, this changes them to return false if one
of the arguments that should be numeric is not.

Fixes Ruby Bug 11935
Fixes Ruby Misc 15298

a2f4b665f8
2019-10-24 18:39:04 +09:00
Jeremy Evans
9eb798a3f1
[ruby/date] Make julian dates roundtrip through to_time.to_date
Previously, julian dates would not round trip through to_time.to_date,
because Time is always considered gregorian.  This converts the Date
instance from julian to gregorian before converting to Time, ensuring
that an equal date object will be returned if converting that Time
back to Date.

This does result in julian Date objects showing different day values
if converting to Time.

Fixes Ruby Bug 8428.

d8df64555e
2019-10-24 18:39:04 +09:00
git
215e4b8721 * expand tabs. [ci skip]
Tabs were expanded because previously the file did not have any tab indentation.
Please update your editor config, and use misc/expand_tabs.rb in the pre-commit hook.
2019-10-21 11:50:44 +09:00