Commit graph

12164 commits

Author SHA1 Message Date
David Rodríguez
2e04336b67
[rubygems/rubygems] Fix git source conservativeness
9a0e0dfd5b
2023-08-16 15:03:38 +09:00
David Rodríguez
4a3777bf6b
[rubygems/rubygems] Extract s.name to a variable
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.

0d8f31eeed
2023-08-16 15:03:38 +09:00
David Rodríguez
7bb3e637ff
[rubygems/rubygems] Don't update locked sources when not necessary
cfc82b592a
2023-08-16 15:03:38 +09:00
David Rodríguez
c57ab646cb
[rubygems/rubygems] Extract a default_source method
784e08348e
2023-08-16 15:03:38 +09:00
David Rodríguez
002165f8fe
[rubygems/rubygems] Move lockfile_source variable out of condition branch
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.

65b455a5cb
2023-08-16 15:03:38 +09:00
David Rodríguez
86492fca65
[rubygems/rubygems] Avoid unnecessary loop through dependencies
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

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

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
1077427152
2023-08-16 01:40:11 +00:00
Josh Nichols
70da92cdf7 [ruby/net-http] Fix on 2.7
5194fd541e
2023-08-16 01:40:10 +00:00
Josh Nichols
4d21134f3f [ruby/net-http] freeze rest of lib
455a74734a
2023-08-16 01:40:09 +00:00
Josh Nichols
4165ec91d8 [ruby/net-http] update net/http/response to be frozen string literal
dc3b4a75ca
2023-08-16 01:40:08 +00:00
Josh Nichols
2fbd8dca18 [ruby/net-http] turn on frozen strings for net/http/generic_request
b92ade088d
2023-08-16 01:40:08 +00:00
Josh Nichols
8d04260acd [ruby/net-http] turn on frozen strings for net/http/header
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.

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.

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`.

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 420e7d2270.

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

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.

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)

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`.

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)

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)

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.

0fef0ae160
2023-08-09 14:57:52 +00:00
Takashi Kokubun
cd8d20cd1f
YJIT: Compile exception handlers (#8171)
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2023-08-08 16:06:22 -07:00
Stan Lo
0387b86c3a [ruby/irb] Remove unused InputMethod#initialize
(https://github.com/ruby/irb/pull/635)

* Remove unused InputMethod#initialize

The constructor takes a `file_name` argument, but it is never used. The
only input method that needs a file is `FileInputMethod`, which has its
own constructor to take a file object directly.

So the constructor in `InputMethod` is not needed and its child classes
don't need to call `super` in their constructors.

* Remove unused FileInputMethod#file_name

153b1e9d1c
2023-08-07 15:30:13 +00:00
Benoit Daloze
70ef66f240 [ruby/yarp] Document the build system of YARP
85ae0e2816
2023-08-05 17:30:34 +00:00
Nobuyoshi Nakada
4e6861d337 Fix Gem::BUNDLED_GEMS.find_gem return value
If the required name is different from the found gem name, return the
gem name, instead of true that means the required name is an exact gem
name.
2023-08-05 18:56:37 +09:00
Hiroshi SHIBATA
6b570ff2c0 Display call location with bundled gems warning 2023-08-04 21:12:09 +09:00
Hiroshi SHIBATA
ae8fd392d5 Fixed worng key of bundled_gems list 2023-08-04 21:12:09 +09:00
Hiroshi SHIBATA
a0b695b4e6 Also decorate warning message with future tense for bundler 2023-08-04 21:12:09 +09:00
Hiroshi SHIBATA
ede3c5ee0f Use future tense if current version is older than list version 2023-08-04 21:12:09 +09:00
Stan Lo
32e828bb4a [ruby/irb] Deprecate multi-irb commands
(https://github.com/ruby/irb/pull/654)

* Deprecate multi-irb commands

- Print deprecated message when any of the commands are used
- Put related commands under `Multi-irb` category with a deprecated
  label

* Update readme

861731ac12
2023-08-02 18:35:08 +00:00
Hiroshi SHIBATA
28c2136722 [rubygems/rubygems] Replaced remained local to lockfile
6ed69223d4
2023-08-02 09:56:13 +00:00
Stan Lo
201fd57518 [ruby/irb] Drop src_encoding.rb
(https://github.com/ruby/irb/pull/634)

Its method `IRB.default_src_encoding` was only used in `magic-file.rb`,
which has been removed.

ed98983b1f
2023-08-02 18:17:27 +09:00
Stan Lo
f11ac06337 [ruby/irb] Add workspace category
(https://github.com/ruby/irb/pull/661)

* Create a new Workspace command category

* Update readme

310650c213
2023-08-01 12:51:30 +00:00
Hiroshi SHIBATA
de91ce980a [rubygems/rubygems] Use Kernel.singleton_class
9be984f281
2023-08-01 00:31:22 +00:00
Kevin Newton
04f4e0aeb2 [ruby/yarp] Document building, more macro changes
4214f262d2
2023-07-31 20:10:23 +00:00
Stan Lo
5d78ec8a94 [ruby/irb] Decouple edit and show_source commands
(https://github.com/ruby/irb/pull/658)

* Decouple `edit` command from `show_source`

2 commands should not depend on each other. If `edit` command also needs
to find a source, the source finding logic should be extracted into a
separate class.

* Return nil if is not an actual file path

* Refactor SourceFinder

9790517a0c
2023-07-31 19:57:36 +00:00
Mat Sadler
a3c0e9d90d [rubygems/rubygems] update Magnus library in Rust extension gem template
19a92a3367
2023-07-31 06:25:21 +00:00
Nobuyoshi Nakada
dfad14d83f [ruby/optparse] [DOC] Mark up constant and method names as code
e8bee0be8f
2023-07-30 02:35:22 +00:00
Nobuyoshi Nakada
67be453d9d [rubygems/rubygems] Set thread configurations inside block in the thread local manner
965e54b8f1
2023-07-30 01:37:43 +00:00
Nobuyoshi Nakada
0d86cc4caf [rubygems/rubygems] Use the dedicated method to convert file path
The dedicated method `File.path` to deal with pathname-like objects
has been provided since ruby 1.9.0.
Also adds a test for rubygems/rubygems#6837.

258c6eda80
2023-07-30 01:36:23 +00:00
Benoit Daloze
df5330b04e [ruby/rdoc] Use a more portable way to check if code is parseable
* The same as used in irb: https://github.com/ruby/irb/pull/134/files
* This works on all Ruby implementations, unlike `return` in BEGIN which
  can be quite difficult to support.

d19f7c66fe
2023-07-29 15:31:48 +00:00
ko1
bcf823fddb Revert "[rubygems/rubygems] Set thread configurations inside block"
This reverts commit db80e947a3.

This patch uses `Thread.abort_on_exception = true` and it affects
all of threads. This is why CI systems fails.

How to modify:

- use `thread.abort_on_exception = true` for specific threads
- Run this code in a separated process
2023-07-29 07:39:10 +09:00
Jenny Shen
17b50cdb68 [rubygems/rubygems] Add charset to Webauthn response content-type
442a3e8f37
2023-07-28 16:08:11 +00:00
Jenny Shen
db80e947a3 [rubygems/rubygems] Set thread configurations inside block
860b145359
2023-07-28 16:08:10 +00:00