Commit graph

14659 commits

Author SHA1 Message Date
Stan Lo
93cffcf961 [ruby/irb] Bump version to v1.13.1
(https://github.com/ruby/irb/pull/951)

66318d0a34
2024-05-05 11:11:31 +00:00
Stan Lo
e973f9cbb3 [ruby/irb] Clarify that the context is IRB context
(https://github.com/ruby/irb/pull/950)

8cde57f55a
2024-05-05 10:44:52 +00:00
Mari Imaizumi
fca6c55a53 [ruby/reline] Remove not implemented variables
(https://github.com/ruby/reline/pull/699)

328699e901
2024-05-05 07:22:52 +00:00
tomoya ishida
d679afe9f9 [ruby/reline] Add name defined in readline to completion key
bindings C-i C-p C-n
(https://github.com/ruby/reline/pull/698)

1314787bbb
2024-05-05 07:09:52 +00:00
Koichi ITO
b181ba7400 [ruby/prism] Use version: 3.3.1 against Translation::Parser
Follow up https://github.com/ruby/prism/pull/2760.

This PR updates the `Translation::Parser` to use version 3.3.1 when the version 3.3 is specified.
The Parser gem is structured to support the latest patch versions, hence this aligns with Parser-compatible versioning.
As noted in https://github.com/ruby/prism/pull/2760, the behavior remains unchanged with this switch from 3.3.0 to 3.3.1.

efde09d318
2024-05-04 16:31:58 +00:00
tomoya ishida
96710a3139 [ruby/irb] Change debug test workaround only enabled when output is
tty
(https://github.com/ruby/irb/pull/949)

3f231b8622
2024-05-04 09:03:55 +00:00
Stan Lo
bd42f0898d [ruby/irb] Improve help message for no meta commands
(https://github.com/ruby/irb/pull/948)

* Remove unnecessary code from command tests

* Improve help message for no meta commands

1. Add placeholder values for both command category and description
2. Update help command's output to give different types of categories
   more explicit ordering

b1ef58aeff
2024-05-04 03:32:34 +00:00
Stan Lo
fb2ea7084f [ruby/irb] Use flag instead of caller for debug's binding.irb
check
(https://github.com/ruby/irb/pull/947)

4a4d7a4279
2024-05-04 03:22:17 +00:00
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

---------

c8bba9f8dc

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-05-03 22:08:49 +00:00
Kevin Newton
d4a6d0c177 [ruby/prism] Prism::Location#adjoin
a298db68e3
2024-05-03 19:14:03 +00:00
Kevin Newton
7a49edcf1f [ruby/prism] Prism::Node#tunnel
0bf5d651da
2024-05-03 18:37:19 +00:00
Vinicius Stock
4fbb208185 [ruby/prism] Create specialized ASCIISource with asciionly optimizations
40993166a8
2024-05-03 18:10:21 +00:00
Kevin Newton
97654bee49 [ruby/prism] Remove deprecated #child usage
14d9b431e2
2024-05-03 16:02:13 +00: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.

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.

9cbe74464e
2024-05-03 11:11:57 -04:00
Kevin Newton
1d51e929b1 [ruby/prism] Assume eval context for ruby_parser and ripper
e4d6984892
2024-05-03 13:12:27 +00:00
Earlopain
32b1dea566 [ruby/prism] Assume an eval context for Prism::Translation::Parser
This is similar to https://github.com/davidwessman/syntax_tree-erb/issues/81 but for RuboCop
The parser gem doesn't support these types of checks,
see https://github.com/whitequark/parser?tab=readme-ov-file#syntax-check-of-block-exits

While this is technically a bug in the parser gem, it does increase compatibility
and allows prism to be used when linting erb or haml with a RuboCop extension.

6c59ae6a00
2024-05-03 12:53:01 +00:00
Kevin Newton
7c029f612f [ruby/prism] Remove generics from sorbet types
080d84fd03
2024-05-03 12:36:57 +00:00
Jenny Shen
c1b11c50cb [rubygems/rubygems] Rename credential email to identifier in WebAuthn poller
5e3e55f8bc
2024-05-03 10:54:27 +00:00
Stan Lo
945a99e81a Sync IRB 241e061 2024-05-02 14:33:30 -04:00
Mari Imaizumi
008f2b9b6a [ruby/reline] Bump version to 0.5.5
(https://github.com/ruby/reline/pull/696)

8bf71d0b81
2024-05-02 16:28:19 +00:00
tomoya ishida
032070d793 [ruby/irb] Add workaround for ruby/debug/test/console/irb_test
failing with StdioInputMethod
(https://github.com/ruby/irb/pull/943)

acf3c1816e
2024-05-02 16:21:46 +00:00
Kevin Newton
7c0cf71049 [ruby/prism] Node#script_lines and supporting infra
cb4a8ab772
2024-05-02 15:27:18 +00:00
tomoya ishida
c78cebb469 [ruby/reline] Fix default and additional key bindings vanish bug
(https://github.com/ruby/reline/pull/697)

fc9b4d2274
2024-05-02 14:41:07 +00:00
tomoya ishida
eb82ea6218 [ruby/reline] Fix prompt width calculation bug. Test with colored
prompt
(https://github.com/ruby/reline/pull/695)

24aab01cbc
2024-05-02 06:06:31 +00:00
Mari Imaizumi
fdf88a2c10 [ruby/reline] Avoid reading .inputrc repeatedly
(https://github.com/ruby/reline/pull/694)

c8d4802a0f
2024-05-02 05:50:08 +00:00
Kevin Newton
8e1647c3aa [ruby/prism] Support passing version 3.3.1
445a0f0d22
2024-05-01 23:03:25 +00:00
Stan Lo
fef6f5f2e1 [ruby/irb] Bump version to v1.13.0
(https://github.com/ruby/irb/pull/941)

* Bump version to v1.13.0

* Add Documentation category to changelog

b9b1f35c99
2024-05-01 15:20:01 +00:00
tomoya ishida
77f5301cd1 [ruby/irb] Let IRB::Color.colorable? always return true|false
(https://github.com/ruby/irb/pull/940)

0bbe435ffe
2024-05-01 14:52:53 +00: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.

6f6e87d769
2024-05-01 14:23:09 +00:00
Alan Wu
2a978ee047
YJIT: Fix Struct accessors not firing tracing events (#10690)
* YJIT: Fix `Struct` accessors not firing tracing events

Reading and writing to structs should fire `c_call` and `c_return`, but
YJIT wasn't correctly dropping those calls when tracing.
This has been missing since this functionality was added in 3081c83169,
but the added test only fails when ran in isolation with
`--yjit-call-threshold=1`. The test sometimes failed on CI.

* RJIT: YJIT: Fix `Struct` readers not firing tracing events

Same issue as YJIT, but it looks like RJIT doesn't support writing to
structs, so only reading needs changing.
2024-05-01 10:22:41 -04:00
tomoya ishida
614187f8c2 [ruby/reline] Fix completion dialog position when completed part is
wordwrapped
(https://github.com/ruby/reline/pull/692)

2d9acd16fe
2024-04-30 16:51:25 +00:00
Samuel Giddins
d7ba0fec49 [rubygems/rubygems] Update lib/rubygems/package.rb
c4e75b9f74
2024-04-30 15:34:49 +00:00
Samuel Giddins
d950609ec7 [rubygems/rubygems] Add a limit to the size of the metadata and checksums files in a gem package.
This is to prevent a malicious gem from causing a denial of service by
including a very large metadata or checksums file,
which is then read into memory in its entirety just by opening the gem package.

This is guaranteed to limit the amount of memory needed, since
gzips (which use deflate streams for compression) have a maximum compression
ratio of 1032:1, so the uncompressed size of the metadata or checksums file
will be at most 1032 times the size of the (limited) amount of data read.

This prevents a gem from causing 500GB of memory to be allocated
to read a 500MB metadata file.

a596e3c5ec
2024-04-30 15:34:48 +00:00
tomoya ishida
8fb430c1da [ruby/irb] Restore MAIN_CONTEXT correctly
(https://github.com/ruby/irb/pull/937)

c41f460a70
2024-04-30 10:29:38 +00:00
Mari Imaizumi
dbb1ba88eb [ruby/reline] Bump version to 0.5.4
(https://github.com/ruby/reline/pull/691)

3f27286a5e
2024-04-29 13:35:59 +00:00
tomoya ishida
814d4b5e2c [ruby/reline] Input with eof and no newline bugfix
(https://github.com/ruby/reline/pull/671)

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

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)

bed5fb3d77
2024-04-29 12:05:36 +00:00
David Rodriguez
435f449b4e [rubygems/rubygems] Make sure to force latest resolvable version explicitly
To make sure we can always update to the latest resolvable version for
each gem explicitly requested for update, we first run a full update,
and then add explicit exact requirements to the resolved versions. This
may lead into conflicts, but our resolver already automatically parses
those and unlocks additional gems to fix them.

01c0bf34f0
2024-04-29 10:29:29 +00:00
David Rodríguez
491195af02 [rubygems/rubygems] Keep track of gems requested for update explicitly
ea43e4c6d7
2024-04-29 10:29:28 +00:00
David Rodriguez
83933f921b [rubygems/rubygems] No need to reset version promoter here
Since resolution options don't change.

5c5aa38c06
2024-04-29 10:29:28 +00:00
David Rodríguez
53571de8e9 [rubygems/rubygems] Fix circular require warning
241d0aafcd
2024-04-29 09:04:33 +00:00
David Rodríguez
d6cb62a88f [rubygems/rubygems] Show better error when installed gemspecs are unreadable
924f87c8a9
2024-04-29 08:57:35 +00:00
David Rodríguez
68a1867f53 [rubygems/rubygems] Fix issue with bundle update with an out of sync lockfile
An old platform related bug fix made some existing lockfiles no longer
work because they included invalid platforms. So to make it backwards
compatible, code was added to remove invalid platforms from the lockfile
before resolution. This is skipped though when Gemfile has changed
dependencies because in that case we will be re-resolving anyways.
However, in the `bundle update` case, the detection of "dependencies
have changed" was not actually working making Bundler remove all
platforms and not be able to resolve.

6452adfd62
2024-04-29 08:56:55 +00:00
Andy Waite
6203307f16 [rubygems/rubygems] Address PR feedback
62be097a32
2024-04-29 08:42:07 +00:00
Andy Waite
2a683f3f7d [rubygems/rubygems] Clarify bundle check behaviour in docs
c438c6db2e
2024-04-29 08:42:07 +00:00
Kevin Newton
3872e54039 [ruby/prism] Bump to v0.27.0
c9edeef91a
2024-04-26 17:01:03 -04:00
Kevin Newton
9688093124 [ruby/prism] Location#slice_lines, Node#slice_lines
9b61f6fdb3
2024-04-26 19:05:32 +00:00
Stan Lo
148518baa0 [ruby/irb] Suppress command return values
(https://github.com/ruby/irb/pull/934)

Since commands can't be chained with methods, their return values are
not intended to be used. But if IRB keeps storing command return values
as the last value, and print them, users may rely on such implicit
behaviour.

So to avoid such confusion, this commit suppresses command's
return values. It also updates some commands that currently rely on
this implicit behaviour.

fa96bea76f
2024-04-26 17:52:12 +00:00