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

1600 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Vyacheslav Alexeev 1a62a50c4f [rubygems/rubygems] Add `github` and `ref` options to `bundle add`
https://github.com/rubygems/rubygems/commit/c3e54acab0
2021-12-11 00:13:25 +09:00
David Rodríguez 0e60bc118b [rubygems/rubygems] Ignore dependencies not actually locked from frozen check
Only needed if there can be no explicit global source (bundler < 3).

https://github.com/rubygems/rubygems/commit/73923f4af5
2021-12-10 19:09:55 +09:00
Kazuhiro NISHIYAMA af6e088357
Skip bind port 1 when ip_unprivileged_port_start<=1
Linux can allow to bind port 1 to user.
And `ip_unprivileged_port_start` is 0 on [lima](https://github.com/lima-vm/lima) default vm.

```
1)
Socket#bind on SOCK_DGRAM socket raises Errno::EACCES when the current user does not have permission to bind FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:38:in `block (4 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:4:in `<top (required)>'

2)
Socket#bind on SOCK_STREAM socket raises Errno::EACCES when the current user does not have permission to bind FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:79:in `block (4 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:44:in `<top (required)>'

3)
Socket#bind using IPv4 using a packed socket address raises Errno::EACCES when the user is not allowed to bind to the port FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:119:in `block (6 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:85:in `<top (required)>'

4)
Socket#bind using IPv6 using a packed socket address raises Errno::EACCES when the user is not allowed to bind to the port FAILED
Expected Errno::EACCES but no exception was raised (0 was returned)
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:119:in `block (6 levels) in <top (required)>'
.../ruby/spec/ruby/library/socket/socket/bind_spec.rb:85:in `<top (required)>'
```
2021-12-08 13:26:53 +09:00
David Rodríguez f0ef9ffed1 [rubygems/rubygems] Cancel deprecation of custom git sources
https://github.com/rubygems/rubygems/commit/99cd6e0627
2021-12-08 07:59:34 +09:00
Simon Fish 1b12ebb94e [rubygems/rubygems] Add require parameter to `bundle add``
Test and ensure "false" is handled

Don't use yield_self to operate on autorequire

Remove duplicate autorequire

Add banner to require option

Don't use json to break down require params

Pass linter

https://github.com/rubygems/rubygems/commit/a4f2f8ac17
2021-12-08 01:49:20 +09:00
David Rodríguez 26303c31f0 [rubygems/rubygems] Pass "--" to git commands to separate positional and optional args
To make sure git uri's specified in Gemfile are never misinterpreted as
optional arguments, potentially allowing for local code execution.

https://github.com/rubygems/rubygems/commit/90b1ed8b9f
2021-12-07 23:27:59 +09:00
David Rodríguez 526c9359ca [rubygems/rubygems] Don't cleanup paths from gems already activated from `$LOAD_PATH`
This way, if some default gem has been required before bundler, and
rubygems has enhanced the `$LOAD_PATH` to use the latest version in the
system, further requires of that default gem after bundler has been
activated will use the same version and don't cause redefinition
warnings or worse problems derived from the fact of mixing up two
different versions. That, unless the gem is a `Gemfile` dependency. In
that case, we'll get a mismatch error anyways as we do now.

This fix doesn't mean that all default gems internally used by
bundler/rubygems are now supported inside `Gemfile`'s. That should be
handled case by case, but it will now bite people only when they try to
add the gem to their `Gemfile`, not before.

https://github.com/rubygems/rubygems/commit/7325530547
2021-12-07 01:53:39 +09:00
Jean Boussier 715a51a0d6 [rubygems/rubygems] Feature: accept pull request URLs as github source
Very often github source is used to temporarily use a modified gem
while a PR upstream is being reviewed.

So for instance https://github.com/ruby/bigdecimal/pull/211 will look like:

```ruby
gem "bigdecimal", github: "casperisfine/bigdecimal", branch: "git-gem" # https://github.com/ruby/bigdecimal/pull/200
```

It's annoying because you have to fiddle with the branch name, which is copied as `casperisfine:git-gem`, etc etc.

If I could simply use the PR URL like this:

```
gem "bigdecimal", github: "https://github.com/ruby/bigdecimal/pull/211"
```

It would make a very common task for me so much simpler.

https://github.com/rubygems/rubygems/commit/517c527751
2021-12-06 20:27:29 +09:00
Josef Šimánek 25423f0918 [rubygems/rubygems] Add --version parameter to bundle info command.
https://github.com/rubygems/rubygems/commit/7d9fdd908d
2021-12-06 18:03:54 +09:00
David Rodríguez c38c1d82b1 [rubygems/rubygems] Let original EACCES error be raised
This block of code already wraps file operations with
`SharedHelpers.filesystem_access`, which rescues and re-raises more
friendly errors. Also, I'm not fully sure creating a temporary directory
can end up raising an `Errno::EACCES` error from reading `tmpdir`
sources. Finally, this rescue block apparently leads to some false
positives when firewall is blocking the ruby executable on Windows, or
at least that's what we've got reported.

In any case, I think it's best to let the original error be raised.

https://github.com/rubygems/rubygems/commit/f7dbe54404
2021-12-04 05:18:11 +09:00
David Rodríguez 4c5e862434 [rubygems/rubygems] Improve source gemfile/lockfile equivalence checks
Since we no longer have multiple global sources, each top level dependency is
always pinned to a single source, so it makes little sense to talk about
adding or removing a source. Instead, source changes always mean to
change the source one or more dependencies are pinned to. This logic can
now be much simpler.

https://github.com/rubygems/rubygems/commit/f1d33fa0df
2021-12-03 20:00:51 +09:00
David Rodríguez 248fae0ec4 [rubygems/rubygems] Improve sources representation
We have two representations of a source. Once used for sorting, which
should not depend on the source's state, but solely on its static
information, like remotes. Another one used for error and informational
messages, which should properly inform about the exact state of the
source when the message is printed.

This commit makes the latter be the default implementation of `to_s`, so
that error and informational messages are more accurate by default.

https://github.com/rubygems/rubygems/commit/b5f2b88957
2021-12-03 20:00:50 +09:00
David Rodríguez 7d974cc56f [rubygems/rubygems] Don't overwrite locked dependency sources too early
Otherwise we hide some useful message about dependency source changes.

https://github.com/rubygems/rubygems/commit/c926673c5b
2021-12-03 20:00:50 +09:00
David Rodríguez aa87780f8f [rubygems/rubygems] Fix incorrect order in changed sources message
https://github.com/rubygems/rubygems/commit/6f1b5f68de
2021-12-03 20:00:49 +09:00
David Rodríguez cf88271331 [rubygems/rubygems] Fix gemspec source unlocking also for prereleases like 0.0.0.SNAPSHOT
The default prerelease requirement in rubygems doesn't actually match
things like "0.0.0.SNAPSHOT".

https://github.com/rubygems/rubygems/commit/711498b342
2021-12-02 18:10:31 +09:00
David Rodríguez 2a15b28a9e [rubygems/rubygems] Fix materialization of locked 0 prereleases
Since the default requirement in rubygems is ">= 0", it was failing to
match 0 prereleases. Changing the default globally to be ">= 0.a"
instead is a major refactoring that's quite tricky to make backwards
compatible, so I'm special casing this where needed for now to fix the
regression.

https://github.com/rubygems/rubygems/commit/68fe37937c
2021-12-02 18:10:31 +09:00
Nobuyoshi Nakada a84dc9d80d [win32] skip example about STDIN encodings 2021-12-01 18:54:26 +09:00
Hiroshi SHIBATA 0b53a8895f
Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbd 2021-12-01 11:00:10 +09:00
Hiroshi SHIBATA 9f4bdeb403
Removed vcr files. They are needless for this repo 2021-12-01 09:53:07 +09:00
Nobuyoshi Nakada ac8647bec1
Fix `GC.total_time` example
The result may increase actually or not, since GC can finish
shorter than the timer granularity.
2021-11-30 08:49:41 +09:00
ooooooo-q af59d35570 [rubygems/rubygems] Fix escape of filenames in `bundle doctor`
https://github.com/rubygems/rubygems/commit/3ede1435ea
2021-11-30 01:29:34 +09:00
Benoit Daloze 67a1e22589 Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
Benoit Daloze e6d93a27af Update to ruby/mspec@098b320 2021-11-29 15:50:26 +01:00
David Rodríguez 59439446d9 [rubygems/rubygems] Fix missing locked specs when depended on other platform
https://github.com/rubygems/rubygems/commit/0396e899db
2021-11-27 05:31:54 +09:00
David Rodríguez f3320f164f [rubygems/rubygems] Fix `bundle info` sometimes claiming that bundler has been deleted
https://github.com/rubygems/rubygems/commit/fe1a31db31
2021-11-26 08:50:52 +09:00
David Rodríguez aace9cb162 [rubygems/rubygems] Fix bad instance variable name
Recent changes made a warning while running specs show up for some
reason, and it revealed this error.

https://github.com/rubygems/rubygems/commit/bbf55de38e
2021-11-25 04:02:21 +09:00
David Rodríguez b2b473707f [rubygems/rubygems] Check not having load system features also for successful runs
https://github.com/rubygems/rubygems/commit/4807bd19a5
2021-11-25 04:02:21 +09:00
David Rodríguez d49ee9e2c3 [rubygems/rubygems] These method should be returning a string
https://github.com/rubygems/rubygems/commit/dc391f4d87
2021-11-25 04:02:20 +09:00
David Rodríguez d123919595 [rubygems/rubygems] We should be checking raised exception, not status code here
https://github.com/rubygems/rubygems/commit/48f8cdab9c
2021-11-25 04:02:20 +09:00
David Rodríguez c4b1aa19a3 [rubygems/rubygems] Don't replace ENV twice on non Windows platforms
https://github.com/rubygems/rubygems/commit/8dc86b7096
2021-11-25 04:02:19 +09:00
Jean Boussier c0c2b31a35 Add Class#subclasses
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
2021-11-23 10:50:44 +01:00
David Rodríguez 997adfd410 [rubygems/rubygems] Clarify `bundle viz` deprecation
https://github.com/rubygems/rubygems/commit/7f22fe56b3
2021-11-22 09:29:13 +09:00
David Rodríguez 80f39d78df [rubygems/rubygems] Allow `bundle update` to downgrade gems by changing the Gemfile
https://github.com/rubygems/rubygems/commit/6a19cca7e5
2021-11-19 10:12:10 +09:00
Jeremy Evans 75ecbda438 Make Module#{public,private,protected,module_function} return arguments
Previously, each of these methods returned self, but it is
more useful to return arguments, to allow for simpler method
decorators, such as:

```ruby
cached private def foo; some_long_calculation; end
```

Where cached sets up caching for the method.

For each of these methods, the following behavior is used:

1) No arguments returns nil
2) Single argument is returned
3) Multiple arguments are returned as an array

The single argument case is really the case we are trying to
optimize for, for the same reason that def was changed to return
a symbol for the method.

Idea and initial patch from Herwin Quarantainenet.

Implements [Feature #12495]
2021-11-18 09:47:40 -08:00
Nobuyoshi Nakada 89b440bf72
Expect bool as `sort:` option at glob [Feature #18287] 2021-11-18 21:47:18 +09:00
Yusuke Endoh 8a816fbe7b Revert "Temporary ignored the failing specs for Date"
This reverts commit 17e64cca6b.

The specs should work now.
2021-11-16 23:01:54 +09:00
Hiroshi SHIBATA 17e64cca6b
Temporary ignored the failing specs for Date 2021-11-16 21:22:28 +09:00
Hiroshi SHIBATA f3bda8987e
Merge the master branch of rubygems repo
Picked from 4b498709a0
2021-11-16 20:19:13 +09:00
David Rodríguez 3cf7130d70 [rubygems/rubygems] Remove duplicated spec
https://github.com/rubygems/rubygems/commit/86b874ed24
2021-11-12 06:05:09 +09:00
David Rodríguez 4736dec58b [rubygems/rubygems] Remove `gemfile_should_be` helper as well
https://github.com/rubygems/rubygems/commit/79f3c00caa
2021-11-12 06:05:08 +09:00
David Rodríguez 1f91009d24 [rubygems/rubygems] Remove `have_lockfile` matcher too
https://github.com/rubygems/rubygems/commit/635f3f2605
2021-11-12 06:05:08 +09:00
David Rodríguez d0f266460f [rubygems/rubygems] Remove `lockfile_should_be` helper
It doesn't add anything.

https://github.com/rubygems/rubygems/commit/ece3c864df
2021-11-12 06:05:07 +09:00
Hiroshi SHIBATA bd2674ad33 [rubygems/rubygems] Use bundler-graph instead of bundler-viz
https://github.com/rubygems/rubygems/commit/a54cca13db
2021-11-08 22:15:21 +09:00
haruuzion 82ae9b092c [rubygems/rubygems] Fix url
https://github.com/rubygems/rubygems/commit/6a5a80eff7
2021-11-06 01:39:24 +09:00
Nobuyoshi Nakada 539c42ed89 [rubygems/rubygems] Fix typos
https://github.com/rubygems/rubygems/commit/f328ef6f77
2021-11-04 23:06:25 +09:00
Nobuyoshi Nakada a202408180
Fix typos 2021-11-02 19:17:37 +09:00
David Rodríguez ed0f326e88 [rubygems/rubygems] Leave ":" after MANPATH when not set
So that system man pages still work after a gem with man pages overrides
it.

https://github.com/rubygems/rubygems/commit/1031879b87
2021-11-02 00:28:28 +09:00
David Rodríguez 4e7e057692 [rubygems/rubygems] Memoize materialized specs when requiring `bundler/setup`
Calling `Bundler.definition.specs` will memoize materialized specs.
However, requiring `bundler/setup` will end up materializing the same
set of specs, but not memoize them.

This change makes things consistent.

https://github.com/rubygems/rubygems/commit/e4c2b52824
2021-11-01 02:01:36 +09:00
David Rodríguez f634d1ee00 [rubygems/rubygems] Better error when installing a git lockfile and git not present
https://github.com/rubygems/rubygems/commit/28f4842196
2021-10-30 06:11:39 +09:00