Commit graph

14659 commits

Author SHA1 Message Date
David Rodríguez
95f5194b3c [rubygems/rubygems] Move no_install setting check to a more sensible place
It's only related to the `bundle cache` command, so it should be checked
there.

cf749f8ffa
2022-06-11 18:43:25 +09:00
David Rodríguez
3f69774b76 [rubygems/rubygems] No need to redownload if package already there
285ccbc07e
2022-06-11 18:43:24 +09:00
David Rodríguez
a9077af75b [rubygems/rubygems] No need to overwrite path when there's a remote
d86fb2c316
2022-06-11 18:43:24 +09:00
David Rodríguez
870e5a39d5 [rubygems/rubygems] Remove another unnecessary require
04e6a5ae31
2022-06-11 18:43:24 +09:00
David Rodríguez
692fec4e72 [rubygems/rubygems] Simplify Gem::Security::Exception handling
These days all these errors are raised as `Gem::Security::Exception` so
there's no need to do any matching on the exception message.

bd3403da57
2022-06-11 18:43:23 +09:00
David Rodríguez
572f3240fe [rubygems/rubygems] Remove unnecessary require
The `security_policies` method already requires it.

d19b088f2f
2022-06-11 18:43:23 +09:00
David Rodríguez
4a75849680 [rubygems/rubygems] Remove unnecessary spec.remote guard
It's checked before calling the method already.

4eb00e9586
2022-06-11 18:43:22 +09:00
David Rodríguez
d5288c8aad [rubygems/rubygems] Refactor ambiguous gems check
a00c79a4da
2022-06-11 18:43:22 +09:00
Burdette Lamar
44b3daa0d7 [ruby/fileutils] Enhanced RDoc (https://github.com/ruby/fileutils/pull/83)
Treats ::chmod_R and ::chown.

df4ac84bef
2022-06-11 06:41:27 +09:00
Burdette Lamar
c2468fd88b [ruby/fileutils] Enhanced RDoc (https://github.com/ruby/fileutils/pull/82)
Treats ::chmod; adds Pathname usage to ::install.

9db4cb129c
2022-06-10 05:03:33 +09:00
Jean Boussier
4e21b19a61 [ruby/timeout] Keep a private reference to Process.clock_gettime
`timeout 0.3.0` broke our test suite because we have some
tests that stubs `Process.clock_gettime` making it return
a value in the past, causing `Timeout` to trigger almost immediately.

I beleive it wasn't a problem before because it was relying on `Process.sleep`.

e5911a303e
2022-06-09 18:58:49 +09:00
Burdette Lamar
9b7208fca1 [ruby/fileutils] [DOC] Enhanced RDoc (https://github.com/ruby/fileutils/pull/81)
b9d5a79e38
2022-06-09 05:38:09 +09:00
Burdette Lamar
a07acbe417 [ruby/fileutils] File trees (https://github.com/ruby/fileutils/pull/80)
Adds a note about file tree examples.

65ac65067a
2022-06-08 21:35:00 +09:00
Daniel Berger
deff9e2699 [rubygems/rubygems] Remove unnecessary string concatenation
81ccb3ab89
2022-06-07 23:18:31 +09:00
Yusuke Endoh
f075be3dcb [ruby/error_highlight] Use Exception#detailed_message instead of overriding #message (https://github.com/ruby/error_highlight/pull/24)
See https://bugs.ruby-lang.org/issues/18564.
Ref: https://github.com/ruby/did_you_mean/pull/177

671b7c61b2
2022-06-07 17:40:19 +09:00
Hiroshi SHIBATA
11b9dd8ccb
Manually merged https://github.com/ruby/did_you_mean/pull/177 2022-06-07 15:24:48 +09:00
Nobuyoshi Nakada
082c2d1b05 [ruby/rdoc] [DOC] Undocument internal constants [ci skip]
6d7bf24bb8
2022-06-07 11:44:58 +09:00
Nobuyoshi Nakada
dbfb3b1917 [ruby/rdoc] Allow boolean arguments to rb_attr and rb_define_attr
Currently only literal `0` and `1` are accepted as `read`/`write`
flags.
This patch allows other boolean arguments, C macros (`FALSE`/`TRUE`),
Ruby `VALUE`s (`Qfalse`/`Qtrue`), and C99 `bool`s (`false`/`true`), as
well.

169dc02e3c
2022-06-07 10:42:10 +09:00
Burdette Lamar
b737998d25 [ruby/fileutils] [DOC] Enhanced RDoc for FileUtils (https://github.com/ruby/fileutils/pull/78)
Treats:
    ::rm
    ::rm_f
    ::rm_r
    ::rm_rf
    ::remove_entry_secure

ce2a438d75
2022-06-07 00:37:31 +09:00
Alexander Ilyin
6fc16e748e [ruby/open-uri] [DOC] Fix markup for URI.open
* Add missing slash.

40023e63da
2022-06-07 00:06:56 +09:00
David Rodríguez
ba38318827 [rubygems/rubygems] Unify loading Gem::Requirement
It was being explicitly required from `Gem::Specification` but also a
strange autoload was set for it at `Gem::Version`. The autoload was non
standard because it should've been done in the `Gem` module, not in
`Gem::Specification`, since that's where the constant is expected to get
defined. Doing this might get deprecated in the future, and it was not
being effective anyways due to the explicit require.

Unify everything with an `autoload` at the right place.

174ea3e24c
2022-06-06 18:36:31 +09:00
Pavel Rosický
4bc7cef866
[ruby/cgi] jruby support
93326fb622
2022-06-06 18:13:01 +09:00
Nobuyoshi Nakada
5460675bbc [ruby/rdoc] Use command array form of IO.popen always
So that an exception raises by non-existent command, not via shell.

fd94dce69d
2022-06-04 20:32:27 +09:00
Nobuyoshi Nakada
2e6aee6ef2 [ruby/rdoc] Make all documents at the top level extra_rdoc_files [ci skip]
6b1a011243
2022-06-04 16:53:12 +09:00
Nobuyoshi Nakada
9a7be959b1 [ruby/rdoc] Remove RDoc::RI::Driver#in_path?
83051403d6
2022-06-04 16:42:10 +09:00
Nobuyoshi Nakada
323acd263a [ruby/rdoc] Stop checking if pager command found
`IO.popen` does that job.

3bbbc5ac84
2022-06-04 16:42:08 +09:00
Nobuyoshi Nakada
76479de159 [ruby/rdoc] Remove never used win32console
47a1aef447
2022-06-04 16:40:19 +09:00
David Rodríguez
4eb140b0e4 [rubygems/rubygems] Remove redundant bitwise AND
a20bac7924
2022-06-02 22:23:42 +09:00
Ellen Marie Dash
1177665e62 [rubygems/rubygems] Fix bundle remove by invalidating cached Bundle.defintion.
Prior to this commit, `bundle add GEM_NAME` updated the lockfile,
but `bundle remove GEM_NAME` left GEM_NAME in the lockfile.

By invalidating the cached `Bundle.definition`, the existing code
handles that without a problem.

aa0794d6a9
2022-06-01 19:01:18 +09:00
David Rodríguez
0a6b9924bd [rubygems/rubygems] Fix generated standalone script for default gems
The installer is actually rewriting the spec's full gem path to be the
one of the newly installed gem, however the accessor was not properly
working for `StubSpecification` instances, and default gems are always
of this type, because they are always present locally.

Fix the accessor to properly update the underlying full specification.

efa41babfa
2022-06-01 17:07:35 +09:00
David Rodríguez
f5b88d93ae [rubygems/rubygems] Remove code that seems unnecessary
This change was never covered with a spec, and we have recently covered
the case of partially deleted gems with specs and it works fine
(installation is "auto-healed").

6e66ee4235
2022-06-01 17:07:34 +09:00
David Rodríguez
8381c568e7 [rubygems/rubygems] Restore ability to load old marshalled gemspec that use YAML::PrivateType
This issue was not detected because when all traces of old YAML parser
and emitter `Syck` were removed, this null-type.gemspec.rz marshalled
gemspec was updated to no longer load `YAML::Syck::PrivateType` but load
`Psych::PrivateType` instead.

However, realworld old marshalled gemspecs still use the
`YAML::PrivateType` constant, so this commit replaces the gemspec to be
the real pry-0.4.7 marshalled gemspec, so that it catches this issue.

51b330b8d2
2022-06-01 17:06:52 +09:00
David Rodríguez
ebb534801f [rubygems/rubygems] Remove no longer needed Psych::PrivateType cleanup
This old bug used to affect the `rubyforge_project` field in serialized
gemspecs. However, this field has been removed and it's no longer
present in marshaled loaded gemspecs.

So, while the constant is still present in these marshalled gemspecs and
we still need to make sure it exists, we no longer need to clean it up
from the loaded data.

09df18e522
2022-06-01 17:06:51 +09:00
David Rodríguez
fd83b8887f [rubygems/rubygems] Skip duplicated dependency warning for gemspec dev deps
Generally this warning is skipped for gemspec development dependencies.
I think because it's common to override them in the Gemfile to change
the source, for example.

But the order of conditions was not correct and the warning was still
being printed in one case.

da9d1d6a3f
2022-06-01 00:14:31 +09:00
David Rodríguez
e2b421d679 [rubygems/rubygems] Give better conflict resolution advice
This alternative really uses only the Gemfile, and can never end up
being absurd, because it will never be suggested when there's no
lockfile, and it suggests deleting the lockfile.

5d154dd50e
2022-05-31 16:13:52 +09:00
Burdette Lamar
c50c9d4051 [ruby/fileutils] [DOC] Enhanced RDoc (https://github.com/ruby/fileutils/pull/77)
Treats:
    ::copy_entry
    ::copy_file
    ::copy_stream
    ::mv

d6d7e5330d
2022-05-31 02:30:07 +09:00
David Rodríguez
d6684f063b [rubygems/rubygems] Fix crash when commenting out a mirror in configuration
2d99277328
2022-05-30 17:43:12 +09:00
David Rodríguez
ea31c5bcd1 [rubygems/rubygems] Fix crash when installing gems with symlinks
If BUNDLE_PATH is configured to a symlinked path, installing gems with
symlinks would crash with an error like this:

```
Gem::Package::SymlinkError: installing symlink 'man/man0/README.markdown' pointing to parent path /usr/home/stevewi/srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0/README.markdown of /srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0 is not allowed
```

This commit fixes the problem by changing the bundle path to be the
realpath of the configured value, right after we're sure the path has
been created.

3cd3dd142a
2022-05-30 17:42:39 +09:00
David Rodríguez
0a974e4700 [rubygems/rubygems] Remove seemingly unnecessary code
f5dd5204ca
2022-05-30 17:42:37 +09:00
David Rodríguez
08b82e6b40 [rubygems/rubygems] Ignore Errno::EROFS errors when creating bundler.lock
Apparently old versions of MacOS would set `GEM_HOME` to a `/System`
folder, and trying to create a file there raises `Errno::EROFS`.

We ignore the error. Any permission issues should be better handled
further down the line.

ef90c071d0
2022-05-30 00:27:43 +09:00
David Rodríguez
373dabe00a [rubygems/rubygems] Ignore Errno::EPERM errors when creating bundler.lock
This kind of error can happen when setting `GEM_HOME` to a path
under MacOS System Integrity Protection.

We ignore the error. Any permission issues should be better handled
further down the line.

174cb66863
2022-05-29 22:19:35 +09:00
David Rodríguez
6e3295e554 [rubygems/rubygems] Make code to find target update version easier to follow
a7f81cc7ee
2022-05-28 19:22:54 +09:00
David Rodríguez
e9c4e37f1f [rubygems/rubygems] Remove unnecessary name and platform filter
It's already done before.

49d28cfde5
2022-05-28 19:22:53 +09:00
David Rodríguez
e78c1ddb1e [rubygems/rubygems] Fix rubygems update when non default --install-dir is configured
9f3b21192d
2022-05-28 19:22:15 +09:00
David Rodríguez
6778d321a7 [rubygems/rubygems] Show better error when previous installation fails to be removed
Instead of guessing on the culprit.

We actually have a helper, `Bundler.rm_rf`, with exactly the behavior
that we want:

* Allow the passed folder to not exist.
* No exception swallowing other than that.

5fa3e6f04a
2022-05-27 17:26:22 +09:00
Burdette Lamar
012eb9b70d [ruby/fileutils] [DOC] Enhanced RDoc for copy_entry (https://github.com/ruby/fileutils/pull/76)
27a3c376c7
2022-05-26 07:08:26 +09:00
Nobuyoshi Nakada
cd6f87eefc [ruby/timeout] Set the flag surely before return
f3a31abdfb
2022-05-25 19:50:47 +09:00
Nobuyoshi Nakada
8006a15edf [ruby/timeout] Add epoch.rake [ci skip]
5153ae9cad
2022-05-25 19:05:16 +09:00
Nobuyoshi Nakada
df7a1377e6 [ruby/timeout] Update spec files not to include unused files [ci skip]
01c44b591f
2022-05-25 18:58:46 +09:00
Nobuyoshi Nakada
e77e233935 [ruby/timeout] Hack to avoid leak checker
9a9b03b44c
2022-05-25 18:47:26 +09:00