Josh Nichols
921c2bba4e
[rubygems/rubygems] ENV.to_h returns a new hash, so we can `select!` it to avoid allocating another hash.
...
`String#start_with?` is faster than regex that is bound to the start of
a string.
https://github.com/rubygems/rubygems/commit/9b2006ef09
2023-08-20 09:05:56 +00:00
Samuel Giddins
7e5c3ec5b1
Update specification.rb
...
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2023-08-20 09:05:29 +00:00
Samuel Giddins
1935433f5f
[rubygems/rubygems] Ensure that loading multiple gemspecs with legacy YAML class references does not warn
...
Before this, you would get constant redefinition warnings on Psych::DefaultKey
Additionally, ensure the retries wont continue infinitely in the case of the ArgumentError not being caused by Marshal trying to load the undefined classes
https://github.com/rubygems/rubygems/commit/919e8c2de4
2023-08-20 09:05:17 +00:00
Akira Matsuda
f69f775f24
[rubygems/rubygems] choose_from_list may return nil index since
...
https://github.com/rubygems/rubygems/commit/abacb0cb34cd
https://github.com/rubygems/rubygems/commit/5e2e9d6e50
2023-08-20 09:04:38 +00:00
Kevin Newton
bd440bf85d
[ruby/yarp] Bump to version 0.8.0
...
https://github.com/ruby/yarp/commit/bfde753702
2023-08-19 01:14:10 +00:00
Ngan Pham
3d7a030112
[rubygems/rubygems] Resolve ruby version file relative to bundle root
...
This is a follow up to https://github.com/rubygems/rubygems/issues/6742 .
This change makes it so that the version file is resolved relative to
the Bundle root instead of the working directory.
Why is this useful?
If you run a commnad (eg `rails`) from the `app/` directory, your bundle
would fail to load.
https://github.com/rubygems/rubygems/commit/6d47ee98b9
2023-08-18 19:14:14 +00:00
John Hong
744bc4d5d0
[rubygems/rubygems] Make nil a valid license spec
...
https://github.com/rubygems/rubygems/commit/675effb67e
2023-08-18 16:42:49 +00:00
License Update
20106fe227
[rubygems/rubygems] Update SPDX license list as of 2023-06-18
...
https://github.com/rubygems/rubygems/commit/3db9165335
2023-08-18 08:21:13 +00:00
Kevin Newton
995fd11bde
[ruby/yarp] Remove strange :"#arg_rest" local
...
https://github.com/ruby/yarp/commit/66ecec218d
2023-08-18 00:06:57 +00:00
Martin Emde
e913431687
[rubygems/rubygems] Raise Gem::Package::FormatError on EOF, indicating corrupt gem
...
Gem::Package::TarReader::Entry now raises EOFError or returns nil
appropriately based on Ruby core IO.read and IO.readpartial behavior.
Zlib will respond accordingly by raising Zlib::GzipFile::Error on EOF.
When verifying a gem or extracting contents, raise FormatError similar
to other cases of corrupt gems.
Addresses a bug where Gem::Package would attempt to call size on nil
instead of raising a more descriptive and useful error, leading users
to assume the problem is internal to rubygems.
Remove unused error class TarReader::UnexpectedEOF that was never raised
since the NoMethodError on nil would happen first. Use EOFError instead.
https://github.com/rubygems/rubygems/commit/dc6129644b
2023-08-17 23:16:57 +00:00
Takashi Kokubun
67b5f63e97
Render YARP templates in the build process ( #8228 )
2023-08-17 14:39:04 -07:00
Kevin Newton
81d715099c
[ruby/yarp] Treat yp_buffer_t as an opaque pointer
...
Right now, we have to keep the buffer FFI object in sync with the
definition of yp_buffer_t because we access its fields directly. If
we add more fields or change the order, things will get out of sync.
Instead, let's treat yp_buffer_t as an opaque pointer and access
its fields through accessor functions directly. This is more
consistent with how we handle strings anyway.
https://github.com/ruby/yarp/commit/878d845eff
2023-08-17 09:58:56 -07:00
Ngan Pham
75a4767525
[rubygems/rubygems] Add `file` option to `ruby` method in Gemfile
...
https://github.com/rubygems/rubygems/commit/fb9354b7bf
2023-08-17 16:07:54 +00:00
Manu
7433c8f7dd
[rubygems/rubygems] Clarify that `bundle info` takes a gem name
...
https://github.com/rubygems/rubygems/commit/09ef74ef73
2023-08-17 10:39:31 +00:00
Takashi Kokubun
3873b1eb39
Resync YARP
2023-08-16 17:47:32 -07:00
Benoit Daloze
3536cad902
[ruby/yarp] Fixes so `bundle exec rake` can run on JRuby and TruffleRuby
...
https://github.com/ruby/yarp/commit/e6cea4fa08
2023-08-16 17:47:32 -07:00
Kevin Newton
ecf2e84c05
[ruby/yarp] Add a CHANGELOG
...
https://github.com/ruby/yarp/commit/b490ff0919
2023-08-16 17:47:32 -07:00
Kevin Newton
820a58c228
[ruby/yarp] Hide debug methods
...
https://github.com/ruby/yarp/commit/aa0dc2f301
2023-08-16 17:47:32 -07:00
Kevin Newton
3d032cf3e8
[ruby/yarp] Simplify creation of numerics
...
https://github.com/ruby/yarp/commit/e5f6ffa23a
2023-08-16 17:47:32 -07:00
Mike Dalessio
0f8091947d
[ruby/yarp] Move the gem's C extension into lib/yarp/
...
and change the require from "yarp.so" to "yarp/yarp", which is more
aligned with existing community conventions for gems.
https://github.com/ruby/yarp/commit/64b70e2658
2023-08-16 17:47:32 -07:00
Stan Lo
5a40f7db54
[ruby/irb] Encapsulate input details in Statement objects
...
(https://github.com/ruby/irb/pull/682 )
* Introduce Statement class
* Split Statement class for better clarity
https://github.com/ruby/irb/commit/65e8e68690
2023-08-16 10:13:46 +00:00
David Rodríguez
fe240b672b
[rubygems/rubygems] Show better error when PAT can't authenticate to a private server
...
Before:
```
Fetching gem metadata from https://rubygems.org/ ........
Fetching source index from https://rubygems.pkg.github.com/my-org/
Bad username or password for https://x-access-token@rubygems.pkg.github.com/my-org/ .
Please double-check your credentials and correct them.
```
After:
```
Fetching gem metadata from https://rubygems.org/ ........
Fetching source index from https://rubygems.pkg.github.com/my-org/
Access token could not be authenticated for https://x-access-token@rubygems.pkg.github.com/my-org/ .
Make sure it's valid and has the necessary scopes configured.
```
https://github.com/rubygems/rubygems/commit/2ae69c964a
2023-08-16 15:03:38 +09:00
David Rodríguez
e678affe70
[rubygems/rubygems] Bad auth should not fallback either
...
https://github.com/rubygems/rubygems/commit/ba3ea27869
2023-08-16 15:03:38 +09:00
David Rodríguez
2e04336b67
[rubygems/rubygems] Fix git source conservativeness
...
https://github.com/rubygems/rubygems/commit/9a0e0dfd5b
2023-08-16 15:03:38 +09:00
David Rodríguez
4a3777bf6b
[rubygems/rubygems] Extract s.name to a variable
...
https://github.com/rubygems/rubygems/commit/689c39b42f
2023-08-16 15:03:38 +09:00
David Rodríguez
e92ace6be7
[rubygems/rubygems] Remove unneeded stuff
...
This should be only for path sources, and unrelated to git.
https://github.com/rubygems/rubygems/commit/0d8f31eeed
2023-08-16 15:03:38 +09:00
David Rodríguez
7bb3e637ff
[rubygems/rubygems] Don't update locked sources when not necessary
...
https://github.com/rubygems/rubygems/commit/cfc82b592a
2023-08-16 15:03:38 +09:00
David Rodríguez
c57ab646cb
[rubygems/rubygems] Extract a `default_source` method
...
https://github.com/rubygems/rubygems/commit/784e08348e
2023-08-16 15:03:38 +09:00
David Rodríguez
002165f8fe
[rubygems/rubygems] Move `lockfile_source` variable out of condition branch
...
https://github.com/rubygems/rubygems/commit/efebc64250
2023-08-16 15:03:38 +09:00
David Rodríguez
6bc63ab9bb
[rubygems/rubygems] Refactor locked dep filtering more
...
We only need to check whether the spec if for a direct dependency once.
https://github.com/rubygems/rubygems/commit/65b455a5cb
2023-08-16 15:03:38 +09:00
David Rodríguez
86492fca65
[rubygems/rubygems] Avoid unnecessary loop through dependencies
...
https://github.com/rubygems/rubygems/commit/2ab63bb94d
2023-08-16 15:03:38 +09:00
Josh Nichols
af67ced3b0
[ruby/net-http] Update lib/net/http.rb
...
@natematykiewicz's suggestion to avoid another string allocation
https://github.com/ruby/net-http/commit/4a22c42338
Co-authored-by: Nate Matykiewicz <natematykiewicz@gmail.com>
2023-08-16 01:40:13 +00:00
Josh Nichols
ae68a8df58
[ruby/net-http] Update lib/net/http/response.rb
...
@natematykiewicz's suggestion to avoid a string allocation
https://github.com/ruby/net-http/commit/925630f227
Co-authored-by: Nate Matykiewicz <natematykiewicz@gmail.com>
2023-08-16 01:40:12 +00:00
Josh Nichols
ea321a654d
[ruby/net-http] use +'' everywhere
...
https://github.com/ruby/net-http/commit/1077427152
2023-08-16 01:40:11 +00:00
Josh Nichols
70da92cdf7
[ruby/net-http] Fix on 2.7
...
https://github.com/ruby/net-http/commit/5194fd541e
2023-08-16 01:40:10 +00:00
Josh Nichols
4d21134f3f
[ruby/net-http] freeze rest of lib
...
https://github.com/ruby/net-http/commit/455a74734a
2023-08-16 01:40:09 +00:00
Josh Nichols
4165ec91d8
[ruby/net-http] update net/http/response to be frozen string literal
...
https://github.com/ruby/net-http/commit/dc3b4a75ca
2023-08-16 01:40:08 +00:00
Josh Nichols
2fbd8dca18
[ruby/net-http] turn on frozen strings for net/http/generic_request
...
https://github.com/ruby/net-http/commit/b92ade088d
2023-08-16 01:40:08 +00:00
Josh Nichols
8d04260acd
[ruby/net-http] turn on frozen strings for net/http/header
...
https://github.com/ruby/net-http/commit/a5203c9f92
2023-08-16 01:40:07 +00:00
Josh Nichols
0300ea5a6c
[ruby/net-http] Improve performance of HTTPHeader#content_type
...
In the existing implementation, `main_type` and `sub_type` would end up
being called multiple times potentially.
Instead of doing that, save the result so it can be re-used.
https://github.com/ruby/net-http/commit/179976f7ea
2023-08-16 01:39:08 +00:00
Stan Lo
7f8f62c93b
[ruby/irb] Support seamless integration with ruby/debug
...
(https://github.com/ruby/irb/pull/575 )
* Support native integration with ruby/debug
* Prevent using multi-irb and activating debugger at the same time
Multi-irb makes a few assumptions:
- IRB will manage all threads that host sub-irb sessions
- All IRB sessions will be run on the threads created by IRB itself
However, when using the debugger these assumptions are broken:
- `debug` will freeze ALL threads when it suspends the session (e.g. when
hitting a breakpoint, or performing step-debugging).
- Since the irb-debug integration runs IRB as the debugger's interface,
it will be run on the debugger's thread, which is not managed by IRB.
So we should prevent the 2 features from being used at the same time.
To do that, we check if the other feature is already activated when
executing the commands that would activate the other feature.
https://github.com/ruby/irb/commit/d8fb3246be
2023-08-13 18:30:34 +00:00
Stan Lo
9099d62ac7
[ruby/irb] Move IO configuration to IRB::Irb
...
(https://github.com/ruby/irb/pull/681 )
It shouldn't be `RubyLex`'s responsibility to handle IO. So this moves
the configuration to `IRB::Irb`.
https://github.com/ruby/irb/commit/daff750076
2023-08-13 15:23:04 +00:00
Nobuyoshi Nakada
3af5badae8
[ruby/irb] Remove useless `begin`/`end` [ci skip]
...
(https://github.com/ruby/irb/pull/680 )
The `rescue` was removed at https://github.com/ruby/irb/commit/420e7d227011 .
https://github.com/ruby/irb/commit/8fa688e9c0
2023-08-13 15:02:29 +00:00
tomoya ishida
e1683b4958
[ruby/irb] Drop showing indent level number in DEFAULT prompt and
...
INF_RUBY prompt
(https://github.com/ruby/irb/pull/679 )
* Drop showing indent level number in DEFAULT prompt and INF_RUBY prompt
* Update prompt part of test_rendering's expected result
https://github.com/ruby/irb/commit/3847532e54
2023-08-12 10:19:24 +00:00
Stan Lo
680835085d
[ruby/irb] Reline/ReadlineInputMethod should inherit
...
StdioInputMethod
(https://github.com/ruby/irb/pull/671 )
They are both built on top of stdio and are basically extended version
of StdioInputMethod. They also share several attributes and methods with
StdioInputMethod.
https://github.com/ruby/irb/commit/c5f5abdbde
2023-08-12 10:17:52 +00:00
tomoya ishida
d42891079f
[ruby/irb] Remove needless removal of trailing whitespace in
...
check_code_state
(https://github.com/ruby/irb/pull/678 )
https://github.com/ruby/irb/commit/4a6af7d1ed
2023-08-11 18:51:25 +00:00
Stan Lo
0781e55206
[ruby/irb] Move assignment check to RubyLex
...
(https://github.com/ruby/irb/pull/670 )
Since assignment check relies on tokenization with `Ripper`, it feels like
the responsibility of `RubyLex`. `Irb#eval_input` should simply get the result
when calling `each_top_level_statement` on `RubyLex`.
https://github.com/ruby/irb/commit/89d1adb3fd
2023-08-11 18:44:52 +00:00
Stan Lo
43721b1d4a
[ruby/irb] Don't echo an expression's result when it ends with a
...
semicolon
(https://github.com/ruby/irb/pull/669 )
https://github.com/ruby/irb/commit/50185c2833
2023-08-11 16:18:58 +00:00
Stan Lo
d3311e5cc3
[ruby/irb] Add black and white color to IRB::Color
...
(https://github.com/ruby/irb/pull/676 )
https://github.com/ruby/irb/commit/a2763acade
2023-08-11 16:03:11 +00:00
Stan Lo
ab0f90f1f5
[ruby/irb] Fix nested IRB sessions' history saving
...
(https://github.com/ruby/irb/pull/652 )
1. Dynamically including `HistorySavingAbility` makes things unnecessarily
complicated and should be avoided.
2. Because both `Reline` and `Readline` use a single `HISTORY` constant
to store history data. When nesting IRB sessions, only the first IRB
session should handle history loading and saving so we can avoid
duplicating history.
3. History saving callback should NOT be stored in `IRB.conf` as it's
recreated every time `IRB.setup` is called, which would happen when
nesting IRB sessions.
https://github.com/ruby/irb/commit/0fef0ae160
2023-08-09 14:57:52 +00:00