Commit graph

14659 commits

Author SHA1 Message Date
David Rodríguez
5bdbe242b3 [rubygems/rubygems] Add a warning in an edge case of using gemspec DSL
If a Gemfile duplicates a development dependency also defined in a local
gemspec with a different requirement, the requirement in the local
gemspec will be silently ignored.

This surprised me.

I think we should either:

* Make sure both requirements are considered, like it happens for
  runtime dependencies (I added a spec to illustrate the current behavior
  here).

* Add a warning that the requirement in the gemspec will be ignored.

I think the former is slightly preferable, but it may cause some
bundle's that previously resolve to no longer resolver.

I went with the latter but the more I think about it, the more this
seems like it should behave like the former.

ad6843972f
2023-11-13 11:06:10 +09:00
David Rodríguez
e2d7e53c5c [rubygems/rubygems] This can be frozen now
d06544add2
2023-11-13 11:06:10 +09:00
David Rodríguez
3757d9027c [rubygems/rubygems] Remove now unnecessary dups
56ce2a6445
2023-11-13 11:06:10 +09:00
David Rodríguez
e6c84d05d0 [rubygems/rubygems] Remove now unnecessary dup
3c1a6a7dfa
2023-11-13 11:06:10 +09:00
David Rodríguez
c7bf511cbf [rubygems/rubygems] Add a note about required_rubygems_version in Bundler
9509d98b5c
2023-11-13 11:06:10 +09:00
David Rodríguez
a4d80eee17 [rubygems/rubygems] Let RuboCop target Ruby 3.0
70243b1d72
2023-11-13 11:06:10 +09:00
David Rodríguez
50482cd1e5 [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in Bundler
93619c97ff
2023-11-13 11:06:10 +09:00
David Rodríguez
54511303a4 [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in RubyGems
10c26a483d
2023-11-13 11:06:10 +09:00
David Rodríguez
435eb56f61 [rubygems/rubygems] Automatically lock extra ruby platforms
Since we started locking the specific platform in the lockfile, that has
created an annoying situation for users that don't develop on Linux.
They will create a lockfile on their machines, locking their local
platform, for example, darwin. But then that lockfile won't work
automatically when deploying to Heroku for example, because the lockfile
is frozen and the Linux platform is not included.

There's the chance though that resolving against two platforms (Linux +
the local platform) won't succeed while resolving for just the current
platform will. So, instead, we check other platform specific variants
available for the resolution we initially found, and lock those
platforms and specs too if they satisfy the resolution.

This is only done when generating new lockfiles from scratch, existing
lockfiles should keep working as before, and it's only done for "ruby
platforms", i.e., not Java or Windows which have their own complexities,
and so are excluded.

With this change, we expect that MacOS users can bundle locally and
deploy to Heroku without needing to do anything special.

5f24f06bc5
2023-11-13 11:06:10 +09:00
David Rodríguez
f273132bc0 [rubygems/rubygems] Extract builder to create a LazySpecification from full spec
957d3d9a7f
2023-11-13 11:06:10 +09:00
David Rodríguez
58b0a67432 [rubygems/rubygems] Extract a new small platform helper
8f7340df8e
2023-11-13 11:06:10 +09:00
David Rodríguez
bd6aaa78c3 [rubygems/rubygems] Remove unused SpecSet#merge
53e0490b55
2023-11-13 11:06:10 +09:00
David Rodríguez
196d1bf56e [rubygems/rubygems] Pass source to LazySpecification initializer
05120e2fe8
2023-11-13 11:06:10 +09:00
David Rodríguez
636b70d2a6 [rubygems/rubygems] Allow setting metadata on LazySpecification
This is a step forward towards eventually including metadata in the
lockfile.

56fc02b251
2023-11-13 11:06:10 +09:00
David Rodríguez
ea7cde64fb [rubygems/rubygems] Set LazySpecification dependencies directly
2462c8e04d
2023-11-13 11:06:10 +09:00
Kevin Newton
94f82a65f7 [ruby/prism] Add the ability to convert nodes to dot
3e4b4fb947
2023-11-12 02:53:33 +00:00
Kevin Newton
85db7baccb [ruby/prism] Remove extra locals added by ...
b7850f2d30
2023-11-10 21:50:12 +00:00
Mateus Pereira
03aa1092ad [ruby/prism] Add source code and changelog uris
33a85f7867
2023-11-10 21:49:27 +00:00
ima1zumi
8044feb7ab [ruby/irb] Bump version to 1.9.0
(https://github.com/ruby/irb/pull/757)

41548b8bd0
2023-11-10 19:27:30 +00:00
Burdette Lamar
82ce47415b [ruby/open3] [DOC] RDoc for Open3
(https://github.com/ruby/open3/pull/18)

9f3f5d004c
2023-11-10 17:15:06 +00:00
tomoya ishida
c4efd17061 [ruby/irb] Add command line option to select which completor to use
(https://github.com/ruby/irb/pull/754)

* Add command line option to select which completor to use

* Add test for completor argv

1dec2708c9
2023-11-09 13:15:26 +00:00
Kevin Newton
201853f4e1 [ruby/prism] Provide Parameters#signature for mirroring Method#parameters
90b3245528
2023-11-08 22:17:43 +00:00
Jeremy Evans
ddd99a5290 [ruby/tempfile] Make Tempfile#open return the underlying File
Add test for this behavior.

0ca31a6b8d
2023-11-08 16:47:29 +00:00
git
32e89b7f9c * remove trailing spaces. [ci skip] 2023-11-08 15:20:01 +00:00
Jeremy Evans
ddcfc9feab [ruby/tempfile] Fix Tempfile#{dup,clone}
Instead of storing the delegate in @tmpfile, use __getobj__, since
delegate library already handles dup/clone for that.  Copy the
unlinked, mode, and opts instance variables to the returned object
when using dup/clone.

Split the close/unlink finalizer into two finalizers. The close
finalizer always closes when any Tempfile instance is GCed, since
each Tempfile instance uses a separate file descriptor. The unlink
finalizer unlinks only when the original and all duped/cloned
Tempfiles are GCed, since all share the same path.

For Tempfile#open, undefine the close finalizer after closing the
current file, the redefine the close finalizer with the new file.

Fixes [Bug #19441]

dafabf9c7b
2023-11-08 15:19:52 +00:00
Han Young
b4bf8c9ee2 [rubygems/rubygems] Ensure we are using the same extension dir
Since #6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies.

Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.

8d699ed096
2023-11-08 12:40:22 +00:00
Jean Boussier
d898e8d6f8 Refactor rb_shape_transition_shape_capa out
Right now the `rb_shape_get_next` shape caller need to
first check if there is capacity left, and if not call
`rb_shape_transition_shape_capa` before it can call `rb_shape_get_next`.

And on each of these it needs to checks if we got a TOO_COMPLEX
back.

All this logic is duplicated in the interpreter, YJIT and RJIT.

Instead we can have `rb_shape_get_next` do the capacity transition
when needed. The caller can compare the old and new shapes capacity
to know if resizing is needed. It also can check for TOO_COMPLEX
only once.
2023-11-08 11:02:55 +01:00
tomoya ishida
e344010465 [ruby/irb] Type based completion using Prism and RBS
(https://github.com/ruby/irb/pull/708)

* Add completor using prism and rbs

* Add TypeCompletion test

* Switchable completors: RegexpCompletor and TypeCompletion::Completor

* Add completion info to irb_info

* Complete reserved words

* Fix [*] (*) {**} and prism's change of KeywordParameterNode

* Fix require, frozen_string_literal

* Drop prism<=0.16.0 support

* Add Completor.last_completion_error for debug report

* Retrieve `self` and `Module.nesting` in more safe way

* Support BasicObject

* Handle lvar and ivar get exception correctly

* Skip ivar reference test of non-self object in ruby < 3.2

* BaseScope to RootScope, move method objects constant under Methods

* Remove unused Splat struct

* Drop deeply nested array/hash type calculation from actual object. Now, calculation depth is 1

* Refactor loading rbs in test, change preload_in_thread not to cache Thread object

* Use new option added in prism 0.17.1 to parse code with localvars

* Add Prism version check and warn when :type completor cannot be enabled

* build_type_completor should skip truffleruby (because endless method definition is not supported)

1048c7ed7a
2023-11-08 02:46:33 +00:00
tomoya ishida
c8d4b103a9 [ruby/irb] Fix dancing-ruby Ctrl+C stop
(https://github.com/ruby/irb/pull/735)

802b1cb6d8
2023-11-08 09:17:23 +09:00
David Rodríguez
e6e4b4884d
[rubygems/rubygems] Hack to get Gem::Specification#extensions_dir documented
625b8293f7
2023-11-08 09:04:28 +09:00
David Rodríguez
9f67118d7b
[rubygems/rubygems] Simplify selecting specs with force_ruby_platform set
5f90a43635

Co-authored-by: Martin Emde <martin.emde@gmail.com>
2023-11-08 09:04:28 +09:00
David Rodríguez
a131ea39b7
[rubygems/rubygems] Better error when having an insecure install folder
e41156e272
2023-11-08 09:04:28 +09:00
David Rodríguez
05ea3bcf14
[rubygems/rubygems] Remove redundant error class
It's a `BundlerError`.

53ea676dab
2023-11-08 09:04:28 +09:00
David Rodríguez
5b076e00ce
[rubygems/rubygems] Fix regression on old git versions
abd91ca2e5
2023-11-08 09:04:28 +09:00
David Rodríguez
7f7a7f13ed
[rubygems/rubygems] Don't show bug report template when GEM_HOME has no writable bit
Instead, don't check that at all and proceed. If something fails to be
written inside GEM_HOME, we'll eventually fail with a proper permissions
error.

In addition to that, the writable bit in GEM_HOME is not even reliable,
because only the immediate parent is actually checked when writing. For
example,

```
$ mkdir -p foo/bar
$ chmod -w foo
$ touch foo/bar/baz # writes without issue
```

4bced7ac73
2023-11-08 09:04:28 +09:00
David Rodríguez
2d719cd146
[rubygems/rubygems] Remove unnecessary rescue
c0b549f943
2023-11-08 09:04:28 +09:00
Vít Ondruch
ca7444cc44
[rubygems/rubygems] Allow --install-dir to be specified together with --user-install
The combination of `install-dir` and `--user-install` used to be
disabled for no good reason. This even makes problem on Linux
distributions such as Fedora, where `--user-install` is set by default
via operating_system.rb.

The `--install-dir` is already prefered over the `--user-install` by
the implementation, therefore just drop the check.

313b1c5e76
2023-11-08 09:04:28 +09:00
Vít Ondruch
42cf1307c3
[rubygems/rubygems] Make the user installation less exceptional
The main purpose is to put handling of user installation into the same
place as e.g. handling the --build-root option handling. There is no
reason why the --build-root option should not prefix also paths used for
user installation.

Please note that the `util_installer` in
`test_generate_plugins_with_user_install` enforced the `:install_dir`,
which is against what user install is about.

0b10cb41aa
2023-11-08 09:04:28 +09:00
ima1zumi
e8ef010a81 [ruby/reline] Bump version to 0.4.0
(https://github.com/ruby/reline/pull/601)

d15ab72d4f
2023-11-07 15:38:53 +00:00
Jean Boussier
ced84beb25 [ruby/cgi] Add snake case aliases for escapeURIComponent
As agreed in [Feature #18822]

9d1161ec9d
2023-11-07 10:22:30 +00:00
Hiroshi SHIBATA
123b2e2fb4 [ruby/cgi] Bump up 0.4.0
6ddd5fc7d7
2023-11-07 08:29:31 +00:00
Hiroshi SHIBATA
b13d00a7c0 [ruby/open-uri] Bump up 0.4.0
09df813305
2023-11-07 16:37:06 +09:00
Hiroshi SHIBATA
31dfebccbf [ruby/English] Bump up 0.8.0
826ff728cf
2023-11-07 07:32:00 +00:00
Keith R. Bennett
78e07e2983 [ruby/English] Combine duplicate aliases into single sections to more clearly denote sameness and make more concise.
dcff090f6f
2023-11-07 07:24:50 +00:00
Hiroshi SHIBATA
9857499d3d [ruby/fileutils] Bump up 1.7.2
577fd38f15
2023-11-07 07:15:34 +00:00
Hiroshi SHIBATA
3ac15f7e57 [ruby/base64] Bump up 0.2.0
09e839e5ad
2023-11-07 07:01:35 +00:00
Burdette Lamar
48d8f62cdd [ruby/base64] Enhanced Rdoc for Base64
(https://github.com/ruby/base64/pull/7)

* Enhanced Rdoc for Base64

* Enhanced RDoc for Base64

155c39a949
2023-11-07 06:59:52 +00:00
Hiroshi SHIBATA
84b2a6ad5d [ruby/drb] Removed old version on doc section
104f1a4db3
2023-11-07 15:37:45 +09:00
Hiroshi SHIBATA
ef3feae8e7 [ruby/drb] Load DRb::VERSION automatically
b250502c43
2023-11-07 15:36:55 +09:00
BurdetteLamar
8d56260910 [ruby/logger] [DOC] Fix broken link
8c135bce9a
2023-11-07 15:35:37 +09:00