summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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 <kou@cozmixng.org>
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
2025-01-06[ruby/logger] Provide a 'Changelog' link on rubygems.org/gems/loggerMark Young
By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/logger which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/#metadata https://github.com/ruby/logger/commit/c6c64b02a0
2025-01-06[ruby/net-http] Provide a 'Changelog' link on rubygems.org/gems/net-httpMark Young
By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/net-http which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/#metadata https://github.com/ruby/net-http/commit/eeb728fefe
2025-01-06[ruby/ostruct] Provide a 'Changelog' link on rubygems.org/gems/ostructMark Young
By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/ostruct which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/#metadata https://github.com/ruby/ostruct/commit/47d84001eb
2025-01-06[ruby/securerandom] Provide a 'Changelog' link on rubygems.org/gems/securerandomMark Young
By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/securerandom which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/#metadata https://github.com/ruby/securerandom/commit/3e0249deaf
2025-01-05[ruby/prism] Fix parser translator ast for heredoc with written newlinesEarlopain
Heredocs that contain "\\n" don't start a new string node. https://github.com/ruby/prism/commit/61d9d3a15e
2025-01-05Sync IRB to 3e6c12b (#12486)Stan Lo
Sync IRB to 3e6c12b174c0a961d8065eae22f6c4afc7b2c3e8 Notes: Merged-By: tompng <tomoyapenguin@gmail.com>
2025-01-05[ruby/reline] Refactor utf-8 strings and invalid strings in testtomoya ishida
code (https://github.com/ruby/reline/pull/800) * Remove invalid encoding string "\M-[char]" from test code, remove unused code/arg/options * Omit unicode unnoralized input test in non-utf8 testcase * Remove helper method and constant no longer used in testcode * Change key binding test to use realistic bytes instead of invalid byte sequence * Remove invalid byte sequence input from rendering test yamatanooroti handles invalid byte sequence input "\M-[char]" and converts it to "\e[char]" We don't need to use these invalid byte sequence and rely on the hack implemented in yamatanooroti https://github.com/ruby/reline/commit/f09e7b154c
2025-01-05[ruby/reline] Fix bracketed paste and scrolling bugtomoya ishida
(https://github.com/ruby/reline/pull/801) * Fix set_pasting_state bug with bracketed paste * Fix rendered cursor_y caching in case of rendering the screen without scroll_into_view https://github.com/ruby/reline/commit/c5d5c444df
2025-01-03[ruby/reline] Refactor handling key in LineEditortomoya ishida
(https://github.com/ruby/reline/pull/799) Simplify the complicated flow of waiting_proc, wrap_method_call and run_for_operation https://github.com/ruby/reline/commit/72c0ec0425
2025-01-03[ruby/rdoc] Fix prism_ruby superclass resolve ordertomoya ishida
(https://github.com/ruby/rdoc/pull/1267) RDoc::Parser::PrismRuby wrongly resolves superclass of `class Cipher < Cipher; end` that exist in openssl. Superclass resolve should be done before adding class. https://github.com/ruby/rdoc/commit/57a4615a92
2025-01-02[DOC] .document under lib/rdoc is split nowNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12495
2025-01-02[ruby/rdoc] [DOC] Ignore racc-generated filesNobuyoshi Nakada
(https://github.com/ruby/rdoc/pull/1265) * [DOC] Ignore racc-generated files Not only `.ry` sources, generated `.rb` files seem duplicate and unnecessary. * [DOC] Select files by .document files for syncing https://github.com/ruby/rdoc/commit/fb7041ec98