Commit graph

11330 commits

Author SHA1 Message Date
Nishant Patel
cdbaac3f4b [ruby/open-uri] feat: allow option to pass version of SSL / TLS to use during communication. Allow versions are OpenSSL::SSL::SSLContext::METHODS
8729858517
2022-10-06 18:00:57 +09:00
Jean Boussier
d15b38d944 [ruby/open-uri] Avoid busting the global constant cache
`Object#extend(mod)` bump the global constant cache if the module
has constants of its own.

So by moving these constants outside of `Meta` we avoid bumping
the cache.

363c399bac
2022-10-06 16:55:44 +09:00
Daniel Colson
3e84290213 [ruby/rdoc] Remove unused abbrev require
This library originally used `abbrev` to expand abbreviations into
fully-qualified classes, but that was replaced in
f9ffe6684e

`abbrev` is no longer used anywhere, so this commit removes the require.

b76775f27d
2022-10-06 10:04:41 +09:00
David Rodríguez
358fe26b31 [rubygems/rubygems] Fix little UI issue when bundler shows duplicated gems in a list
3f71d882e9
2022-10-06 05:13:39 +09:00
Imir Kiyamov
83a6213f31 [ruby/irb] Fixed sort of variables in completion
5842888255
2022-10-05 19:22:13 +09:00
Kaíque Kandy Koga
d880322243 [ruby/irb] Update remark of self.install_extend_commands.
Create line

64d6a461d5
2022-10-05 19:15:28 +09:00
Hiroshi SHIBATA
2f6a263787 [ruby/irb] Use USE_REIDLINE for backword compatibility
e58a3c1b39
2022-10-05 18:59:31 +09:00
Gannon McGibbon
19e4a4c624 [ruby/irb] Rename IDB::ReidlineInputMethod to IRB::RelineInputMethod
Deprecates IDB::ReidlineInputMethod and USE_REIDLINE in favor of
IRB::RelineInputMethod and USE_RELINE. The Input method uses Reline to
read input from the console, so it can be named directly after the
Reline library like other inputs methods are (Readline, Stdio, etc.).

5bcade7130
2022-10-05 17:14:19 +09:00
st0012
203b831065 [ruby/irb] Bump version to 1.4.2
f9960dbd37
2022-10-05 15:25:02 +09:00
Hiroshi SHIBATA
f081bba875 [ruby/irb] Added aycabta to authors
a6bfa7b2e6
2022-10-05 15:15:33 +09:00
Victor Gama
bc6c1e0e25 [rubygems/rubygems] Copy template contents instead of file and perms
This allows the file to be created without copying permissions
from Bundler's installation source. The previous behaviour was
noticed after installing Ruby through brew, and using bundle
init, which yielded a read-only Gemfile.

839a06851d
2022-10-03 20:41:45 +09:00
st0012
10e830c25b [ruby/irb] Remove unused error
f09a1874b6
2022-10-03 07:00:54 +09:00
st0012
b97e909ef4 [ruby/irb] Remove unnecessary Thread presence check
They were introduced around 20 years ago, when Thread is not yet
stabilized. So we don't need them anymore.

4c75e03b2b
2022-10-03 07:00:53 +09:00
osyo-manga
7b88ffb34f [ruby/irb] Change to explicit method call in completion (https://github.com/ruby/irb/pull/369)
Ensure that methods are called even when local variables are defined.
see: https://github.com/ruby/irb/issues/368

c34d54b8bb
2022-10-03 06:55:53 +09:00
st0012
5cab9d0ee2 [ruby/irb] Remove patches for Ruby 2.4
They were added in b34f26a0dd

0e760d2674
2022-10-03 04:59:51 +09:00
st0012
42fcbcc215 [ruby/irb] Remove unnecessary condition
daffb8bfe5
2022-10-03 04:59:50 +09:00
st0012
55e2116f2c [ruby/irb] Refactor ripper_lex_without_warning
0db0a8ddc5
2022-10-03 04:59:49 +09:00
Nobuyoshi Nakada
7f1ca66642
Fallback PKG_CONFIG to the configured pkg-config always 2022-10-02 15:19:14 +09:00
Aaron Patterson
9a6803c90b
Revert "This commit implements the Object Shapes technique in CRuby."
This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
2022-09-30 16:01:50 -07:00
David Rodríguez
a44040c9e4 [rubygems/rubygems] Add notes to make sure we don't forget to backport changes to Bundler
1ac5b14c78

Co-authored-by: André Arko <andre@arko.net>
2022-10-01 05:46:41 +09:00
David Rodríguez
f04d249e83 [rubygems/rubygems] Fix matching of eabihf platforms
a03d30cd58
2022-10-01 05:46:40 +09:00
David Rodríguez
8252ea2140 [rubygems/rubygems] Fix matching of linux platforms with eabi modifiers
89362c18ef

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2022-10-01 05:46:40 +09:00
David Rodríguez
4d58ee3de0 [rubygems/rubygems] Refactor platform matching on Linux
I think this highlights better how musl is special.

4075771697
2022-10-01 05:46:39 +09:00
tompng
641310ce37 [ruby/irb] Fix ripper_lex_without_warning duplicated heredoc token
45b539af39
2022-10-01 04:17:15 +09:00
Jenny Shen
28840d74c2 [rubygems/rubygems] Refine error message to check the push URL instead of just the host
46990f3292
2022-09-29 17:56:36 +09:00
Jenny Shen
17b783ad9e [rubygems/rubygems] Surface entire redirect uri in permanent redirections
da7837630b
2022-09-29 17:56:35 +09:00
Jenny Shen
1cbf0fd863 [rubygems/rubygems] Add error message when api response is a permanent redirect
ccca30c77a

Co-authored-by: Nick Schwaderer <nick.schwaderer@shopify.com>
2022-09-29 17:56:34 +09:00
Jemma Issroff
d594a5a8bd
This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28 08:26:21 -07:00
Jeremy Evans
cd77e71bba [ruby/net-http] Remove ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE
This list is out of date.  At least OpenBSD since 2013 does not
allow one user to read the environment variables of a process
run by another user.

While we could try to keep the list updated, I think it's a bad
idea to not use the user/password from the environment, even if
another user on the system could read it.  If http_proxy exists
in the environment, and other users can read it, it doesn't
make it more secure for Ruby to ignore it.  You could argue that
it encourages poor security practices, but net/http should provide
mechanism, not policy.

Fixes [Bug #18908]

1e4585153d
2022-09-28 17:26:03 +09:00
Mike Dalessio
8f7f12ad64 [rubygems/rubygems] fix: Gem::Platform.match handles String argument properly
Previously 9eead86 introduced non-commutativity of platforms, and
later commit 1b9f7f50 changed the behavior of `Gem::Platform.match` to
ensure the callee of `#=~` was the gem platform.

However, when the platform argument is a String, then the callee and
argument of `#=~` are flipped (see docs for `String#=~`), which works
against the fix from 1b9f7f50.

Closes #5938

3b1fb562e8
2022-09-28 05:55:28 +09:00
Lars Kanis
9d56d9975d [ruby/timeout] Explicit add the timeout thread to default ThreadGroup
Otherwise the timeout thread would be added to the ThreadGroup of the thread that makes the first call to Timeout.timeout .

Fixes bug 19020: https://bugs.ruby-lang.org/issues/19020

Add a test case to make sure the common thread doesn't leak to another ThreadGroup

c4f1385c9a
2022-09-28 01:59:35 +09:00
Hiroshi SHIBATA
95d5b33ea0
syntax_suggest moved under the ruby organization from zombocom 2022-09-27 12:44:30 +09:00
Aaron Patterson
06abfa5be6
Revert this until we can figure out WB issues or remove shapes from GC
Revert "* expand tabs. [ci skip]"

This reverts commit 830b5b5c35.

Revert "This commit implements the Object Shapes technique in CRuby."

This reverts commit 9ddfd2ca00.
2022-09-26 16:10:11 -07:00
Jemma Issroff
9ddfd2ca00 This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-26 09:21:30 -07:00
Samuel Williams
22af2e9084 Rework vm_core to use int first_lineno struct member. 2022-09-26 00:41:16 +13:00
Takashi Kokubun
0c9dc01a2a Skip struct fields whose output differs
across different environments
2022-09-23 06:44:28 +09:00
Takashi Kokubun
dfc311c0b3 Swap the positions of offsetof and type 2022-09-23 06:44:28 +09:00
Takashi Kokubun
4c6e1556b1 Bindgen immediate types with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun
280ff1707e Drop c_64 and c_32 2022-09-23 06:44:28 +09:00
Takashi Kokubun
5cda5938f8 Bindgen enum with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun
00c441ce7a Bindgen macro with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun
f2bea691cd Builtin RubyVM::MJIT::C 2022-09-23 06:44:28 +09:00
Otávio Schwanck dos Santos
696e8914b7 [ruby/reline] PR changes
e8e8d81f47
2022-09-22 22:28:38 +09:00
Otávio Schwanck dos Santos
9d19d910c0 [ruby/reline] Revert "update version"
This reverts commit ce1ac86179.

86602cd244
2022-09-22 22:28:37 +09:00
Otávio Schwanck dos Santos
224a3ea718 [ruby/reline] update version
ce1ac86179
2022-09-22 22:28:37 +09:00
Otávio Schwanck dos Santos
9fb18e6314 [ruby/reline] fix vi-operator-arg
d42cdb8f91
2022-09-22 22:28:36 +09:00
Hiroshi SHIBATA
928aeef330 [ruby/cgi] Bump up 0.3.3
c1ffa3a428
2022-09-22 17:29:55 +09:00
Aaron Patterson
ec93d09c94 add rb_execution_context 2022-09-21 22:20:35 -07:00
Aaron Patterson
083b4bb655 add rb_control_frame_t 2022-09-21 22:20:35 -07:00
Takuya Noguchi
830b2e217b [rubygems/rubygems] Update GitLab CI template with new one
GitLab CI now needs the default keyword on specification of image
and before_script.

https://docs.gitlab.com/ee/ci/yaml/#default

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

b79e78e733
2022-09-22 11:42:57 +09:00