aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* release RUBYGEMS_ACTIVATION_MONITOR correctly.Koichi Sasada2019-11-121-2/+10
| | | | | | `File.symlink? safe_lp` can raise SecurityError and raising an exception can leave RUBYGEMS_ACTIVATION_MONITOR locking. This patch release it correctly.
* more messagesKoichi Sasada2019-11-121-1/+1
|
* check monitor is owning for debugKoichi Sasada2019-11-121-0/+5
|
* Revert "Try to revert the test failure with Ruby CI"Hiroshi SHIBATA2019-11-111-3/+7
| | | | This reverts commit 8b27c23b5d55bd707a89bb5d95d2bdba9e132c1a.
* Try to revert the test failure with Ruby CIHiroshi SHIBATA2019-11-111-7/+3
| | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian9/ruby-master/log/20191111T093005Z.fail.html.gz
* Merge RubyGems 3.1.0.pre3Hiroshi SHIBATA2019-11-112-4/+8
| | | | | | | | | | | | | | | | | | | * Fix gem pristine not accounting for user installed gems. Pull request #2914 by Luis Sagastume. * Refactor keyword argument test for Ruby 2.7. Pull request #2947 by SHIBATA Hiroshi. * Fix errors at frozen Gem::Version. Pull request #2949 by Nobuyoshi Nakada. * Remove taint usage on Ruby 2.7+. Pull request #2951 by Jeremy Evans. * Check Manifest.txt is up to date. Pull request #2953 by David Rodríguez. * Clarify symlink conditionals in tests. Pull request #2962 by David Rodríguez. * Update command line parsing to work under ps. Pull request #2966 by David Rodríguez. * Properly test `Gem::Specifications.stub_for`. Pull request #2970 by David Rodríguez. * Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request #2985 by MSP-Greg.
* Remove unneeded exec bits from some filesDavid Rodríguez2019-11-092-0/+0
| | | | | | | | | | | | | 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' _ {} \; ```
* [rubygems/rubygems] Make sure our modifications to kernel.warn workDavid Rodríguez2019-09-261-0/+1
| | | | | | And test the fix we're adding. https://github.com/rubygems/rubygems/commit/6f86637b98
* [rubygems/rubygems] Fix jruby buildDavid Rodríguez2019-09-261-1/+5
| | | | https://github.com/rubygems/rubygems/commit/cc255b774a
* [rubygems/rubygems] Introduce default prerelease requirementDavid Rodríguez2019-09-261-1/+1
| | | | https://github.com/rubygems/rubygems/commit/506c5bce49
* Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans2019-09-251-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cfuncs that use rb_scan_args with the : entry suffer similar keyword argument separation issues that Ruby methods suffer if the cfuncs accept optional or variable arguments. This makes the following changes to : handling. * Treats as **kw, prompting keyword argument separation warnings if called with a positional hash. * Do not look for an option hash if empty keywords are provided. For backwards compatibility, treat an empty keyword splat as a empty mandatory positional hash argument, but emit a a warning, as this behavior will be removed in Ruby 3. The argument number check needs to be moved lower so it can correctly handle an empty positional argument being added. * If the last argument is nil and it is necessary to treat it as an option hash in order to make sure all arguments are processed, continue to treat the last argument as the option hash. Emit a warning in this case, as this behavior will be removed in Ruby 3. * If splitting the keyword hash into two hashes, issue a warning, as we will not be splitting hashes in Ruby 3. * If the keyword argument is required to fill a mandatory positional argument, continue to do so, but emit a warning as this behavior will be going away in Ruby 3. * If keyword arguments are provided and the last argument is not a hash, that indicates something wrong. This can happen if a cfunc is calling rb_scan_args multiple times, and providing arguments that were not passed to it from Ruby. Callers need to switch to the new rb_scan_args_kw function, which allows passing of whether keywords were provided. This commit fixes all warnings caused by the changes above. It switches some function calls to *_kw versions with appropriate kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS is used. If creating new arguments, RB_PASS_KEYWORDS is used if the last argument is a hash to be treated as keywords. In open_key_args in io.c, use rb_scan_args_kw. In this case, the arguments provided come from another C function, not Ruby. The last argument may or may not be a hash, so we can't set keyword argument mode. However, if it is a hash, we don't want to warn when treating it as keywords. In Ruby files, make sure to appropriately use keyword splats or literal keywords when calling Cfuncs that now issue keyword argument separation warnings through rb_scan_args. Also, make sure not to pass nil in place of an option hash. Work around Kernel#warn warnings due to problems in the Rubygems override of the method. There is an open pull request to fix these issues in Rubygems, but part of the Rubygems tests for their override fail on ruby-head due to rb_scan_args not recognizing empty keyword splats, which this commit fixes. Implementation wise, adding rb_scan_args_kw is kind of a pain, because rb_scan_args takes a variable number of arguments. In order to not duplicate all the code, the function internals need to be split into two functions taking a va_list, and to avoid passing in a ton of arguments, a single struct argument is used to handle the variables previously local to the function.
* Revert "`Gem.load_path_insert_index always returns non-nil index after Ruby 1.9"Hiroshi SHIBATA2019-08-171-1/+1
| | | | | | This reverts commit 260ef51a73c067599826c8ab110c53994c1b6226. This broke the stable versions of Ruby like 2.4 and 2.5
* Added comments for extended require by RubyGemsHiroshi SHIBATA2019-08-171-1/+3
|
* `Gem.load_path_insert_index always returns non-nil index after Ruby 1.9Hiroshi SHIBATA2019-08-171-1/+1
|
* Try to continue on LoadError with gem_original_requireHiroshi SHIBATA2019-08-171-2/+6
|
* Keep the existance behavior with symlink pathHiroshi SHIBATA2019-08-171-1/+3
|
* Revert "Revert "[rubygems/rubygems] [Require] Ensure -I beats a default gem""Hiroshi SHIBATA2019-08-171-0/+20
| | | | This reverts commit 75d29db8f965893bb6ab38b9008abc80cdda246e.
* Revert "[rubygems/rubygems] [Require] Ensure -I beats a default gem"Hiroshi SHIBATA2019-08-171-20/+0
| | | | This reverts commit 00cd5d74cecb6aa4a184e57e2b8246ef6e45d458.
* Fixed Insecure Operation in requireHiroshi SHIBATA2019-08-171-1/+1
| | | | Caused by 00cd5d74ce
* [rubygems/rubygems] Don't unregister default specificationsDavid Rodríguez2019-08-171-1/+0
| | | | | | I think this should be more efficient? https://github.com/rubygems/rubygems/commit/a1de78104f
* [rubygems/rubygems] Fix jruby issueDavid Rodríguez2019-08-171-2/+2
| | | | https://github.com/rubygems/rubygems/commit/fc3f722164
* [rubygems/rubygems] Fix old rubies compatDavid Rodríguez2019-08-171-1/+1
| | | | https://github.com/rubygems/rubygems/commit/41e60cdb6b
* [rubygems/rubygems] [Require] Ensure -I beats a default gemSamuel Giddins2019-08-171-0/+20
| | | | https://github.com/rubygems/rubygems/commit/6fbda98eb3
* Merge rubygems master from upstream.Hiroshi SHIBATA2019-06-011-3/+0
| | | | I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
* Update rubygems with latest upstream changesDavid Rodríguez2019-04-281-1/+1
| | | | Closes: https://github.com/ruby/ruby/pull/2154
* Merge RubyGems master@9be7858f7f17eae3058204f3c03e4b798ba18b9chsbt2019-02-141-2/+2
| | | | | | | | | | | This version contains the some style changes by RuboCop. * https://github.com/rubygems/rubygems/commit/9d810be0ede925fb2e3af535848582c3f8e0e72f * https://github.com/rubygems/rubygems/commit/61ea98a727fb1b76b6fac52d74107ee4b02aaef2 * https://github.com/rubygems/rubygems/commit/795893dce3c5f8540804fc08144cc6a90f086b13 * https://github.com/rubygems/rubygems/commit/9be7858f7f17eae3058204f3c03e4b798ba18b9c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge master branch from rubygems/rubygems upstream.hsbt2018-11-211-6/+6
| | | | | | | | | | | | | * Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge upstream from rubygems/rubygems master branch.hsbt2018-10-311-14/+31
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Check whether to skip every framenobu2018-09-241-2/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Kernel#warn accepts multiple messagesnobu2018-09-241-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* kernel_warn.rb: skip kernel_require.rbnobu2018-09-241-0/+21
| | | | | | | * lib/rubygems/core_ext/kernel_warn.rb (Kernel#warn): skip kernel_require.rb's frames when `uplevel` option is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge RubyGems 3.0.0.beta1.hsbt2018-05-301-7/+2
| | | | | | | | | * It drop to support < Ruby 2.2 * Cleanup deprecated methods and classes. * Mark obsoleted methods to deprecate. * and other enhancements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rubygems master.hsbt2017-10-081-8/+4
| | | | | | | This is RC version of Rubygems 2.7.0. https://github.com/rubygems/rubygems/commit/688fb7e83c13c3fe7c2bb03c49a2db4c82852aee git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* release monitor correctly.ko12017-04-201-1/+6
| | | | | | | | | | | * lib/rubygems/core_ext/kernel_require.rb: sometimes `Kernel.send(:gem, spec.name)` can raise some errors (Gem::MissingSpecError I observed) and this method doesn't release RUBYGEMS_ACTIVATION_MONITOR correctly. This patch fix this problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update Rubygems 2.6.10hsbt2017-01-241-1/+1
| | | | | | | * https://github.com/rubygems/rubygems/commit/2ee5bf9fd3bd7649d3e244bc40107ff32070ef47 * https://github.com/rubygems/rubygems/commit/be510dd4097e65c6a256a6e173d6b724a3a96472 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rubygems 2.6.7nobu2016-09-281-4/+8
| | | | | | | * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems to 2.6.7, not the master, with r56225. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rubygems 2.6.7nobu2016-09-281-8/+4
| | | | | | | | * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems to 2.6.7. Release note of 2.6.7: https://github.com/rubygems/rubygems/commit/60f35bd1d2359fc30301d2d4cd72bc6833e8d12a git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.3.hsbt2016-04-061-1/+1
| | | | | | | Please see entries of 2.6.3 on https://github.com/rubygems/rubygems/blob/master/History.txt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.2.hsbt2016-03-281-5/+8
| | | | | | | Please see entries of 2.6.2 on https://github.com/rubygems/rubygems/blob/master/History.txt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.hsbt2016-02-012-2/+2
| | | | | | | | | It supports to enable frozen string literal and add `--norc` option for disable to `.gemrc` configuration. See 2.5.2 release notes for other fixes and enhancements. https://github.com/rubygems/rubygems/blob/a8aa3bac723f045c52471c7b9328310a048561e0/History.txt#L3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-162-0/+2
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).hsbt2015-12-041-3/+1
| | | | | | | this version includes #1396, #1397, #1398, #1399 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems HEAD(c202db2).hsbt2015-07-011-2/+2
| | | | | | | this version contains many enhancements see http://git.io/vtNwF * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems 2.4.5.drbrain2014-12-072-2/+9
| | | | | | | * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert previous commit.usa2014-11-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mkmf.rb (depend_rules): support comments during a line.usa2014-11-151-1/+1
| | | | | | | | * lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency file contains path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)hsbt2014-09-142-23/+20
| | | | | | | | Complete history at: https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update RubyGems to master 0886307. This commitdrbrain2013-10-201-0/+6
| | | | | | | | improves documentation and should bring ruby above 75% documented on rubyci. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems master commit 2a74263. This fixesdrbrain2013-10-161-0/+2
| | | | | | | | | several bugs in RubyGems 2.2.0.preview.1. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r42938 "* lib/rubygems: Update to RubyGems 2.1.3"naruse2013-09-141-5/+25
| | | | | | | It breaks build. http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20130913T200302Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e