summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2025-01-15[ruby/erb] Make `ERB::NOT_GIVEN` ractor-shareablewanabe
https://github.com/ruby/erb/commit/348777b5bf
2025-01-14Better handle regexp in the parser translatorEarlopain
Turns out, it was already almost correct. If you disregard \c and \M style escapes, only a single character is allowed to be escaped in a regex so most tests passed already. There was also a mistake where the wrong value was constructed for the ast, this is now fixed. One test fails because of this, but I'm fairly sure it is because of a parser bug. For `/\“/`, the backslash is supposed to be removed because it is a multibyte character. But tbh, I don't entirely understand all the rules. Fixes more than half of the remaining ast differences for rubocop tests
2025-01-14[ruby/prism] Support forwarding flags on scopesKevin Newton
When parent scopes around an eval are forwarding parameters (like *, **, &, or ...) we need to know that information when we are in the parser. As such, we need to support passing that information into the scopes option. In order to do this, unfortunately we need a bunch of changes. The scopes option was previously an array of array of strings. These corresponded to the names of the locals in the parent scopes. We still support this, but now additionally support passing in a Prism::Scope instance at each index in the array. This Prism::Scope class holds both the names of the locals as well as an array of forwarding parameter names (symbols corresponding to the forwarding parameters). There is convenience function on the Prism module that creates a Prism::Scope object using Prism.scope. In JavaScript, we now additionally support an object much the same as the Ruby side. In Java, we now have a ParsingOptions.Scope class that holds that information. In the dump APIs, these objects in all 3 languages will add an additional byte for the forwarding flags in the middle of the scopes serialization. All of this is in service of properly parsing the following code: ```ruby def foo(*) = eval("bar(*)") ``` https://github.com/ruby/prism/commit/21abb6b7c4
2025-01-14[ruby/prism] Fix block parameters and it for RubyParserJustin Collins
https://github.com/ruby/prism/commit/7a93a307ac
2025-01-14[ruby/prism] Refactor serializerKevin Newton
https://github.com/ruby/prism/commit/8ab2532f09
2025-01-14[ruby/prism] Freeze AST optionKevin Newton
To make it so that you can pass `freeze: true` to Prism parse methods and get back a deeply-frozen AST that is Ractor- shareable. https://github.com/ruby/prism/commit/8e6a93b2d2
2025-01-14[DOC] About `create_makefile`Nobuyoshi Nakada
Describe two features that were missing from the documentation: - yields configuration part if a block is given. - "depend" file will be included. Notes: Merged: https://github.com/ruby/ruby/pull/12571
2025-01-14Use ronn-ng again for documentation generationDavid Rodríguez
We switched to nronn because ronn-ng felt abandoned, but it seems it has activity again, so switch back. Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[rubygems/rubygems] Don't remove platform specific variants from the ↵David Rodríguez
lockfile unless necessary Even if they don't match the current Ruby version, they could still work in other rubies. So it's better to keep them. https://github.com/rubygems/rubygems/commit/9a3e583b0c Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[rubygems/rubygems] Tiny parameter renameDavid Rodríguez
Just for consistency, since all the other methods in this class that receive an array of dependencies use `deps`. https://github.com/rubygems/rubygems/commit/eca1341950 Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[rubygems/rubygems] Extract `SpecSet#version_for`David Rodríguez
https://github.com/rubygems/rubygems/commit/a76fd6d3bf Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[rubygems/rubygems] Serialize gemspec when caching git sourceJosh LeBlanc
https://github.com/rubygems/rubygems/commit/8727d44024 Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[rubygems/rubygems] Do not fail on start when cannot find writable user ↵Vasily Fedoseyev
directory on ruby 3.4 https://github.com/rubygems/rubygems/commit/027cdc750a Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[rubygems/rubygems] Print message when blocking on a file lock.Ellen Marie Dash
https://github.com/rubygems/rubygems/commit/3ca7ef214c Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-13[ruby/prism] Fix parser translator tokens for `%x(#{})`Earlopain
It falsely considered it to be a single backtick command https://github.com/ruby/prism/commit/dd762be590
2025-01-13[ruby/prism] Fix parser translator heredoc dedention with leading interpolationEarlopain
```rb <<~F foo #{} bar F ``` has zero common whitespace. https://github.com/ruby/prism/commit/1f3c222a06
2025-01-12[ruby/prism] Fix parser translator tSPACE tokens for percent arraysEarlopain
Tests worked around this but the incompatibility is not hard to fix. This fixes 17 token incompatibilies in tests here that were previously passing https://github.com/ruby/prism/commit/101962526d
2025-01-12[ruby/prism] Frozen strings in the ASTKevin Newton
https://github.com/ruby/prism/commit/8d9d429155
2025-01-12[ruby/prism] Fix parser translator ranges for mulltiline strings with ↵Earlopain
multiline bytes A rather silly issue with a rather simple fix. The ranges already use the offset cache, this effectivly double-encoded them. https://github.com/ruby/prism/commit/66b65634c0
2025-01-12[ruby/prism] Fix parser translator tokens for comment-only fileEarlopain
In https://github.com/ruby/prism/pull/3393 I made a mistake. When there is no previous token, it wraps around to -1. Oops Additionally, if a comment has no newline then the offset should be kept as is https://github.com/ruby/prism/commit/3c266f1de4
2025-01-12[ruby/irb] Group private methods together in `IRB::Context`Stan Lo
(https://github.com/ruby/irb/pull/1064) This makes them easier to find and matches the convention of the codebase. https://github.com/ruby/irb/commit/ce8fa6857c
2025-01-12[ruby/irb] Drop ColorPrinter's workaround for BasicObjectStan Lo
(https://github.com/ruby/irb/pull/1051) `pp` 0.6.0+ includes https://github.com/ruby/pp/pull/26 to handle BasicObject, so we can drop the workaround. https://github.com/ruby/irb/commit/08908d43c7
2025-01-12[ruby/prism] Fix binary encoding for the parser translatorEarlopain
Skipping detecting the encoding is almost always right, just for binary it should actually happen. A symbol containing escapes that are invalid in utf-8 would fail to parse since symbols must be valid in the script encoding. Additionally, the parser gem would raise an exception somewhere during string handling https://github.com/ruby/prism/commit/fa0154d9e4
2025-01-11[ruby/prism] Better comment token handling for the parser translatorEarlopain
There appear to be a bunch of rules, changing behaviour for inline comments, multiple comments after another, etc. This seems to line up with reality pretty closely, token differences for RuboCop tests go from 1129 to 619 which seems pretty impressive https://github.com/ruby/prism/commit/2e1b92670c
2025-01-11[ruby/prism] Fix `not` receiverKevin Newton
`not foo` should be `!foo` `not()` should be `!nil` Fixes [Bug #21027] https://github.com/ruby/prism/commit/871ed4b462
2025-01-11[ruby/prism] Fix parser translator tokens for backslashes in single-quoted ↵Earlopain
strings and word arrays These are not line continuations. They either should be taken literally, or allow the word array to contain the following whitespace (newlines in this case) Before: ``` 0...1: tSTRING_BEG => "'" 1...12: tSTRING_CONTENT => "foobar\\\n" 12...16: tSTRING_CONTENT => "baz\n" 16...17: tSTRING_END => "'" 17...18: tNL => nil ``` After: ``` 0...1: tSTRING_BEG => "'" 1...6: tSTRING_CONTENT => "foo\\\n" 6...12: tSTRING_CONTENT => "bar\\\n" 12...16: tSTRING_CONTENT => "baz\n" 16...17: tSTRING_END => "'" 17...18: tNL => nil ``` https://github.com/ruby/prism/commit/b6554ad64e
2025-01-11[ruby/prism] Implement more string token escaping in the parser translatorEarlopain
This leaves `\c` and `\M` escaping but I don't understand how these should even work yet. Maybe later. https://github.com/ruby/prism/commit/13db3e8cb9
2025-01-11[ruby/prism] Better handle all kinds of multiline strings in the parser ↵Earlopain
translator This is a followup to #3373, where the implementation was extracted https://github.com/ruby/prism/commit/2637007929
2025-01-11[ruby/prism] Better handle multiline interpolated strings in the parser ↵Earlopain
translator Much of this logic should be shared between interpolated symbols and regexps. It's also incorrect when the node contains a literal `\\n` (same as for plain string nodes at the moment) https://github.com/ruby/prism/commit/561914f99b
2025-01-11[ruby/prism] Fix parser translator ast for empty regexEarlopain
In that specific case, no string node is emitted https://github.com/ruby/prism/commit/1166db13dd
2025-01-11[ruby/prism] Fix parser translator ast for regex with line continuationEarlopain
Turns out, the vast majority of work was already done with handling the same for heredocs I'm confident this should also apply to actual string nodes (there's even a todo for it) but no tests change if I apply it there too, so I can't say for sure if the logic would be correct. The individual test files are a bit too large, maybe something else would break that currently passes. Leaving it for later to look more closely into that. https://github.com/ruby/prism/commit/6bba1c54e1
2025-01-11[ruby/prism] Fix parser translator ast when using anonymous forwarding in ↵Earlopain
blocks/lambda Blocks and lambdas inherit anonymous arguments from the method they are a part of. They themselves don't allow to introduce new anonymous arguments. While you can write this: ```rb def foo(*) bar { |**| } end ``` referecing the new parameter inside of the block will always be a syntax error. https://github.com/ruby/prism/commit/2cbd27e134
2025-01-11[ruby/prism] Fix an incompatibility with the parser translatorEarlopain
The offset cache contains an entry for each byte so it can't be accessed via the string length. Adds tests for all variants except for this: ``` "fo o" "ba ’" ``` For some reason, this still has the wrong offset. https://github.com/ruby/prism/commit/a651126458
2025-01-11[ruby/prism] Bump to v1.3.0Kevin Newton
https://github.com/ruby/prism/commit/a679ee0e5c
2025-01-11[ruby/prism] Support 3.5 for version optionKevin Newton
https://github.com/ruby/prism/commit/6b6aa05bfb
2025-01-11[ruby/irb] `IRB.conf[:SAVE_HISTORY]` should handle boolean valuesStan Lo
(https://github.com/ruby/irb/pull/1062) Although not documented, `IRB.conf[:SAVE_HISTORY]` used to accept boolean, which now causes `NoMethodError` when used. This commit changes the behavior to accept boolean values and adds tests for the behavior. https://github.com/ruby/irb/commit/8b1a07b2a8
2025-01-11[ruby/irb] Print more actionable message when the exception may beStan Lo
an IRB issue (https://github.com/ruby/irb/pull/1061) https://github.com/ruby/irb/commit/4d74d39261
2025-01-10[ruby/irb] Gracefully handle incorrect command aliasesStan Lo
(https://github.com/ruby/irb/pull/1059) * Gracefully handle incorrect command aliases Even if the aliased target is a helper method or does not exist, IRB should not crash. This commit warns users in such cases and treat the input as normal expression. * Streamline command parsing and introduce warnings for incorrect command aliases https://github.com/ruby/irb/commit/9fc14eb74b
2025-01-10Make Pstore tests as optionalHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12537
2025-01-10Make logger as bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12537
2025-01-10Make benchmark as bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12537
2025-01-10Make pstore as bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12537
2025-01-09[rubygems/rubygems] Add credentials file path to "gem env".Ellen Marie Dash
There are 3 possible locations: - $HOME/.gem/credentials - $XDG_DATA_HOME/gem/credentials - $HOME/.local/share/gem/credentials https://github.com/rubygems/rubygems/commit/c51756b96e
2025-01-08[ruby/rdoc] Finalize RDoc::Options before callingKazuki Yamaguchi
RDoc::RDoc#parse_files (https://github.com/ruby/rdoc/pull/1274) Commit https://github.com/ruby/rdoc/commit/6cf6e1647b97, which went to v6.5.0, changed `RDoc::Options#parse` to not call `#finish` in it. While the commit adjusted other call sites, it missed `lib/rdoc/rubygems_hook.rb`. `RDoc::Options#finish` prepares the include paths for `:include:` directives. This has to be done before starting to parse sources. I think this should fix https://github.com/ruby/net-http/issues/193 + https://github.com/ruby/net-http/pull/194. https://github.com/ruby/rdoc/commit/d62da8ca09
2025-01-08Make ostruct as bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12531
2025-01-08Dont't use stub constants like LIBDIR in bundled_gems.rbHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12529
2025-01-07[ruby/reline] Update to Unicode 16.0.0Mari Imaizumi
(https://github.com/ruby/reline/pull/803) https://github.com/ruby/reline/commit/24e6128676
2025-01-07[ruby/rdoc] Add missing `RDoc::RubygemsHook` API for `gem server`mterada1228
(https://github.com/ruby/rdoc/pull/1270) This PR fixes https://github.com/ruby/rdoc/pull/1269. ## Expected Behavior `gem server` command is successful. ```console $ gem server Server started at http://[::]:8808 Server started at http://0.0.0.0:8808 ``` http://127.0.0.1:8808/ works. ## Actual Behavior `gem server` command doesn't work because `Gem::RDoc.load_rdoc` raises `NoMethodError`. ```console $ gem server ERROR: While executing gem ... (NoMethodError) undefined method 'load_rdoc' for class RDoc::RubygemsHook Gem::RDoc.load_rdoc ^^^^^^^^^^ /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:437:in 'Gem::Server#initialize' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:426:in 'Class#new' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:426:in 'Gem::Server.run' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/commands/server_command.rb:83:in 'Gem::Commands::ServerCommand#execute' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command.rb:326:in 'Gem::Command#invoke_with_build_args' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:253:in 'Gem::CommandManager#invoke_command' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:194:in 'Gem::CommandManager#process_args' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:152:in 'Gem::CommandManager#run' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/gem_runner.rb:57:in 'Gem::GemRunner#run' /Users/mterada/.rbenv/versions/3.4.1/bin/gem:12:in '<main>' ``` ## Versions ```console $ rdoc -v 6.10.0 ``` --------- https://github.com/ruby/rdoc/commit/b6a82244a2 Co-authored-by: Sutou Kouhei <[email protected]>
2025-01-06[ruby/reline] Enter newline if cursor position is middle of inputMari Imaizumi
(https://github.com/ruby/reline/pull/802) * Enter newline if cursor position is middle of input * Add ed_force_submit to allow input confirmation on non-final lines https://github.com/ruby/reline/commit/8ef534e904
2025-01-06[rubygems/rubygems] Update SPDX license list as of 2024-12-30License Update
https://github.com/rubygems/rubygems/commit/42aaaff15c