Commit graph

11330 commits

Author SHA1 Message Date
Shohei YOSHIDA
436aa6e64d [rubygems/rubygems] Fix '--force' option documentation of 'bundle clean'
'--path' option is no longer used.

43b3d5f7bc
2022-11-14 23:39:32 +00:00
Yusuke Endoh
d019c3a4bd [ruby/error_highlight] Bump version
5275078dc6
2022-11-14 06:37:33 +00:00
Yusuke Endoh
8bfd4dd4e1 [ruby/error_highlight] Enable ErrorHighlight for TypeError/ArgumentError only after Ruby 3.2
... because changing TypeError#message and ArgumentError#message is
highly incompatible.

39aa897c7a
2022-11-14 06:06:12 +00:00
Takashi Kokubun
96d29dff66
Fix invokebuiltin in Ruby MJIT
45fe7f7575/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb (L21)
has not been ported correctly.
2022-11-13 21:14:47 -08:00
Hiroshi SHIBATA
0a9d51ee9d Migrate our resolver engine to PubGrub
https://github.com/rubygems/rubygems/pull/5960

  Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2022-11-12 07:40:31 +09:00
Burdette Lamar
a48e01ccba [ruby/net-http] Update lib/net/http.rb
16d042fad6

Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2022-11-11 17:05:29 +00:00
BurdetteLamar
4d9ada223b [ruby/net-http] Prettify class hierarchies in Net::HTTP
4a5732e210
2022-11-11 17:05:28 +00:00
Hiroshi SHIBATA
28611be6ee Merge RubyGems/Bundler master from ee2f8398324af4bc1b95f7565ce2fda98126e026 2022-11-11 17:24:08 +09:00
Josef Šimánek
de159c5a85 [rubygems/rubygems] Store last check even when upgrade is not available and fix test.
bcffc2b0a5
2022-11-11 17:24:08 +09:00
Josef Šimánek
7ce0f81fbb [rubygems/rubygems] Use file in XDG_STATE_HOME directory to store last update check timestamp.
0fbc4ace8a
2022-11-11 17:24:08 +09:00
Josef Šimánek
c7d043065c [rubygems/rubygems] Add 'call for update' to RubyGems install command.
05811f8248
2022-11-11 17:24:08 +09:00
Jason Karns
ceeefb5870 [rubygems/rubygems] github source should default to secure protocol
Bundler 2 switched to secure https here c2e81f8ff6

Insecure protocols should be avoided to prevent MITM attacks.

758413364a
2022-11-11 17:24:08 +09:00
Takashi Kokubun
8fa83fa0b2 [ruby/irb] Transform ls's --grep/-G option to keyword args
(https://github.com/ruby/irb/pull/437)

* Transform ls's --grep/-G option to keyword args

* Make --grep less flexible

* Support -g instead of --grep

* Suppress warnings from symbol aliases
2022-11-10 22:55:15 +00:00
Yusuke Endoh
b5f809c496 [rubygems/rubygems] Load "bundler/setup" in lib/rubygems.rb
Ruby interpreter loads some special gems at startup: did_you_mean,
error_highlight, and syntax_suggest. These gems are loaded before
`bundler/setup` is loaded by `RUBYOPT=-rbundler/setup`.
So, the versions of the gems are not controllable by Gemfile.

This change will `require "bundler/setup"` in rubygems.rb (i.e., before
the special gems are loaded). Now `bundle exec` sets an environment
variable `BUNDLER_SETUP`, and rubygems requires the variable if defined.

See also: https://bugs.ruby-lang.org/issues/19089

963cb65a2d
2022-11-10 22:45:31 +00:00
Takashi Kokubun
0de3bc92b4 [ruby/irb] Make $ and @ default aliases
(https://github.com/ruby/irb/pull/438)

0613589476
2022-11-10 17:31:15 +00:00
Jemma Issroff
c726c48a3d Remove numiv from RObject
Since object shapes store the capacity of an object, we no longer
need the numiv field on RObjects. This gives us one extra slot which
we can use to give embedded objects one more instance variable (for a
total of 3 ivs). This commit removes the concept of numiv from RObject.
2022-11-10 10:11:34 -05:00
Jemma Issroff
5246f4027e Transition shape when object's capacity changes
This commit adds a `capacity` field to shapes, and adds shape
transitions whenever an object's capacity changes. Objects which are
allocated out of a bigger size pool will also make a transition from the
root shape to the shape with the correct capacity for their size pool
when they are allocated.

This commit will allow us to remove numiv from objects completely, and
will also mean we can guarantee that if two objects share shapes, their
IVs are in the same positions (an embedded and extended object cannot
share shapes). This will enable us to implement ivar sets in YJIT using
object shapes.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-11-10 10:11:34 -05:00
Bo Anderson
0df47fdaf9 [rubygems/rubygems] Add tests for universal Ruby with arch-specific prebuilt gems
11229b16c3
2022-11-08 17:05:19 +00:00
Bo Anderson
2244d5084e [rubygems/rubygems] Map 'universal' to the real arch in Bundler for prebuilt gem selection
dd0c94f16a
2022-11-08 17:05:18 +00:00
Yusuke Endoh
4e728486b9 [ruby/error_highlight] Bump version
59c291cce1
2022-11-08 08:07:39 +00:00
Takashi Kokubun
9001e53e68 [ruby/irb] Support non-string input in show_source
(https://github.com/ruby/irb/pull/430)

* Support non-string input in show_source

* Test show_source as a method
2022-11-07 17:29:28 +00:00
Stan Lo
ca0b592673 [ruby/irb] Don't lazily retrieve gem specs for completion
There are a few downsides of the current approach:

1. Because gem specs are lazily retrieved, this computation happens in
   every irb completion test case, which is not necessary. (In tests we
   don't cache the result of `retrieve_files_to_require_from_load_path`)
2. Gem::Specification.latest_specs is sensible to the content of
   LOAD_PATH. And when combined with 1, tests fail "randomly" if they
   try to mutate LOAD_PATH, even though the test subject it's something
   else.

So by pre-computing and storing the gem paths in a constant, it guarantees
that the computation only happens once and it doesn't get affected by test
cases.

One argument could be made against the change is that, it'll store
unnecessary data for users that disable autocompletion. But the
counter-arguments are:

1. Since autocompletion is enabled by default, this should not be the
   case for most users.
2. For users with autocompletion enabled, IRB already caches the
   result of `retrieve_files_to_require_from_load_path` in memory, which
   should have a similar size of GEM_SPECS. And we currently haven't
   received any report about problems caused by such memory consumption.

c671d39020
2022-11-07 14:44:25 +00:00
Yusuke Endoh
72c7dba436 [ruby/fileutils] Revert "FileUtils.rm* methods swallows only Errno::ENOENT when force is true"
This reverts commit fa65d676ec.

This caused some incompatibility problems in real-world cases.
https://bugs.ruby-lang.org/issues/18784#change-98927
https://bugs.ruby-lang.org/issues/18784#change-98967

42983c2553
2022-11-07 11:25:25 +00:00
Peter Zhu
b228effd0c [rubygems/rubygems] Drop support for IRIX
The IRIX OS is no longer maintained with the last release being 16 years
ago.

5381c6a871
2022-11-07 10:52:14 +00:00
Peter Zhu
1e53ebae57 [rubygems/rubygems] Drop support for bitrig
The bitrig OS is no longer maintained with the last release being 7
years ago.

85ed90ddd0
2022-11-07 10:52:14 +00:00
Peter Zhu
0fb7a1c77c [rubygems/rubygems] Drop support for HP-UX
Support for HP-UX was dropped in Ruby in ruby/ruby#5457.

a3a8df3582
2022-11-07 10:52:13 +00:00
Takashi Kokubun
b169d78c88 [ruby/erb] Avoid using prepend + super for fallback
(https://github.com/ruby/erb/pull/28)

`prepend` is prioritized more than ActiveSupport's monkey-patch, but the
monkey-patch needs to work.

611de5a865
2022-11-04 16:46:29 +00:00
Takashi Kokubun
dc5d06e9b1 [ruby/erb] Copy CGI.escapeHTML to ERB::Util.html_escape
ac9b219fa9
2022-11-04 07:07:23 +00:00
Takashi Kokubun
a13836e70d [ruby/irb] Allow non-identifier aliases like Pry's @ and $
(https://github.com/ruby/irb/pull/426)

* Allow non-identifier aliases

* Move the configuration to IRB.conf

* Avoid abusing method lookup for symbol aliases

* Add more alias tests

* A small optimization

* Assume non-nil Context

* Load IRB.conf earlier

e23db5132e
2022-11-03 22:09:55 +00:00
Stan Lo
c5d6a483f5 [ruby/irb] Refactor RubyLex and its tests
(https://github.com/ruby/irb/pull/427)

* Make sure `RubyLex#set_input`'s context is always present in tests

In real-world scenarios, the context should always be non-nil:
https://github.com/ruby/irb/blob/master/lib/irb.rb#L489

So we should make sure our test setup reflects that.

* Make context a required keyword

Since in practice, `set_input`'s context should always be non-nil, its
parameters should reflect that.

And since `RubyLex#check_state` is only called by `#lex` and
`#set_input`, both of which now always require context, we can assume
its context should be non-nil too.

1aeeb86203
2022-11-03 16:32:22 +00:00
Takashi Kokubun
c24800f4f7 [ruby/erb] Fix CI for JRuby
df642335b7
2022-11-03 05:58:13 +00:00
eileencodes
350d0aa023 [ruby/error_highlight] Support nodes in spot
Fixes a bug where `spot` was using the wrong local variable.

We want to use error highlight with code that has been eval'd,
specifically ERB templates. We can recover the compiled source code of
the ERB template but we need an API to pass the node into error
highlight's `spot`.

Required Ruby PR: https://github.com/ruby/ruby/pull/6593

0b1b650a59

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2022-10-31 04:58:38 +00:00
Whyme Lyu
37291df91d [ruby/optparse] #load() into hash
(https://github.com/ruby/optparse/pull/42)

OptionParser#load learns .load(into: Hash)

2ea626fcff

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-10-29 13:46:27 +00:00
Nobuyoshi Nakada
4021c6565f [ruby/irb] Do not make non-existent XDG directory on start
(https://github.com/ruby/irb/pull/357)


298b134792
2022-10-28 09:36:28 +00:00
Nobuyoshi Nakada
56c97a6621 [ruby/irb] Update regarding NO_COLOR value
https://no-color.org has been updated (jcs/no_color#83):

> Command-line software which adds ANSI color to its output by default
should check for a `NO_COLOR` environment variable that, when present
and **not an empty string** (regardless of its value), prevents the
addition of ANSI color.

46e0f7e370

Co-authored-by: Stan Lo <stan001212@gmail.com>
2022-10-28 09:30:24 +00:00
Shugo Maeda
5129ca3e05 [ruby/rdoc] Delay require "readline" in case the terminal is in raw mode 2022-10-27 08:16:06 +00:00
Takashi Kokubun
d6d9b5130e [ruby/erb] Version 3.0.0 2022-10-25 23:14:09 +00:00
Takuya Noguchi
ea989127eb Bundler: update docs for gemfile(5) manpage
- Add mswin/mswin64 to platforms
- Use TruffleRuby as example instead of Rubinius

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
Co-authored-by: André Arko <andre@arko.net>
2022-10-25 21:19:39 +00:00
Jean Boussier
217fdbf9aa [ruby/erb] url_encode: use CGI.escapeURIComponent
(https://github.com/ruby/erb/pull/23)

Ref: https://github.com/ruby/cgi/pull/26

This native implementation is much faster
and available in `cgi 0.3.3`.

2d90e9b010
2022-10-25 16:40:05 +00:00
Nobuyoshi Nakada
114e71d062 [ruby/tmpdir] Ignore empty environment variables
Fixes https://github.com/ruby/tmpdir/pull/17

a79c727a5d
2022-10-25 07:54:40 +00:00
Nobuyoshi Nakada
883d9c305f [ruby/tmpdir] Found or raise 2022-10-25 07:16:36 +00:00
Nobuyoshi Nakada
d55f72bcdb [ruby/tmpdir] Update supported and testing ruby versions 2022-10-25 06:59:30 +00:00
Peter Vandenberk
287c5da4aa [ruby/tmpdir] Make Dir.tmpdir more idiomatic and functional
Use `Enumerable#find` to iterate over the candidates, not `Enumerable.each`.

(this makes the code more functional, and - IMO - slightly more idiomatic,
as it avoids setting the "global" (by which I mean: non-local) `tmp`
variable from inside the block)

d1f20ad694
2022-10-25 06:59:16 +00:00
Nobuyoshi Nakada
cade3aba61 [ruby/tmpdir] Fix typo 2022-10-25 05:02:54 +00:00
Nobuyoshi Nakada
71a5b1d457
[ruby/tmpdir] [DOC] Improve documentation
b9c880f2b6
2022-10-25 13:57:56 +09:00
st0012
b7622d792d [ruby/irb] Move require out of repeated execution path
SHOW_DOC_DIALOG will be called repeatedly whenever the corresponding key
is pressed, but we only need to require rdoc once. So ideally the
require can be put outside of the proc.

And because when rdoc is not available the entire proc will be
nonfunctional, we can stop registering the SHOW_DOC_DIALOG if we failed
to require rdoc.

b1278b7320
2022-10-24 13:36:57 +00:00
Nobuyoshi Nakada
6700fa7f62
Set timestamp path for the target path to TARGET_SO_DIR_TIMESTAMP 2022-10-24 17:48:00 +09:00
Hiroshi SHIBATA
c5f5403f6e [ruby/net-http] Bump version to 0.3.0 2022-10-24 05:45:44 +00:00
Thomas E. Enebo
420bdba139 [rubygems/rubygems] Allow upcoming JRuby to pass keywords for Kernel#warn
jruby-head (which will be JRuby 9.4.0.0) can now properly process
the keywords to Kernel#warn.  I cannot think of any capability based
test for this so I constrained it using a version guard.  Only JRuby
will ever hit the version guard.

cd468c7e0f
2022-10-22 08:01:24 +00:00
Hiroshi SHIBATA
f88bff7705 [ruby/net-http] Revert "Replace Timeout.timeout in Net:HTTP#connect"
This reverts commit 753cae3bbc.

98caa38204
2022-10-21 12:39:52 +00:00