Commit graph

11330 commits

Author SHA1 Message Date
Mat Sadler
b4defea362 [rubygems/rubygems] install rust extensions into expected directory nesting
85ea86d348
2023-01-30 17:39:47 +00:00
Mat Sadler
ca951f6719 [rubygems/rubygems] use cargo to get crate name
the final copying of the extension into place has been slimmed
down, reflecting that it only needs to copy a single file, rather
than replicating the more involved process used for a C ext

this also refactors #build so that #cargo_crate_name only needs
to be called once, and hopefully the build flow is easier to
understand

5a0d7f2e6c
2023-01-30 17:39:47 +00:00
Mat Sadler
00e1ee4a7e [rubygems/rubygems] don't force Cargo.lock to be in gem root
371044c0ab
2023-01-30 17:39:46 +00:00
BurdetteLamar
8250b46794 [ruby/net-http] Correct doc error
dc006d8419
2023-01-28 21:41:15 +00:00
Daniel Colson
8429134d0d [rubygems/rubygems] Don't warn on bundler binstubs --standalone --all
Prior to this commit `bundle binstubs --standalone --all` would output a
warning about not being able to generate a standalone binstub for
bundler.

This warning predates the `--all` option, and I don't think it makes
sense in this context. The warning makes good sense when explicitly
trying to generate a bundler standalone binstub with `bundle binstubs
bundler --standalone`, since that command won't do what the user might
have expected. But `--all` is not specifically asking for bundler, and
having it report each time that the bundler binstubs could not be
generated does not seem particularly helpful. The only way to make that
warning go away would be to stop using `--standalone --all`.

This commit skips the warning when running with the `--all` option.

e6a72e19eb
2023-01-27 21:06:39 +00:00
Samuel Giddins
71256caf7f [rubygems/rubygems] Update the list of SPDX licence identifiers
18a9b0dc7e
2023-01-27 11:31:41 +09:00
Nobuyoshi Nakada
06e30df408 [ruby/syntax_suggest] Hide internal document and detail of Kernel monkey patching
https://bugs.ruby-lang.org/issues/19285

25ca82f8f9
2023-01-27 11:31:10 +09:00
Samuel Giddins
70829928cb [rubygems/rubygems] Deprecate Gem::List
It is unused, we will remove it in the next major version

c3f6c27d6d
2023-01-26 21:41:48 +00:00
Hiroshi SHIBATA
eb2670e32d [ruby/reline] Revert "correct Win32API capitalization for JRuby"
This reverts commit d6e7c9e1d9.

c47a5b684c
2023-01-26 04:27:52 +00:00
Hiroshi SHIBATA
d9fd048351 [rubygems/rubygems] blade is hosted under ruby-lang.org now
00fdef8a41
2023-01-23 05:55:46 +00:00
Hiroshi SHIBATA
d8751c0aa7 [ruby/cgi] blade is hosted under ruby-lang.org now
826ba3140c
2023-01-23 03:41:54 +00:00
Aaron Patterson
06b62cbbdd Add offsetof so we can get the offset of members
I want to get the offset of fields inside structs, but I don't want to
instantiate the struct.  I need to embed the offsets inside machine
code, and I can't get the offsets without calling `new` on the struct.

This commit adds an `offset` method so you can get the offset of a
member without instantiating anything.  You can do:

```ruby
C.rb_control_frame_t.offsetof(:sp) #=> 8
```

I don't think this implementation is perfect, you can only get immediate
fields.  But it is better than nothing!
2023-01-20 14:11:05 -08:00
tompng
4241b3cf2d [ruby/reline] accept new_indent > cursor_max
61cc580da4
2023-01-20 13:40:15 +00:00
Josh Nichols
0cc91871a8 [rubygems/rubygems] Update bundle-exec man page for with_unbundled_env
`with_clean_env` has been deprecated in `with_unbundled_env`. It already generates a deprecation warning when it uses, but this man page was still referring to it.
2023-01-20 13:06:58 +00:00
Burdette Lamar
401aa9ddd1 [ruby/net-http] [DOC] Header doc
(https://github.com/ruby/net-http/pull/104)

3308362d9b
2023-01-19 18:58:40 +00:00
Burdette Lamar
308942920f [ruby/net-http] [DOC] Enhanced RDoc for set_form
(https://github.com/ruby/net-http/pull/103)

f6506ff889
2023-01-18 21:03:58 +00:00
tompng
8e53f09baa [ruby/reline] Add constant MINIMUM_SCROLLBAR_HEIGHT for scrollbar rendering when dialog content is very long
d4c95f89ec
2023-01-18 14:49:29 +00:00
tompng
a712f2a2a0 [ruby/reline] Fix dialog scrollbar rendering position and disappearing bug
e21b69ade4
2023-01-18 14:49:28 +00:00
Stan Lo
cb9b885e78 [ruby/irb] Store context in RubyLex
Some background for this refactor:

1. Through a RubyLex instance's lifetime, the context passed to its methods
   should be the same.
   Given that `Context` is only initialised in `Irb#initialize`,
   this should be true.

2. When `RubyLex` is initialised, the context object should be accessible.
   This is also true in all 3 of `RubyLex.new`'s invocations.

With the above observations, we should be able to store the context in `RubyLex`
as an instance variable. And doing so will make `RubyLex`'s instance methods
easier to use and maintain.

5c8d3df2df
2023-01-14 09:19:09 +00:00
Yusuke Endoh
94d6d6d93f [ruby/error_highlight] Identify which node in Foo::Bar::Baz causes a NameError
In Ruby 3.2 or later, a nested constant access like `Foo::Bar::Baz` is
compiled to one instruction by the optimization https://github.com/ruby/ruby/pull/6187

We try to spot which sub-node caues a NameError in question based on the
constant name. We will give up if the same constant name is accessed in
a nested access (`Foo::Foo`).

Fixes https://github.com/ruby/error_highlight/pull/31

0a4db7da0a
2023-01-13 08:25:09 +00:00
Stan Lo
207f8d0027 [ruby/irb] Avoid calling private methods on the main object
(https://github.com/ruby/irb/pull/498)

When the main object is frozen, `IRB` wraps a `SimpleDelegator` around it.
But because `SimpleDelegator` doesn't delegate private methods, methods like
`require_relative` or `const_get` would cause error, which are needed for
lazily loading commands.

This commit works around this limitation by avoiding those private method calls
when setting up command execution.
2023-01-12 11:49:16 +00:00
Stan Lo
019c65828b [ruby/irb] Remove redundant argument defaults from some RubyLex
methods
(https://github.com/ruby/irb/pull/502)

* Remove unnecessary parameter defaults

These methods are always called with tokens specified. So their default
`@tokens` value is never used and is misleading.

* Remove unnecessary context default

* Require tokens for `RubyLex#check_state`
2023-01-12 10:30:17 +00:00
elfham
aa66595876 [ruby/reline] Update to Unicode 15.0.0
(https://github.com/ruby/reline/pull/437)

* Update to Unicode 14.0.0

* Update to Unicode 15.0.0
2023-01-12 09:40:34 +00:00
Jean Boussier
a8537eae2a [ruby/mutex_m] Avoid anonymous eval
It makes it hard to locate code when profiling etc.

8760ab19ec
2023-01-12 05:41:59 +00:00
Hiroshi SHIBATA
0e21c9f57e [ruby/mutex_m] Drop to support Ruby 2.4
9245b9a63a
2023-01-12 05:38:31 +00:00
tomoya ishida
0abb4b6348 [ruby/reline] Pass unmodifined lines(that does not include escape
sequence) to check_multiline_prompt
(https://github.com/ruby/reline/pull/458)

* pass unmodified lines to check_multiline_prompt

* Add test to check that output modified by output_modifier_proc is not passed to prompt_proc
2023-01-12 00:14:53 +00:00
Hiroshi SHIBATA
048751dd73
Generate parser-text.rb with bcdc058e50 2023-01-12 07:54:39 +09:00
Jean Boussier
bcdc058e50 [ruby/racc] Get rid of anonymous eval calls
Things declared in anonymous eval are always annoying to locate.
(profilers, etc)

f304205256
2023-01-12 07:52:29 +09:00
Masataka Pocke Kuwabara
11e15b4d48 [ruby/racc] Make racc Ractor compatible
1948de9d1d
2023-01-12 07:52:25 +09:00
Hiroshi SHIBATA
7e283c585e [ruby/irb] Formatting to header styles
cef125850d
2023-01-11 22:29:10 +00:00
Hiroshi SHIBATA
128398e7cd [ruby/irb] After Ruby 2.0, coding is always utf-8
7a94bc4135
2023-01-11 22:29:10 +00:00
Hiroshi SHIBATA
c7bb8d67b7 [ruby/irb] Removed Release Version and Revisions for old VCS software
07fae94862
2023-01-11 22:29:09 +00:00
Stan Lo
c693dfd7ef [ruby/irb] Drop unused arguments in RubyLex
(https://github.com/ruby/irb/pull/504)

* Simplify `RubyLex#set_prompt`

It's optional argument is never used by any caller.

* Remove the optional `p` argument from `RubyLex#set_input`

The argument is only used in a test case, which can be easily replaced by
a block argument.
2023-01-11 21:26:18 +00:00
Jean Boussier
e85ef212de [ruby/set] Avoid the block or return pattern to save Proc allocations
Using the block param in a boolean context like this cause it to be
allocated.

Using it with an `if` or `unless` was optimized in 3.2
(https://github.com/ruby/ruby/pull/6286) but using it with `or`
or `and` wasn't.

```ruby
def foo(&block)
  block or return 1
end

puts RubyVM::InstructionSequence.of(method(:foo)).disasm
== disasm: #<ISeq:foo@(irb):11 (11,0)-(13,3)> (catch: false)
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: 0, kw: -1@-1, kwrest: -1])
[ 1] block@0<Block>
0000 getblockparam                          block@0, 0                (  12)[LiCa]
0003 dup
0004 branchif                               10
0006 pop
0007 putobject_INT2FIX_1_
0008 leave                                  [Re]
0009 putnil
0010 leave
```

versus

```
def foo(&block)
  return 1 if block
end

puts RubyVM::InstructionSequence.of(method(:foo)).disasm
== disasm: #<ISeq:foo@(irb):15 (15,0)-(17,3)> (catch: false)
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: 0, kw: -1@-1, kwrest: -1])
[ 1] block@0<Block>
0000 getblockparamproxy                     block@0, 0                (  16)[LiCa]
0003 branchunless                           7
0005 putobject_INT2FIX_1_
0006 leave                                                            (  17)[Re]
0007 putnil                                                           (  16)
0008 leave
```

e89da977d4
2023-01-11 09:26:08 +00:00
Phillip Hellewell
97f8f2c470 [ruby/reline] Add key binding for Delete
603eacee22
2023-01-10 12:18:14 +00:00
Hiroshi SHIBATA
a43f1d90c2 Merge RubyGems and Bundler master
from 0635c1423d
2023-01-10 15:53:07 +09:00
Hiroshi SHIBATA
f2fc7519b7
Removed vendored LICENSE file. 2023-01-10 13:13:06 +09:00
David Rodríguez
2e0159c5f2 [rubygems/rubygems] Fix resolver edge case
Let it deal with legacy gems with equivalent version and different
dependencies.

b430babe97
2023-01-10 12:58:28 +09:00
Nobuyoshi Nakada
29dc9378d9 mkmf.rb: Refine message from pkg_config 2023-01-09 21:44:15 +09:00
Nobuyoshi Nakada
0d7bbfc941 mkmf.rb: Prefer caller_locations over parsing caller 2023-01-09 21:44:15 +09:00
Burdette Lamar
41a947e72a [ruby/uri] [DOC] Enhanced RDoc for URI
(https://github.com/ruby/uri/pull/55)

89ab4f1407
2023-01-08 23:14:50 +00:00
Burdette Lamar
20b691d664 [ruby/uri] [DOC] Enhanced RDoc for URI.decode_www_form
(https://github.com/ruby/uri/pull/53)

ce379e6125
2023-01-08 17:11:12 +00:00
Nobuyoshi Nakada
89546dce21 [rubygems/rubygems] [DOC] Remove internal document about Kernel monkey patch
https://bugs.ruby-lang.org/issues/19285

1e22219ed4
2023-01-08 08:09:34 +00:00
Nobuyoshi Nakada
55aa1a206c [rubygems/rubygems] LoadError#path on the caught exception does not need to protect
a31f5d1a18
2023-01-08 08:09:34 +00:00
Nobuyoshi Nakada
1a1b653c9c [rubygems/rubygems] Let RDoc parse the doc of Kernel#require
Since RDoc does not parse string literals as documents, `eval` the
entire file instead of embedding in a here-document.
On the contrary, as `gem_original_require` alias is an implementation
detail but not for users, it should not be documented.

cad4cf16cf
2023-01-08 08:09:33 +00:00
Burdette Lamar
fd98169e00 [ruby/uri] [DOC] Common rdoc (https://github.com/ruby/uri/pull/52)
be8047028f
2023-01-07 19:22:36 +00:00
Yuki Nishijima
651a098ea1 [ruby/did_you_mean] Keep the deprecated API for another year in case this could break 'bundle install'
0f4b0806b7
2023-01-07 08:47:05 +00:00
Burdette Lamar
ddbf7be94d [ruby/uri] [DOC] Enhanced RDoc for common methods
(https://github.com/ruby/uri/pull/50)

7ff4fb372b
2023-01-06 14:20:38 +00:00
Nobuyoshi Nakada
b94656147b mkmf.rb: Refactor splitting configure_args and remove duplicate code 2023-01-06 20:00:53 +09:00
Burdette Lamar
f7243d1afb [ruby/uri] [DOC] Common methods rdoc
(https://github.com/ruby/uri/pull/49)

02dfc79366
2023-01-04 19:59:05 +00:00