Commit graph

14675 commits

Author SHA1 Message Date
David Rodríguez
aad4bfd7bc [rubygems/rubygems] Fix gem install on NFS shares
NFS shares seem to support flock these days, but they need read-write
permissions.

1c492804cd
2024-10-11 09:42:08 +00:00
David Rodríguez
1ad990a366 [rubygems/rubygems] Only pristine executables for default gems
1cfc1d626c
2024-10-10 19:46:44 +00:00
Kevin Newton
7a198af7cd [ruby/prism] Prism::CodeUnitsCache
Calculating code unit offsets for a source can be very expensive,
especially when the source is large. This commit introduces a new
class that wraps the source and desired encoding into a cache that
reuses pre-computed offsets. It performs quite a bit better.

There are still some problems with this approach, namely character
boundaries and the fact that the cache is unbounded, but both of
these may be addressed in subsequent commits.

2e3e1a4d4d
2024-10-10 18:02:27 +00:00
David Rodríguez
b77ff342cc [rubygems/rubygems] Revert "Fix bundle.bat re-execution"
This reverts commit e04e00f7bb.

554ece1587
2024-10-10 17:57:07 +00:00
Nobuyoshi Nakada
caf0d2058a [ruby/time] [DOC] nodoc VERSION
This file is parsed as a part of Ruby documentation, and this constant
appears in the built-in Time class unexpectedly.

f26f7ab689
2024-10-10 16:54:15 +00:00
Nobuyoshi Nakada
e6b9348eb9 [ruby/time] [DOC] Escape the word "Time" that does not mean Time class
8572a306bb
2024-10-10 16:54:14 +00:00
Nobuyoshi Nakada
db352a5127 [ruby/time] [DOC] RDoc does not use backticks
aefa245a20
2024-10-10 16:54:14 +00:00
Stan Lo
a778562f33 [ruby/rdoc] Make methods and attributes linkable
(https://github.com/ruby/rdoc/pull/1189)

* Use the same color for both class/module and method highlight

* Make methods and attributes linkable

7757fd9fe4
2024-10-10 16:09:44 +00:00
David Rodríguez
d12c8cbf14 [rubygems/rubygems] Fix gem pristine etc resetting gem twice sometimes
If a default version and a regular version of etc are present at the
same time, RubyGems will end up duplicating work and running pristine
twice.

The `etc` gem is special because it's loaded by RubyGems by default.
When doing this, RubyGems will activate the regularly installed version.
The when `gem pristine` runs, it will find to installed specifications
but materialize both to the already activated specification.

Before:

```
$ gem pristine etc --version 1.4.3
Restoring gems to pristine condition...
Building native extensions. This could take a while...
Restored etc-1.4.3
Building native extensions. This could take a while...
Restored etc-1.4.3
```

After:

```
$ gem pristine etc --version 1.4.3
Restoring gems to pristine condition...
Skipped etc-1.4.3, it is a default gem
Building native extensions. This could take a while...
Restored etc-1.4.3
```

5c279ac56b
2024-10-10 14:54:04 +00:00
David Rodríguez
3fdf0e7e6d [rubygems/rubygems] Fix specs with missing extensions getting activated
c80998a22a
2024-10-10 14:51:32 +00:00
David Rodríguez
f63873e7a2 [rubygems/rubygems] Remove more compatibility code with old RubyGems
74e8eff779
2024-10-10 14:51:32 +00:00
Stan Lo
c5f0fe1285 [ruby/rdoc] Improve method source toggling
(https://github.com/ruby/rdoc/pull/1176)

* Move method source block to the top

Currently, if a method description is long (e.g. `Array.new`), users need
to click the method toggle button next to the method title, and then scroll
down to the source code expanded below the description.

This commit changes the behavior so that the source code is expanded
immediately below the method title.

* Update method toggle's interface

1. Display the method toggle button by default instead of displaying on hover
2. Only toggle the source code when clicking the method toggle button, not
   when clicking the entire method title section. This will allow us to display
   an anchor link next to the method title
3. Simplify the toggle source button's appearance

* Use details tag for method toggling

* Rename method-click-advice to method-source-toggle

* Improve method controls' display on mobile

By moving the method controls out of the method header, we can display
them to the right of the method name on desktop, and below the method name
on mobile.

* Add "Example" label to example code blocks

The label should help users distinguish example code blocks from other
code blocks, such as method source code.

It's only applied to Ruby code examples.

* Revert "Add "Example" label to example code blocks"

This reverts commit 69fc9ce6a3.

* Give source code blocks a different background color

* Change targeted method's highlighting color to work better with the new method source

e608a84af3
2024-10-10 09:45:41 +00:00
Samuel Giddins
a392ee1437
Update vendored net-http
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
2024-10-10 10:03:34 +09:00
Kevin Newton
e39e582594 [ruby/prism] Attempt to assume binary is UTF-8
343197e4ff
2024-10-09 15:42:23 +00:00
Vinicius Stock
e50754fcfa [ruby/prism] Avoid breaking code units offset on binary encoding
25a4cf6794

Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
2024-10-09 14:07:10 +00:00
David Rodríguez
d10e09b7e3 [rubygems/rubygems] Add Gem::Specification#gem_dir back
If old Bundler versions that unconditionally try to remove this method
are run with RubyGems versions _without_ this method, Bundler crashes
because it tries to remove a method that does not exist.

We need to wait until RubyGems cannot install any Bundler versions that
unconditionally remove this method.

98804d261d
2024-10-09 12:18:05 +00:00
David Rodríguez
48410af53c [rubygems/rubygems] Fix a gem install crash during "done installing" hooks
It would happen when the gem is already installed to multiple GEM_PATHS.
RubyGems was removing duplicate specs without considering the
potentially different `base_dir`. That was causing the gem to be
misidentified as not already installed, and a nil specification getting
returned from the installer as a result, causing the crash.

Solve it by making sure `Gem::Specification.all` really iterates through
all the different specifications in all GEM_PATHs.

0d8c208f65
2024-10-09 10:07:11 +00:00
David Rodríguez
9f812522f5 [rubygems/rubygems] Allow gem pristine to reset default gems too
c9e665eb8a
2024-10-09 06:21:30 +00:00
David Rodríguez
73834f11fa [rubygems/rubygems] Fix Gem::Specification#gem_dir losing custom source for some reason
f8f589b1b8
2024-10-09 05:54:14 +00:00
David Rodríguez
83456d1e9a [rubygems/rubygems] Fix plugin command loading
The `LoadError` needs to be ignored because command may have been
defined and registered from a rubygems_plugin.rb file.

31f13d449b
2024-10-09 05:26:27 +00:00
John Bampton
3fc1495c30 Fix spelling 2024-10-09 07:14:44 +09:00
tomoya ishida
cb19dfca2c [ruby/irb] Change debug test workaround to use ENV
RUBY_DEBUG_TEST_UI
(https://github.com/ruby/irb/pull/1014)

9933584754
2024-10-08 15:15:43 +00:00
Hiroshi SHIBATA
638b4468b8 Call Resolv::DNS::Config#lazy_initialize explicitly if that instance is not initialized 2024-10-08 15:52:49 +09:00
David Rodríguez
a90861340a [rubygems/rubygems] Fix bundle.bat re-execution
It does not have ruby code, so we should not prepend `ruby` to the
command the re-execute it.

e04e00f7bb
2024-10-07 16:36:50 +00:00
Sam Bostock
c818606d84 [ruby/rdoc] Use normal font-weight for links
(https://github.com/ruby/rdoc/pull/1188)

b53f0cb2ed
2024-10-07 11:25:59 +00:00
tomoya ishida
0752fff215 [ruby/reline] Add cursor keys for application keypad mode to default
key bindings
(https://github.com/ruby/reline/pull/719)

* Add SS3 arrow sequence to default key bindings

* Remove wrong KDE arrow sequence

546a42522e
2024-10-07 00:37:33 +00:00
tomoya ishida
8f5abcb0c7 [ruby/reline] Allow utf-8 safe meta key mapping in inputrc
(https://github.com/ruby/reline/pull/723)

Readline's convert-meta setting is utf-8 unsafe.
Allow assigning `"\M-char": key` to bind "\echar": key even if convert-meta is not enabled.

9844b99c6e
2024-10-06 23:35:06 +00:00
tomoya ishida
98620f6c52 [ruby/irb] Change default completor from regexp to auto, try
TypeCompletor and fallback to RegexpCompletor.
(https://github.com/ruby/irb/pull/1010)

bb6a99d815
2024-10-06 11:10:12 +00:00
Samuel Giddins
dfa11551aa [rubygems/rubygems] More rubygems 3.2.x removals
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

272f3464a3
2024-10-04 20:01:52 +00:00
Samuel Giddins
7695bf183b [rubygems/rubygems] Remove CorrectHashForLambdaOperator monkey patch
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

085bafd8d4
2024-10-04 20:01:52 +00:00
Samuel Giddins
db6e6155d6 [rubygems/rubygems] Remove outdated conditionals from tests
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

06eec6d855
2024-10-04 20:01:51 +00:00
Samuel Giddins
bdc3363d0f [rubygems/rubygems] Update required_ruby_version to 3.1
3.0 has been EOL since march, drop support for it before the 3.4 release is cut

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

fc1f03b06a
2024-10-04 20:01:51 +00:00
Earlopain
66124cdb17 [ruby/prism] Use partial_script for the parser translators
Followup to https://github.com/ruby/prism/pull/3079

68f434e356
2024-10-03 12:52:02 +00:00
tomoya ishida
218445bb1f [ruby/rdoc] Fix ToRdoc#accept_table
(https://github.com/ruby/rdoc/pull/1184)

7b68545094
2024-10-03 12:27:43 +00:00
Nobuyoshi Nakada
9d4af312bd [ruby/reline] Rename matches? as match?
(https://github.com/ruby/reline/pull/753)

9230fe162d
2024-10-03 10:38:38 +00:00
tompng
f7343b636f prettyprint hash with colon style 2024-10-03 18:47:09 +09:00
Sadiq Saif
1b3f18afce each_address should now resolve for AAAA first
AAAA over A is standards track behaviour as per RFC 6724.
2024-10-03 15:04:46 +09:00
David Rodríguez
e77346153d [rubygems/rubygems] Remove compatibility code with old RubyGems
f11e42a3c5
2024-10-02 21:33:02 +00:00
tomoya ishida
09761e4789 [ruby/reline] Fix incremental search cancel bug
(https://github.com/ruby/reline/pull/748)

bf0f8fa333
2024-10-02 17:47:02 +00:00
tomoya ishida
8f4277f405 [ruby/reline] Add a timeout to cursor_pos
(https://github.com/ruby/reline/pull/750)

dd4a654e5d
2024-10-02 17:36:35 +00:00
David Rodríguez
acbdb30941 [rubygems/rubygems] Fix error in one source when fetching dependency APIs clearing results from all sources
0549ddbcc5
2024-10-02 10:37:26 +00:00
David Rodríguez
5000138084
[rubygems/rubygems] Fix bundler/inline resetting ENV
72d8d4dbba
2024-10-02 14:34:55 +09:00
David Rodríguez
a3929a9ca1
[rubygems/rubygems] The BUNDLER_SETUP env should also be cleaned up
47b7e50f64
2024-10-02 14:34:55 +09:00
David Rodríguez
49483904d8
[rubygems/rubygems] Make sure MissingSpecVersionError#to_s prints exception message
Gem command loading errors rely on `#to_s` on the raised exception, but
in the case of `MissingSpecVersionError` that was only the exception
name, making it printed twice and no message at all.

Before:

```
ERROR:  Loading command: install (Gem::MissingSpecVersionError)
 	Gem::MissingSpecVersionError
```

After:

```
ERROR:  Loading command: install (Gem::MissingSpecVersionError)
	Could not find 'io-wait' (>= 0.a) - did find: [io-wait-0.3.0-java]
  Checked in 'GEM_PATH=/Users/deivid/Code/rubygems/rubygems/bundler/tmp/1.1/gems/system' , execute `gem env` for more information
```

d06944bb2f
2024-10-02 14:34:55 +09:00
David Rodríguez
02d50d9cb1
[rubygems/rubygems] Simplify command loading
95f60f0e60
2024-10-02 14:34:54 +09:00
Hiroshi SHIBATA
63f31a9ed5 [ruby/singleton] Fixed double assignment
9d3c77a868
2024-10-02 05:33:31 +00:00
tomoya ishida
a8a921aef3 [ruby/irb] Use correct binding in debug mode
(https://github.com/ruby/irb/pull/1007)

In debug command, IRB's context was using wrong binding.
Some code colorization, command detection failed because binding.local_variable returned wrong value.

68f718de21
2024-10-02 03:18:35 +00:00
tomoya ishida
e320da6097 [ruby/reline] Fix Reline crash with invalid encoding history
(https://github.com/ruby/reline/pull/751)

e9d4b37e34
2024-10-01 17:01:38 +00:00
rm155
0f00544984
[ruby/singleton] Make compatible with Ruby 2.4
0a77bb492d
2024-10-01 17:59:43 +09:00
rm155
2f53c9fc62
[ruby/singleton] Clean VERSION freezing
f31334a736
2024-10-01 17:59:42 +09:00