summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2024-08-23[rubygems/rubygems] Fix error message when Bundler refuses to install due to ↵David Rodríguez
frozen being set without a lockfile https://github.com/rubygems/rubygems/commit/0857d62ca6
2024-08-23[ruby/tempfile] File.new(fileno, mode: mode, path: path) is provided from ↵Hiroshi SHIBATA
Ruby 3.2 https://github.com/ruby/tempfile/commit/67ce897727
2024-08-22[rubygems/rubygems] Fix `--prefer-local` flagDavid Rodríguez
The original implementation of this flag was too naive and all it did was restricting gems to locally installed versions if there are any local versions installed. However, it should be much smarter. For example: * It should fallback to remote versions if locally installed version don't satisfy the requirements. * It should pick locally installed versions even for subdependencies not yet discovered. This commit fixes both issues by using a smarter approach similar to how we resolve prereleases: * First resolve optimistically using only locally installed gems. * If any conflicts are found, scan those conflicts, allow remote versions for the specific gems that run into conflicts, and re-resolve. https://github.com/rubygems/rubygems/commit/607a3bf479 Co-authored-by: Gourav Khunger <gouravkhunger18@gmail.com>
2024-08-22[rubygems/rubygems] Fix bad grammar in log messageDavid Rodríguez
https://github.com/rubygems/rubygems/commit/bea4c1ad79
2024-08-21[rubygems/rubygems] Restore support for passing relative paths to `:git`David Rodríguez
The `file://` protocol does not really work with relative paths and it's not necessary anyways. So restore support for that by not using `file://`. https://github.com/rubygems/rubygems/commit/16a68998ce
2024-08-21[rubygems/rubygems] Fix `gem uninstall <name>:<version>` failing on shadowed ↵David Rodríguez
default gems https://github.com/rubygems/rubygems/commit/29357a5dd6
2024-08-21[rubygems/rubygems] Regeneration previous git application caches that didn't ↵David Rodríguez
include bare repos https://github.com/rubygems/rubygems/commit/417319ecb1
2024-08-21Don't show script name when bundle exec and call ruby script directly.Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11418
2024-08-21Skip to show script name with using ruby -r optionHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11418
2024-08-21Show correct script name with sub-feature caseHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11418
2024-08-21Reapply "[ruby/uri] Warn compatibility methods in RFC3986_PARSER"Hiroshi SHIBATA
This reverts commit 3da7e440e9fca835f5475a98f1c0afb4d2ac71db. Notes: Merged: https://github.com/ruby/ruby/pull/11416
2024-08-21Generate parsers of RDoc with Racc 1.8.1Hiroshi SHIBATA
2024-08-21[ruby/logger] Guarantee level_override existsMichael Chui
Some Ruby apps subclass Logger without running the superclass constructor, which means that `@level_override` isn't initialized properly. This can be fixed in some cases, but the gem should maintain backwards compatibility. https://github.com/ruby/logger/commit/3246f38328
2024-08-20[ruby/tempfile] Don't unlink in finalizer when already unlinkedPeter Zhu
https://github.com/ruby/tempfile/commit/f677941ea2
2024-08-20[ruby/tempfile] Add FinalizerManager to manage finalizersPeter Zhu
As @jeremyevans pointed out for commit eb2d8b1: > Each Tempfile instance has a separate File instance and file descriptor: > > t = Tempfile.new > t.to_i # => 6 > t.dup.to_i => 7 FinalizerManager will keep track of the open File objects for the particular file and will only unlink the file when all of the File objects have been closed. https://github.com/ruby/tempfile/commit/753ab16642
2024-08-20[ruby/tempfile] Ensure finalizer order in TempfilePeter Zhu
The Closer and Remover finalizers are defined on different objects in Tempfile. The Closer is defined on the Tempfile object while the Remover is defined on the finalizer_obj. This means that there is no guarantee of the finalizer order. On Windows, we must close the file before removing it because we cannot remove an open file. But since the order is not guaranteed, the GC may run the Remover finalizer first, which will fail with an Errno::EACCES (Permission denied @ apply2files). This commit changes it so that both the Closer and Remover finalizers are defined on the finalizer_obj, which guarantees the order that it is ran. https://github.com/ruby/tempfile/commit/eb2d8b1175
2024-08-20[ruby/reline] typofixHiroshi SHIBATA
https://github.com/ruby/reline/commit/d44fbf9f7b
2024-08-19[ruby/rdoc] Avoid potentially loading the same extension from different ↵David Rodríguez
versions of the same gem Avoids warnings like ``` /path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.4.0/lib/rdoc/discover.rb:10: warning: method redefined; discarding old scan /path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.5.1/lib/rdoc/discover.rb:10: warning: previous definition of scan was here ``` https://github.com/ruby/rdoc/commit/e47920d8f3
2024-08-19[rubygems/rubygems] Change new gem README template to have copyable code blocksMarco Roth
https://github.com/rubygems/rubygems/commit/c805e9b558
2024-08-15[ruby/rdoc] Fix sidebar scroll again and add missing footer backStan Lo
(https://github.com/ruby/rdoc/pull/1154) * Add missing footers In #1152 the footer partial was only added to the index.rhtml file. This commit adds the footer partial to the other template files. * Remove unnecessary middle divs in nav * Simplify sidebar's overflow settings Because sidebar needs to be scrollable, its overflow should default to auto. Currently it's set to hidden and force individual elements to set overflow auto, which overcomplicates things. https://github.com/ruby/rdoc/commit/b8c2bcd8db
2024-08-15Delete unnecessary rubocop disable commentKentaro Takeyama
Notes: Merged: https://github.com/ruby/ruby/pull/11357
2024-08-14[ruby/irb] Fix kill pager pid throwing Errno::ESRCH when pagertomoya ishida
process already terminated (https://github.com/ruby/irb/pull/989) https://github.com/ruby/irb/commit/949f032e9b
2024-08-14[ruby/prism] Tweak inspect representation of `Prism::Location`Koichi ITO
This PR tweaks inspect representation of `Prism::Location`. ## Before During debugging, the meaning of `@location=https://github.com/ruby/prism/commit/21474836481` was unclear: ```console $ ruby -Ilib -rprism -e 'p Prism.lex("puts :hi").value.map(&:first)[1]' #<Prism::Token:0x000000010cd74e40 @source=#<Prism::ASCIISource:0x000000010cb5f808 @source="puts :hi", @start_line=1, @offsets=[0]>, @type=:SYMBOL_BEGIN, @value=":", @location=https://github.com/ruby/prism/commit/21474836481> ``` ## After This PR clarifies the contents of the location object, aligning with what I think user expects: ```console $ ruby -Ilib -rprism -e 'p Prism.lex("puts :hi").value.map(&:first)[1]' #<Prism::Token:0x000000010e174d50 @source=#<Prism::ASCIISource:0x000000010df5efe8 @source="puts :hi", @start_line=1, @offsets=[0]>, @type=:SYMBOL_BEGIN, @value=":", @location=#<Prism::Location @start_offset=5 @length=1 start_line=1>> ``` Although it is uncertain whether Prism will accept this change in the inspect representation, it is submitted here as a suggestion. https://github.com/ruby/prism/commit/e7421ce1c5
2024-08-14[ruby/irb] Improve easter_egg logo resolutiontomoya ishida
(https://github.com/ruby/irb/pull/987) https://github.com/ruby/irb/commit/ab394db93f
2024-08-13[ruby/resolv] Reuse open TCP connectionKasumi Hanazuki
[RFC7766] Section 5 recommends stub resolvers to reuse open TCP connections to a nameserver. [RFC7766]: https://datatracker.ietf.org/doc/html/rfc7766 https://github.com/ruby/resolv/commit/9bf1b08f5c
2024-08-13[ruby/resolv] Fix TCP fallback with multiple nameserversIgor Pstyga
Under the following conditions the exception `Resolv::DNS::Requester::RequestError: host/port don't match` is raised: - Multiple nameservers are configured for Resolv::DNS - A nameserver falls back from UDP to TCP - TCP request hits Resolv::DNS timeout - Resolv::DNS retries the next nameserver More details here https://bugs.ruby-lang.org/issues/8285 https://github.com/ruby/resolv/commit/7d524df80e Co-authored-by: Julian Mehnle <julian@mehnle.net>
2024-08-13Delete newarraykwsplatAlan Wu
The pushtoarraykwsplat instruction was designed to replace newarraykwsplat, and we now meet the condition for deletion mentioned in 77c1233f79a0f96a081b70da533fbbde4f3037fa. Notes: Merged: https://github.com/ruby/ruby/pull/11371 Merged-By: XrXr
2024-08-13Sync rdocStan Lo
2024-08-08Sync rdoc to fix master doc's display issue (#11345)Stan Lo
Sync rdoc This syncs changes made in https://github.com/ruby/rdoc/pull/1148, which will fix https://docs.ruby-lang.org/en/master/'s display on certain screens. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2024-08-08We should use uplevel:2 in another case.Hiroshi SHIBATA
Like the following scenario with bootsnap, that frames are same or smaller than frame_to_skip(=3). --- "/Users/hsbt/.local/share/rbenv/versions/3.3-dev/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'" "/Users/hsbt/.local/share/gem/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'" "test_warn_bootsnap.rb:11:in `<main>'" ---
2024-08-08lib/bundled_gems.rb: more reliable caller detectionJean Boussier
The `2` skipped frames went out of sync and now it should be `3`. Rather than just update the offset, we can implement a way that is adaptative as long as all require decorators are also called require. Also we should compute the corresponding `uplevel` otherwise the warning will still point decorators. Co-authored-by: "Hiroshi SHIBATA" <hsbt@ruby-lang.org>
2024-08-08Partly reverted 09638741ba4d9547a0e48af8c767744fb1d7f68dHiroshi SHIBATA
This change didn't work with Ruby 3.3. We should revert this to test bundled_gems.rb with Ruby 3.3.
2024-08-08Revert "[ruby/uri] Warn compatibility methods in RFC3986_PARSER"Hiroshi SHIBATA
This reverts commit c3becc3ba6c584fbeabd5182e304e61529235fe6. Notes: Merged: https://github.com/ruby/ruby/pull/11333
2024-08-08[ruby/uri] Use URI::RFC2396_PARSER explicitly in URIHiroshi SHIBATA
https://github.com/ruby/uri/commit/898b889811
2024-08-08[ruby/uri] Warn compatibility methods in RFC3986_PARSERHiroshi SHIBATA
https://github.com/ruby/uri/commit/9997c1acee
2024-08-08[ruby/rdoc] Use ascii chatacter in HTML filetompng
https://github.com/ruby/rdoc/commit/40a6690010
2024-08-06[ruby/uri] Fallback missing constants with RFC3986_PARSERHiroshi SHIBATA
(https://github.com/ruby/uri/pull/113) * Fallback missing constants with RFC3986_PARSER * raise missing constant * Update test/uri/test_common.rb Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> * Update lib/uri/common.rb Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> * Update lib/uri/common.rb Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> --------- https://github.com/ruby/uri/commit/c2fdec079a Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-08-05[rubygems/rubygems] Don't remove existing platform gems when PLATFORMS ↵David Rodríguez
section is badly indented https://github.com/rubygems/rubygems/commit/ec099ebf1e
2024-08-05[rubygems/rubygems] Fix locked source not getting respected when `bundle ↵David Rodríguez
update <specific_gem>` is run https://github.com/rubygems/rubygems/commit/eec6830c04
2024-08-05[rubygems/rubygems] Move private reader to private sectionDavid Rodríguez
https://github.com/rubygems/rubygems/commit/651cf3ea7a
2024-08-05[ruby/uri] Add space after `bad URI`Josh Soref
https://github.com/ruby/uri/commit/9f2c7ed5f2
2024-08-05[ruby/uri] Use DEFAULT_PARSER at split, parse, joinHiroshi SHIBATA
https://github.com/ruby/uri/commit/28af4e155a
2024-08-05Make sure to always use the right `warn`David Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/11296
2024-08-05Fix truffleruby removing gems from lockfileDavid Rodríguez
When resolving on truffleruby, and multiple platforms are included in the lockfile, Bundler will not respect existing platforms, but always force ruby variants. That means removal of existing version specific variants, introducing lockfile churn between implementations. To prevent this, we introduce the distinction between `Dependency#force_ruby_platform`, only settable via Gemfile, and `Dependency#default_force_ruby_platform`, which is always true on truffleruby for certain dependency names. This way, when resolving lockfile gems for other platforms on truffleruby, we keep platform specific variants in the lockfile. However, that introduces the problem that if only platform specific variants are locked in the lockfile, Bundler won't be able to materialize on truffleruby because the generic variant will be missing. To fix this additional problem, we make sure the generic "ruby" platform is always added when resolving on truffleruby.
2024-08-05[ruby/optparse] Fix parsing array arguments with `:into` optionfatkodima
https://github.com/ruby/optparse/commit/19700e96d8
2024-08-05Sync rdocStan Lo
Notes: Merged: https://github.com/ruby/ruby/pull/11308
2024-07-31[ruby/rdoc] Add new ruby parser that uses Prismtomoya ishida
(https://github.com/ruby/rdoc/pull/1144) * Add a new ruby parser RDoc::Parser::PrismRuby * Add a new ruby parser testcase independent from parser's internal implementation * unknown meta method * Use MethodSignatureVisitor only to scan params, block_params and calls_super * Add calls_super test * Drop ruby 2.6. Prism requires ruby >= 2.7 * Remove duplicated documentation comment from prism_ruby.rb * Add test for wrong argument passed to metaprogramming method * Rename visit_call_[DSL_METHOD_NAME] to make it distinguishable from visit_[NODE_TYPE]_node * Method receiver switch of true/false/nil to a case statement * Extract common part of add_method(by def keyword) and add meta_comment method * Reuse consecutive comments array when collecting comments * Simplify DSL call_node handling * Refactor extracting method visibility arguments https://github.com/ruby/rdoc/commit/fde99f1be6
2024-07-31[ruby/rdoc] Drop unnecessary `file_name` parameter from `Parser.for`Stan Lo
method. (https://github.com/ruby/rdoc/pull/1135) * Unify top_level creation in tests * Remove unnecessary file_name param from Parser.for It should be always the same as the top_level's absolute_name, so there's no point of taking it as a separate parameter. https://github.com/ruby/rdoc/commit/97c497dfbb
2024-07-30[rubygems/rubygems] Print a better debug message when lockfile does not ↵David Rodríguez
include the current platform https://github.com/rubygems/rubygems/commit/afb7a6d754
2024-07-30[rubygems/rubygems] Simplify logic to add current platform a bitDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e102516e27