19162 Commits

Author SHA1 Message Date
Kenichi Kamiya
a510175e8f [ruby/irb] Avoid raising errors while running help for custom
commands
(https://github.com/ruby/irb/pull/944)

* Avoid raising errors while running help for custom commands

Raising an error from the help command is not a pleasure for the
end user, even if the command does not define any attributes

* Update test/irb/command/test_custom_command.rb

---------

https://github.com/ruby/irb/commit/c8bba9f8dc

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-05-03 22:08:49 +00:00
Kenichi Kamiya
70db150fbc [ruby/irb] Fix typos in test/irb/command/test_custom_command.rb
(https://github.com/ruby/irb/pull/945)

https://github.com/ruby/irb/commit/f2b5fc192f
2024-05-03 21:34:34 +00:00
Kevin Newton
d4a6d0c177 [ruby/prism] Prism::Location#adjoin
https://github.com/ruby/prism/commit/a298db68e3
2024-05-03 19:14:03 +00:00
Kevin Newton
7a49edcf1f [ruby/prism] Prism::Node#tunnel
https://github.com/ruby/prism/commit/0bf5d651da
2024-05-03 18:37:19 +00:00
Kevin Newton
c631679b94
[PRISM] Disallow &. in MLHS 2024-05-03 14:15:59 -04:00
Kevin Newton
31c69698a7 [PRISM] Enable passing test for **nil 2024-05-03 13:32:32 -04:00
Kevin Newton
461d6d441f [PRISM] Enable RubyVM tests for prism 2024-05-03 13:11:09 -04:00
Kevin Newton
56672c8b18 [PRISM] Enable passing tests for index expressions 2024-05-03 13:01:40 -04:00
Kevin Newton
7caeff2bae [ruby/prism] Disallow keywords and blocks in index expressions
https://github.com/ruby/prism/commit/e950dc1e83
2024-05-03 13:01:40 -04:00
Nobuyoshi Nakada
91485d7dc6
Adjust indent [ci skip] 2024-05-04 01:15:09 +09:00
David Rodriguez
281df1e495 [rubygems/rubygems] Remove Gem::Specification#mark_version
This gets in the middle if we ever start allowing to build as if using a
different RubyGems version than the one being run.

This could be useful to make `gem rebuild` a little more usable, and
it's already done by Bundler specs which already make this method a noop
when they need this.

I'm not sure forcefully setting this, even if user explicitly specified
something else is helpful.

Since this could potentially prevent gems explicitly setting a constant
RubyGems version from building, I changed the error of incorrect
RubyGems version from a hard error to a warning, since it will start
happening in those cases if we stop overwriting the version.

https://github.com/rubygems/rubygems/commit/45676af80d
2024-05-03 15:12:55 +00:00
Kevin Newton
5758e45657 [ruby/prism] Change ConstantPathNode#child to ConstantPathNode#{name,name_loc}
This has been requested for a long time, and I'm finally doing it
now. Unfortunately this is a breaking change for all of the APIs.

I've added in a Ruby method for `#child` that is deprecated so that
existing usage doesn't break, but for everyone else this is going
to be a bit of a pain.

https://github.com/ruby/prism/commit/9cbe74464e
2024-05-03 11:11:57 -04:00
Jenny Shen
c1b11c50cb [rubygems/rubygems] Rename credential email to identifier in WebAuthn poller
https://github.com/rubygems/rubygems/commit/5e3e55f8bc
2024-05-03 10:54:27 +00:00
Nobuyoshi Nakada
9f8e87c44b
Test for win32/registry.rb 2024-05-03 14:47:18 +09:00
Kevin Newton
5409661fe6 Mark the first string element of a regexp as binary if US-ASCII 2024-05-02 22:46:09 -04:00
Kevin Newton
e34c131ce8 [PRISM] Disallow redundant returns from being line events 2024-05-02 15:16:15 -04:00
Stan Lo
945a99e81a Sync IRB 241e061 2024-05-02 14:33:30 -04:00
Kevin Newton
0981f03008 [PRISM] Enable newline test 2024-05-02 12:29:25 -04:00
tomoya ishida
c78cebb469 [ruby/reline] Fix default and additional key bindings vanish bug
(https://github.com/ruby/reline/pull/697)

https://github.com/ruby/reline/commit/fc9b4d2274
2024-05-02 14:41:07 +00:00
Kevin Newton
2eefbef2ee [PRISM] Enable test_ast.rb 2024-05-02 10:34:10 -04:00
Jeremy Evans
55720f372d [ruby/openssl] pkcs7: raise PKCS7Error for PKCS7 without content in PKCS7.read_smime
[pkuzco: expanded the fix for other content types]
[ky: adjusted formatting and the exception type]

https://github.com/ruby/openssl/commit/07eceb7f63

Co-authored-by: pkuzco <b.naamneh@gmail.com>
Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
2024-05-02 16:26:11 +09:00
Jeremy Evans
c9aa63a9e0 [ruby/openssl] pkcs7: raise ArgumentError for PKCS7 with no content in PKCS7.new
Fixes [Bug #19974]

[pkuzco: expanded the fix for other content types]
[ky: adjusted formatting and the exception type]

https://github.com/ruby/openssl/commit/27e11f2d1d

Co-authored-by: pkuzco <b.naamneh@gmail.com>
Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
2024-05-02 16:26:11 +09:00
Kazuki Yamaguchi
eb6f0000a4 [ruby/openssl] cipher: fix buffer overflow in Cipher#update
OpenSSL::Cipher#update currently allocates the output buffer with size
(input data length)+(the block size of the cipher). This is insufficient
for the id-aes{128,192,256}-wrap-pad (AES keywrap with padding) ciphers.
They have a block size of 8 bytes, but the output may be up to 15 bytes
larger than the input.

Use (input data length)+EVP_MAX_BLOCK_LENGTH (== 32) as the output
buffer size, instead. OpenSSL doesn't provide a generic way to tell the
maximum required buffer size for ciphers, but this is large enough for
all algorithms implemented in current versions of OpenSSL.

Fixes: https://bugs.ruby-lang.org/issues/20236

https://github.com/ruby/openssl/commit/3035559f54
2024-05-02 16:26:11 +09:00
tomoya ishida
eb82ea6218 [ruby/reline] Fix prompt width calculation bug. Test with colored
prompt
(https://github.com/ruby/reline/pull/695)

https://github.com/ruby/reline/commit/24aab01cbc
2024-05-02 06:06:31 +00:00
Kevin Newton
f109a83ddf [PRISM] Fix up error message expectations 2024-05-01 19:19:07 -04:00
Kevin Newton
ac0f6716b1 [PRISM] Respect frozen_string_literal option in RubyVM::InstructionSequence.compile 2024-05-01 19:19:07 -04:00
Kevin Newton
8ea6daa86d [PRISM] Enable passing tests in test_syntax.rb 2024-05-01 19:19:07 -04:00
Kevin Newton
1be5ede766 [PRISM] Error message for unterminated heredoc identifier 2024-05-01 19:19:07 -04:00
Kevin Newton
62f8fb7f89 [PRISM] Fix unterminated regular expression error message 2024-05-01 19:19:07 -04:00
Kevin Newton
5d1e4cd249 [PRISM] Better error messages for unwriteable targets 2024-05-01 19:19:07 -04:00
Kevin Newton
8e1647c3aa [ruby/prism] Support passing version 3.3.1
https://github.com/ruby/prism/commit/445a0f0d22
2024-05-01 23:03:25 +00:00
Kevin Newton
5cd0abdfb5 [PRISM] Simplify prism error highlighting 2024-05-01 16:57:29 -04:00
Kevin Newton
fc8fb581cf [ruby/prism] CRuby error message for trailing underscore in number
https://github.com/ruby/prism/commit/4e34f236d3
2024-05-01 19:51:09 +00:00
Kevin Newton
41f8ae1ffd [ruby/prism] Mark errors for invalid symbols
https://github.com/ruby/prism/commit/661884c4a3
2024-05-01 16:43:05 +00:00
Kevin Newton
cfe7019ef5 [ruby/prism] Match CRuby interpolation semantics
If a single string that is a static literal is interpolated, it
does not impact whether or not the parent is a static literal. In
this way, if you have something like a regular expression that
interpolates a string literal, it's possible that you will end up
pushing just a single regexp onto the stack as opposed to calling
out to toregexp.

https://github.com/ruby/prism/commit/4f096c2257
2024-05-01 12:34:29 -04:00
Kevin Newton
b6fa18fbe9 [PRISM] Properly precheck regexp for encoding issues 2024-05-01 12:34:29 -04:00
Kevin Newton
1b8650964b [PRISM] Support interpolated regexp with encoding modifiers 2024-05-01 12:34:29 -04:00
Peter Zhu
7ef8bb129f Fix memory leak in Ripper.sexp
rb_ast_dispose does not free the rb_ast_t causing it to be leaked. This
commit changes it to use rb_ast_free instead.

For example:

    require "ripper"

    10.times do
      100_000.times do
        Ripper.sexp("")
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    27648
    32512
    37376
    42240
    47232
    52224
    57344
    62208
    67072
    71936

After:

    22784
    22784
    22784
    22784
    22912
    22912
    22912
    22912
    22912
    22912
2024-05-01 11:09:54 -04:00
Stan Lo
1000c27db8 [ruby/irb] Support IRB.conf[:BACKTRACE_FILTER]
(https://github.com/ruby/irb/pull/917)

* Use 'irbtest-' instead if 'irb-' as prefix of test files.

Otherwise IRB would mis-recognize exceptions raised in test files as
exceptions raised in IRB itself.

* Support `IRB.conf[:BACKTRACE_FILTER]``

This config allows users to customize the backtrace of exceptions raised
and displayed in IRB sessions. This is useful for filtering out library
frames from the backtrace.

IRB expects the given value to response to `call` method and return
the filtered backtrace.

https://github.com/ruby/irb/commit/6f6e87d769
2024-05-01 14:23:09 +00:00
Nobuyoshi Nakada
57eca0a80d
Test for memory leak 2024-05-01 17:46:41 +09:00
Sutou Kouhei
0c13596686 [ruby/delegate] test: remove needless mu_pp
It's for minitest. We don't need it with test-unit.

https://github.com/ruby/delegate/commit/447cd43973
2024-04-30 23:31:26 +00:00
tomoya ishida
614187f8c2 [ruby/reline] Fix completion dialog position when completed part is
wordwrapped
(https://github.com/ruby/reline/pull/692)

https://github.com/ruby/reline/commit/2d9acd16fe
2024-04-30 16:51:25 +00:00
Peter Zhu
e0949c3f7c [ruby/openssl] Remove trailing space in test_ssl.rb
https://github.com/ruby/openssl/commit/911a31335f
2024-04-30 15:23:15 +00:00
Bart de Water
cc6657e563 [ruby/openssl] Add OpenSSL::Digest.digests to get a list of available digests
https://github.com/ruby/openssl/commit/08dd3c73b7
2024-04-30 15:05:50 +00:00
Samuel Williams
1699772ac4 [ruby/openssl] Introduce basic support for close_read and close_write.
https://github.com/ruby/openssl/commit/c99d24cee9
2024-04-30 14:51:58 +00:00
tomoya ishida
8fb430c1da [ruby/irb] Restore MAIN_CONTEXT correctly
(https://github.com/ruby/irb/pull/937)

https://github.com/ruby/irb/commit/c41f460a70
2024-04-30 10:29:38 +00:00
tomoya ishida
814d4b5e2c [ruby/reline] Input with eof and no newline bugfix
(https://github.com/ruby/reline/pull/671)

https://github.com/ruby/reline/commit/0d66c335a1
2024-04-29 13:23:03 +00:00
tomoya ishida
ae701031f5 [ruby/reline] Completely support full-width characters in
differential rendering
(https://github.com/ruby/reline/pull/654)

* Add a cut variation of Reline::Unicode.take_range method take_mbchar_range

* Consider fullwidth take_range in differential rendering

https://github.com/ruby/reline/commit/29714df09f
2024-04-29 12:08:59 +00:00
Mari Imaizumi
018c5717e5 [ruby/reline] Handle mode condition in inputrc
(https://github.com/ruby/reline/pull/687)

https://github.com/ruby/reline/commit/bed5fb3d77
2024-04-29 12:05:36 +00:00
Kevin Newton
ddce8ca831 [PRISM] Enable integer test 2024-04-26 17:01:13 -04:00