Commit graph

12164 commits

Author SHA1 Message Date
Hiroshi SHIBATA
c2bdb198d7 Dont't handle inline Gemfile 2023-10-13 16:22:09 +09:00
Hiroshi SHIBATA
75644f98e5 Use Gem::BUNDLED_GEMS.warning? at Bundler.setup 2023-10-13 16:22:09 +09:00
Stan Lo
3aba21511b [ruby/irb] Bump version to 1.8.2
47693a2213
2023-10-12 21:36:13 +00:00
tomoya ishida
1126bd8c65 [ruby/irb] Fix require path completion disturbing string method
completion
(https://github.com/ruby/irb/pull/726)

e42dc74ce0
2023-10-12 16:54:09 +00:00
tomoya ishida
cf21c72cdb [ruby/irb] Fix test runner exit bug
(https://github.com/ruby/irb/pull/728)

* Remove useless test setup and teardown that sets MAIN_CONTEXT to nil

* Avoid adding command methods to main object in test

f204829a08
2023-10-12 13:55:47 +00:00
tomoya ishida
e029375a7d [ruby/irb] Decouple RubyLex from prompt and line_no
(https://github.com/ruby/irb/pull/701)

* Remove instance variable prompt and line_no from RubyLex

* Fix prompt test

* Rename prompt generating method and make it private

1ceb97fe2e
2023-10-12 12:53:31 +00:00
Nobuyoshi Nakada
52709a4862 Fix dir_config cache for -include and -lib options
Set to "--with-" options, not "--without-" keys.
2023-10-12 17:46:01 +09:00
Nobuyoshi Nakada
1cef5f597d Include default values in dir_config cache keys
The extconf.rb in mysql2 gem repeats `dir_config('mysql')`, without
and with the default path.  The third call returns the former results
even with the default path.  Since it does not check the results of
the third call, that `nil` is passed to `find_library` as a path, and
fails with `NoMethodError`.
2023-10-12 17:46:01 +09:00
Takashi Kokubun
5140e6a4c3 Fix calling exit if irb_context is nil
Trying to avoid a flaky failure like:
1761611381
2023-10-11 16:22:20 -07:00
Martin Emde
9dcaa83259 [rubygems/rubygems] Avoid excess Arrays when partitioning Gem::Version.canonical_segments
338c48f935
2023-10-11 22:18:46 +00:00
Ellen Marie Dash
8a8b23c0cc [lib/rubygems/path_support.rb] Rephrase comment
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2023-10-11 19:07:29 +00:00
Ellen Marie Dash
be32109d64 [rubygems/rubygems] Move "Defaulting to user installation ..." message, so --install-dir and --user-install can suppress it.
6677fc6853
2023-10-11 19:07:29 +00:00
Ellen Marie Dash
28a6c4a1ad [rubygems/rubygems] Update incorrect comments.
6b21f593f3
2023-10-11 19:07:28 +00:00
Ellen Marie Dash
c83f8ad867 [rubygems/rubygems] Simplify logic for Gem::PathSupport#home, and make GEM_HOME always overide it.
64273fd7e3
2023-10-11 19:07:28 +00:00
Ellen Marie Dash
e84b73398b [rubygems/rubygems] Call check_that_user_bin_dir_is_in_path ANY time Gem.paths.home == Gem.user_dir.
(As opposed to only if `--user-install` is passed.)

0b42d0e869
2023-10-11 19:07:28 +00:00
Ellen Marie Dash
ee9cb86bb4 [rubygems/rubygems] Split out Gem::PathSupport#default_home_dir to fix "bundle doctor" specs.
d7f3f901f1
2023-10-11 19:07:27 +00:00
Ellen Marie Dash
4925570de2 [rubygems/rubygems] Try a different approach for fallback to --user-install.
13e0704c40
2023-10-11 19:07:26 +00:00
Ellen Marie Dash
7aebe2a52b [rubygems/rubygems] If GEM_HOME exists + isn't writable, use --user-install.
6d20585645
2023-10-11 19:07:26 +00:00
tomoya ishida
94cb5765e2 [ruby/irb] Rename current completor to RegexpCompletor and
refactored for future extension
(https://github.com/ruby/irb/pull/707)

* Move completion implementation to completion/regexp_completor for future extension

* Remove constant CompletionProc and PerfectMatchedProc and add a class method

* Move document display logic to InputCompletor. Each completor only need to implement `completion_caididates` and `doc_namespace`

* Move display_document logic to RelineInputMethod

* Use RegexpCompletor directly. Not through class method of InputCompletor.

* RegexpCompletor extends BaseCompletor, move back definition to completion.rb

* Move display_document test to input_method test

* Stop re-initialize completor on each completion phase

* Store completor to ReadlineInputMethod's iver

1e98521483
2023-10-11 17:09:05 +00:00
Martin Emde
b9a6fca67d [rubygems/rubygems] Don't delete the release version from pre-release string more than once
6485adda54
2023-10-11 17:02:25 +00:00
Stan Lo
cc311e1c45 [ruby/irb] Avoid locking the debug UI to a single thread
(https://github.com/ruby/irb/pull/725)

Since `debug` stores and updates the target thread via its Session's
`@tc` variable, we don't need to and shouldn't lock the UI to the thread
that activates the integration.

202efdbf0c
2023-10-11 14:16:39 +00:00
Jean Boussier
5cc44f48c5 Refactor rb_shape_transition_shape_capa to not accept capacity
This way the groth factor is encapsulated, which allows
rb_shape_transition_shape_capa to be smarter about ideal sizes.
2023-10-10 14:47:54 +02:00
Cody Cutrer
fd21460898 [rubygems/rubygems] Update bundle-plugin man page
The formatting was odd, and it hadn't been updated for how the global
source is handled.

bf19a266ab
2023-10-10 09:02:10 +00:00
Jacopo
f44cee9048 [rubygems/rubygems] Avoid duplicates -rbundler/setup in RUBYOPT with Ruby preview
When using a Ruby preview the require path of `bundler/setup` is
similar to `-r/opt/ruby3.3.0-preview2/lib/ruby/3.3.0+0/bundler/setup`.
The special character `+` in the string makes the Regexp fail,
leading to multiple addition of the same require statement each time
`set_rubyopt` is called (e.g. server reloading).
Escaping the characters in the string esure a correct match with all
the different Ruby versions.

dd43dfa709
2023-10-09 11:54:10 +00:00
Samuel Giddins
2b6228be48 [rubygems/rubygems] Reduce allocations when parsing compact index
This still allocates a ton (a string for each line, plus a bunch of
splits into arrays), but it helps a bit when Bundler has to go through
dependency resolution.

```
==> memprof.after.txt <==
Total allocated: 194.14 MB (2317172 objects)
Total retained:  60.81 MB (593164 objects)

==> memprof.before.txt <==
Total allocated: 211.97 MB (2404890 objects)
Total retained:  62.85 MB (640342 objects)
```

c68b41b0e5
2023-10-08 04:17:15 +00:00
Samuel Giddins
bf71b0eda5 [rubygems/rubygems] Optimize allocations in Gem::Version
From running in a random rails app I have locally, here are the changes

1) for `bundle lock --update --bundler` (forcing Bundler to go through
dependency resolution)

```
==> memprof.after.txt <==
Total allocated: 2.98 MB (48307 objects)
Total retained:  1.21 MB (16507 objects)

==> memprof.before.txt <==
Total allocated: 12.62 MB (198506 objects)
Total retained:  1.30 MB (23133 objects)
```

2) for `bin/rails runner true` (essentially only bundler/setup)

```
==> memprof.after.txt <==
Total allocated: 59.50 kB (1017 objects)
Total retained:  25.08 kB (362 objects)

==> memprof.before.txt <==
Total allocated: 561.82 kB (8575 objects)
Total retained:  27.28 kB (513 objects)
```

35c8ed2cb8
2023-10-07 16:04:42 +00:00
Manu
6a0c13c1d6 [rubygems/rubygems] Update man page for bundle exec to reflect default flag value
`--keep-file-descriptors` is true by default.

b28e88e228
2023-10-06 05:38:21 +00:00
Vinicius Stock
69b024d7cc [ruby/prism] Add full_name to ConstantPathNode and ConstantPathTargetNode
b390553028
2023-10-06 01:57:34 +00:00
Brian Hawley
9d58f93828 [ruby/net-http] Net::HTTPResponse nil checking
Fix nil handling in read_body and stream_check.

Fixes: #70

36f916ac18
2023-10-05 07:11:52 +00:00
gazayas
488c0ed051 [ruby/prism] Remove trailing parenthesis in Location#pretty_print
8eaa199a28
2023-10-04 17:00:09 +00:00
Stan Lo
b43cc51dca [ruby/irb] Clear all context usages in RubyLex
(https://github.com/ruby/irb/pull/684)

After this change, `RubyLex` will not interact with `Context` directly
in any way. This decoupling has a few benefits:

- It makes `RubyLex` easier to test as it no longer has a dependency on
  `Context`. We can see this from the removal of `build_context` from
  `test_ruby_lex.rb`.
- It will make `RubyLex` easier to understand as it will not be affected
  by state changes in `Context` objects.
- It allows `RubyLex` to be used in places where `Context` is not available.

d5b262a076
2023-10-04 12:13:33 +00:00
Daniel Colson
accda74cbe [rubygems/rubygems] Prevent gem activation in standalone mode
As discussed in https://github.com/rubygems/rubygems/issues/6273#issuecomment-1449176658

The `gem` method behaves awkwardly in standalone mode. Assuming bundler
isn't loaded at all, a call to gem might activate a gem that is not part
of the bundle (because it's the gem method defined in
lib/rubygems/core_ext/kernel_gem.rb and not
lib/bundler/rubygems_integration.rb). And when running with
`--disable-gems`, the gem method won't be defined at all so we'll get a
NoMethodError.

Calls to `gem` can appear in dependencies outside an application's
control. To work around this at GitHub we defined our own `Kernel#gem`
that no-ops.

I agree with https://github.com/rubygems/rubygems/issues/6273#issuecomment-1440755882

> people using standalone mode don't want to activate gems like Kernel.gem

This commit redefines `Kernel#gem` in the standalone script to no-op.

bea17b55f1
2023-10-03 17:16:19 +00:00
ima1zumi
5dfbf1a381 [ruby/reline] Bump version to 0.3.9
(https://github.com/ruby/reline/pull/594)

b6fb72718a
2023-10-03 15:10:59 +00:00
David Rodriguez
ed0661e618 [rubygems/rubygems] Don't re-resolve with prereleases if unlocked gem has no prereleases
d76dc70d90
2023-10-03 09:42:31 +00:00
BurdetteLamar
b4ab013b27
[DOC] Link fixes 2023-10-03 16:31:34 +09:00
Josef Šimánek
25b536cc2f
[rubygems/rubygems] Fix invalid links in documentation. - wrap ENV variables in <code> - fix rubygems.org link - fix zenspider.com link
9eaac94a63
2023-10-03 16:13:18 +09:00
Peter Boling
9ffd659d47
[rubygems/rubygems] 🐛 Specification of branch or ref with tag is ambiguous
- Specs for GitProxy were incorrect and insufficient
- Specs are now correct and less insufficient

63d0a8cfd0
2023-10-03 16:13:18 +09:00
Peter Boling
16a97c7bbb
[rubygems/rubygems] 🚨 Rubocop Linting
2851e051c3
2023-10-03 16:13:18 +09:00
Josef Šimánek
0046c67dd8
[rubygems/rubygems] Fix typo: eglible -> eligible.
1e487e1337
2023-10-03 16:13:18 +09:00
Burdette Lamar
798083fac8
[ruby/csv] [DOC] Fix broken links
(https://github.com/ruby/csv/pull/283)

af64a15b2f
2023-10-03 16:13:18 +09:00
Kosuke Shibata
2325e1cd81
[ruby/csv] Add CSV::InvalidEncodingError
(https://github.com/ruby/csv/pull/287)

To handle encoding errors in CSV parsing with the appropriate error
class

68b44887e5
2023-10-03 16:13:18 +09:00
Hiroshi SHIBATA
3b47fb2cb6 [rubygems/rubygems] Update suggested variable for bindir
f9cc6fed25
2023-10-03 00:08:34 +00:00
BurdetteLamar
1943ea06a6 [ruby/prism] [DOC] Link fix
472bdc4d70
2023-10-02 13:22:53 +00:00
Harshal Bhakta
f208f78bdf [rubygems/rubygems] Support Ruby's preview version format (Ex: 3.3.0-preview2) in Gemfile
4c1a0511b6
2023-10-02 02:19:43 +00:00
Graham Marlow
f3aea74c3d [rubygems/rubygems] Include gemspec in ExtensionTask for native gem tasks
042cfb7007
2023-10-02 01:34:01 +00:00
BurdetteLamar
4c8fac0741 [ruby/open3] [DOC] RDoc for Open3
0aadba9fe6
2023-09-30 16:58:59 +00:00
Burdette Lamar
20efab0b08 [ruby/open3] [DOC] RDoc for Open3
(https://github.com/ruby/open3/pull/15)

f3191920aa
2023-09-30 14:26:50 +00:00
Josef Šimánek
4cf68908e5 [rubygems/rubygems] Update SPDX list and warn on deprecated identifiers.
61667028f5
2023-09-30 11:20:08 +00:00
BurdetteLamar
e05ea03553 [ruby/open3] [DOC] RDoc for Open3
69f9c49eb4
2023-09-29 17:56:01 +00:00
BurdetteLamar
873a8caf58 [ruby/open3] [DOC] RDoc for Open3
f1d6988f13
2023-09-29 17:56:01 +00:00