Граф коммитов

1877 Коммитов

Автор SHA1 Сообщение Дата
David Rodríguez c925a2ee91
Update RSpec gems 2022-11-15 14:45:51 +09:00
Takashi Kokubun 18fa7059e8
Deal with different Ruby versions 2022-11-12 22:15:40 -08:00
Takashi Kokubun c0735d1d72
Fix a CI failure in bigdecimal 2022-11-12 21:55:00 -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
Hiroshi SHIBATA 28611be6ee Merge RubyGems/Bundler master from ee2f8398324af4bc1b95f7565ce2fda98126e026 2022-11-11 17:24:08 +09:00
Yusuke Endoh d5513da01d [rubygems/rubygems] Update bundler/spec/bundler/shared_helpers_spec.rb
https://github.com/rubygems/rubygems/commit/8b1481ba77

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-11-10 22:45:31 +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

https://github.com/rubygems/rubygems/commit/963cb65a2d
2022-11-10 22:45:31 +00:00
Bo Anderson 0df47fdaf9 [rubygems/rubygems] Add tests for universal Ruby with arch-specific prebuilt gems
https://github.com/rubygems/rubygems/commit/11229b16c3
2022-11-08 17:05:19 +00:00
Nobuyoshi Nakada cb2323a983
Thread#native_thread_id is very platform specific 2022-11-08 09:31:58 +09:00
Benoit Daloze 83decbb62b Update to ruby/spec@740ccc8 2022-11-07 20:05:30 +01:00
Benoit Daloze c99e4c4278 Update to ruby/mspec@1e16420 2022-11-07 20:05:18 +01:00
Nobuyoshi Nakada ee86b57ee5
Revert jobserver handling in spec 2022-11-07 15:54:40 +09:00
Nobuyoshi Nakada b02b8e7756
Let other test runners follow the change of GNU make 4.4 jobserver 2022-11-07 10:08:30 +09:00
Nobuyoshi Nakada 174ddc79c5
Skip `File.atime`/`File.mtime` tests randomly failing on Travis
Not only powerpc64le, also s390x and arm32 seem failing too.  These
failures are probably caused by filesystem settings on Travis, but
unrelated to CPUs.
2022-10-24 09:32:13 +09:00
Stephen Ierodiaconou 54cad3123a
[Bug #19004] `Complex.polar` handles complex singular `abs` argument
`Complex.polar` accepts Complex values as arguments for the polar form as long
as the value of the complex has no imaginary part (ie it is 'real'). In
`f_complex_polar` this is handled by extracting the real part of the arguments.
However in the case `polar` is called with only a single argument, the absolute
value (abs), then the Complex is created without applying a check on the type
of abs, meaning it is possible to create a Complex where the real part is itself
an instance of a Complex. This change removes the short circuit for the single
argument case meaning the real part extraction is performed correctly
(by f_complex_polar).

Also adds an example to `spec/ruby/core/complex/polar_spec.rb` to check that
the real part of a complex argument is correctly extracted and used in the
resulting Complex real and imaginary parts.
2022-10-23 12:59:06 +09:00
Yusuke Endoh e026368061 Range#size returns nil for (.."a") and (nil..)
Fixes [Bug #18983]
2022-10-21 16:35:46 +09:00
Ufuk Kayserilioglu 0378e2f4a8 Add Class#attached_object
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
2022-10-20 17:30:17 +02:00
Hiroshi SHIBATA 4f1e0bfacd
Followed up CVE-2022-39253 for bundler examples 2022-10-20 14:36:06 +09:00
Jemma Issroff 0aaa6133ed Transition frozen string to frozen root shape
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-10-19 11:06:19 -07:00
Hiroshi SHIBATA f5df47d1f3 Merge RubyGems/Bundler master
6214d00b23
2022-10-18 16:33:15 +09:00
David Rodríguez 5fa18a7b0c [rubygems/rubygems] Fix bad spec wording
https://github.com/rubygems/rubygems/commit/06faad1e05
2022-10-18 16:33:15 +09:00
David Rodríguez e956caea88 [rubygems/rubygems] Extract matcher for slow perf spec
https://github.com/rubygems/rubygems/commit/1c0eb63c6a
2022-10-18 16:33:15 +09:00
David Rodríguez 804ae4ea12 [rubygems/rubygems] Simplify SpecGroup creation
https://github.com/rubygems/rubygems/commit/788e46e152
2022-10-18 16:33:15 +09:00
Jean Boussier 60defe0a68 thread_sync.c: Clarify and document the behavior of timeout == 0
[Feature #18982]

Instead of introducing an `exception: false` argument to have `non_block`
return nil rather than raise, we can clearly document that a timeout of 0
immediately returns.

The code is refactored a bit to avoid doing a time calculation in
such case.
2022-10-17 16:56:00 +02:00
Hiroshi SHIBATA b734832883
Skip utime example with Intel C Compiler suite 2022-10-13 13:42:22 +09:00
Nobuyoshi Nakada 6c5a8c2043 Ignore excessive precisions 2022-10-10 13:41:46 +09:00
Samuel Williams 24f3e397e9
Add spec for `Coverage.supported?` and `start(eval: true)`. (#6499)
* Don't emit coverage for eval when eval coverage is disabled.
2022-10-08 00:33:40 +13:00
Samuel Williams e4f91bbdba
Add IO#timeout attribute and use it for blocking IO operations. (#5653) 2022-10-07 21:48:38 +13:00
Samuel Williams e696ec67ac
Introduce `Fiber.blocking{}` for bypassing the fiber scheduler. (#6498) 2022-10-06 23:00:49 +13:00
David Rodríguez 358fe26b31 [rubygems/rubygems] Fix little UI issue when bundler shows duplicated gems in a list
https://github.com/rubygems/rubygems/commit/3f71d882e9
2022-10-06 05:13:39 +09:00
David Rodríguez b2668248b6 [rubygems/rubygems] Make sure RSpec diffs don't omit the different part
We sometimes check assertions on lockfile contents, which involves
comparing a reasonably long string. Sometimes RSpec is not able to show
the part of the string that's actually different, making it hard to
figure out the issue.

Configuring this setting should fix the issue in most cases.

https://github.com/rubygems/rubygems/commit/5ad8ee499e
2022-10-04 06:22:50 +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.

https://github.com/rubygems/rubygems/commit/839a06851d
2022-10-03 20:41:45 +09:00
Victor Shepelev ad651925e3
Add Data class implementation: Simple immutable value object 2022-09-30 18:23:19 +09:00
Benoit Daloze aa53d69aa2 Add specs for {Method,UnboundMethod}#owner of a zsuper method 2022-09-29 15:48:35 +02:00
Benoit Daloze 94cea3e4d0 Fix {Method,UnboundMethod}#super_method for zsuper methods
* We need to resolve the zsuper method first, and then look the super
  method of that.
2022-09-29 15:48:35 +02:00
Hiroshi SHIBATA 9948b8bfec
Skip unpack_sockaddr_in with http at Solaris platform
http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20220929T050003Z.fail.html.gz
2022-09-29 15:47:08 +09:00
Benoit Daloze 31cf1bb525 Update to ruby/spec@1d9d5c6 2022-09-28 18:37:17 +02:00
Benoit Daloze 5a1ab740fc Update to ruby/mspec@b60306d 2022-09-28 18:37:16 +02: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
Vít Ondruch bcd30fb961 Re-enable TZ test missed due to merge conflict.
This was disabled by b7577b4d9e, while properly fixed upstream by:

https://github.com/ruby/spec/pull/939
2022-09-27 19:32:46 +02: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
Chris Salzberg 82ac4a2399 Support using at toplevel in wrapped script
Allow refinements to be used at the toplevel within a script that is
loaded under a module.

Fixes [Bug #18960]
2022-09-24 09:41:15 +09:00
Samuel Williams 9434a7333c Enable coverage for eval. 2022-09-22 22:19:12 +12:00
Yuta Saito 3f387e60ef Rescue File.expand_path in MSpecScript#try_load if HOME is unavailable
mspec tries to load ~/.mspecrc, but some platforms (e.g. WASI) doesn't
have HOME concept, so `~` cannot be expanded and `File.expand_path` can
fail.
2022-09-21 15:26:34 +09:00
Nobuyoshi Nakada bf72afa766
Remove warning for old TLS version connection
RubyGems.org already has refused connection requests using older than
TLS 1.2.
2022-09-15 14:48:47 +09:00
Benoit Daloze 14bcf69c9c Deprecate Encoding#replicate
* See [Feature #18949].
2022-09-10 19:02:15 +02:00
David Rodríguez e0cd466ae7 [rubygems/rubygems] Fix unused variable warning
https://github.com/rubygems/rubygems/commit/ca8d47e53a
2022-09-08 20:44:35 +09:00
David Rodríguez 24fd2f73d0 Resync Bundler & RubyGems 2022-09-08 11:25:03 +09:00
David Rodríguez 1f77cc3894 [rubygems/rubygems] Fix `set` not being found when running specs on dev rubies
https://github.com/rubygems/rubygems/commit/c5b2960388
2022-09-06 17:11:47 +09:00