summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2024-09-17[rubygems/rubygems] Inline a private methodDavid Rodríguez
Removes an (in my opinion) excessive indirection and handles options more consistently. https://github.com/rubygems/rubygems/commit/642e6d2c0c
2024-09-17[rubygems/rubygems] Consistently access install options through symbol keysDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7ddf1dc70a
2024-09-16[ruby/prism] Do not leak explicit encodingKevin Newton
Fixes [Bug #20744] https://github.com/ruby/prism/commit/f1b8b1b2a2
2024-09-16[ruby/irb] Use InstructionSequence#script_lines to get method sourcetomoya ishida
(https://github.com/ruby/irb/pull/1005) It works with both prism and parse.y https://github.com/ruby/irb/commit/bcfaa72d5a
2024-09-16[rubygems/rubygems] Simplify handling default gem cachingDavid Rodríguez
By the time `cached_gem` is called, default gem cache has already been handled. So no need to try redownload it again, it's enough to check the cache location directly. https://github.com/rubygems/rubygems/commit/70e10236b6
2024-09-16[rubygems/rubygems] Remove temporary `.lock` files left around by gem installerDavid Rodríguez
https://github.com/rubygems/rubygems/commit/edbb2e3475
2024-09-16[rubygems/rubygems] Make sure implementations of `Gem.open_file_with_flock` ↵David Rodríguez
match https://github.com/rubygems/rubygems/commit/174a8e5284
2024-09-13[ruby/prism] Expose main_script in serialization APIKevin Newton
https://github.com/ruby/prism/commit/0b527ca93f
2024-09-13Dont't warn reline called from irb, reline is already declared at irb gemspecHiroshi SHIBATA
2024-09-12[ruby/prism] Check errno for parsing directoryKevin Newton
https://github.com/ruby/prism/commit/d68ea29d04 Notes: Merged: https://github.com/ruby/ruby/pull/11497
2024-09-12[ruby/irb] Remove KEYWORD_ALIASES which handled special alias nametomoya ishida
of irb_break irb_catch and irb_next command (https://github.com/ruby/irb/pull/1004) * Remove KEYWORD_ALIASES which handled special alias name of irb_break irb_catch and irb_next command * Remove unused instance variable user_aliases Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/irb/commit/f256d7899f Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-09-11[rubygems/rubygems] Small simplification in Definition classDavid Rodríguez
https://github.com/rubygems/rubygems/commit/03ddfd7610 Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2024-09-11[rubygems/rubygems] Fix `bundle exec rake install` failing when local gem ↵David Rodríguez
has extensions and `gemspec` DSL is being used In a `bundle exec` context, the local specification will actually be part of the known specifications, so RubyGems will assume it has already been installed, which is not actually true. This will cause `RequestSet` to rebuild extensions for a gem that's not actually installed, causing errors. The fix is to make sure detection of installed activation requests considers not only that there's a known spec with the same full name as the one being installed, but also that this spec is installed in the same gem_home were pretend to install the new gem. https://github.com/rubygems/rubygems/commit/a8ef1286a6
2024-09-11[rubygems/rubygems] Only raise DSLError during Gemfile parsing when it's ↵David Rodríguez
actually useful DSLError prints the specific line in a Gemfile where the error was raised. That's helpful when the error was explicitly raised by the Gemfile DSL or, in the case it's implicitly raised, when the offending code lives right in the Gemfile. If it's an internal error, or something buried dowm in user code called from the Gemfile, `DSLError` is not helpful since it hides the actual culprit. This commit tries to only raise `DSLError` in the cases mentioned above and otherwise let the original error be raised. https://github.com/rubygems/rubygems/commit/b30ff5a682
2024-09-11[rubygems/rubygems] Don't rescue Exception when evaluating GemfileDavid Rodríguez
Things like OOM, or StackOverflow should be raised immediately. https://github.com/rubygems/rubygems/commit/11691ce492
2024-09-11[rubygems/rubygems] Refactor setting current gemfile in DSLDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b4ecb66224
2024-09-11[rubygems/rubygems] The `dsl_path` parameter in DSLError is documented as a ↵David Rodríguez
string https://github.com/rubygems/rubygems/commit/ab44fa9ee4
2024-09-11[rubygems/rubygems] Make an exe file executable when generating new gemsYuji Yaginuma
Currently, an exe file isn't executable when generating new gems because it doesn't have the correct permission. This PR sets the correct permission same as files under the `bin`. https://github.com/rubygems/rubygems/commit/6509bf128a
2024-09-10[ruby/tmpdir] Reject empty parent pathNobuyoshi Nakada
https://github.com/ruby/tmpdir/commit/628c5bdc59
2024-09-10[ruby/resolv] Add spec extensionsNobuyoshi Nakada
https://github.com/ruby/resolv/commit/3189d16b69
2024-09-10[rubygems/rubygems] Removed duplicated dependencies that used by bundler inlineHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/d46b6a49af
2024-09-10[rubygems/rubygems] Retry resolution with activated gems if inline has conflictsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8d94c14ca0 Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2024-09-10[rubygems/rubygems] Remove unnecessary verificationDavid Rodríguez
`DSL#to_definition` already verifies this. https://github.com/rubygems/rubygems/commit/c596f0af83
2024-09-10[rubygems/rubygems] Avoid having to redefine `Definition#lock` in inline modeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0b7be7bb77 Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2024-09-09[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`Koichi ITO
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for double splat argument. ## Parser gem (Expected) Returns `tDSTAR` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:kDEF, ["def", #<Parser::Source::Range example.rb 0...3>]], [:tIDENTIFIER, ["f", #<Parser::Source::Range example.rb 4...5>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 5...6>]], [:tDSTAR, ["**", #<Parser::Source::Range example.rb 6...8>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 8...11>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 11...12>]], [:kEND, ["end", #<Parser::Source::Range example.rb 13...16>]]] ``` ## `Prism::Translation::Parser` (Actual) Previously, the parser returned `tPOW` token when parsing the following: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:kDEF, ["def", #<Parser::Source::Range example.rb 0...3>]], [:tIDENTIFIER, ["f", #<Parser::Source::Range example.rb 4...5>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 5...6>]], [:tPOW, ["**", #<Parser::Source::Range example.rb 6...8>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 8...11>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 11...12>]], [:kEND, ["end", #<Parser::Source::Range example.rb 13...16>]]] ``` After the update, the parser now returns `tDSTAR` token for the same input: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:kDEF, ["def", #<Parser::Source::Range example.rb 0...3>]], [:tIDENTIFIER, ["f", #<Parser::Source::Range example.rb 4...5>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 5...6>]], [:tDSTAR, ["**", #<Parser::Source::Range example.rb 6...8>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 8...11>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 11...12>]], [:kEND, ["end", #<Parser::Source::Range example.rb 13...16>]]] ``` With this change, the following code could be removed from test/prism/ruby/parser_test.rb: ```diff - when :tPOW - actual_token[0] = expected_token[0] if expected_token[0] == :tDSTAR ``` `tPOW` is the token type for the behavior of `a ** b`, and its behavior remains unchanged: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "a ** b"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["a", #<Parser::Source::Range example.rb 0...1>]], [:tPOW, ["**", #<Parser::Source::Range example.rb 2...4>]], [:tIDENTIFIER, ["b", #<Parser::Source::Range example.rb 5...6>]]] ``` https://github.com/ruby/prism/commit/66bde35a44
2024-09-09[rubygems/rubygems] Don't include hook templates in cached git sourceDaniel Colson
With a default git setup, each cloned repo in the cache will end up with ~60K of sample git hooks. These files all end in `.sample`, and they are disabled by default. Deleting them should be a no-op, and makes the cache a bit smaller. https://github.com/rubygems/rubygems/commit/d2149999cd
2024-09-09[rubygems/rubygems] Avoid now unnecessary resetDavid Rodríguez
https://github.com/rubygems/rubygems/commit/511c7b211b
2024-09-09[rubygems/rubygems] Make `gem exec` use the standard GEM_HOMEDavid Rodríguez
https://github.com/rubygems/rubygems/commit/032b3c518a
2024-09-09[rubygems/rubygems] Fix `gem fetch` always exiting with zero status codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5887e6dfa1
2024-09-08[ruby/benchmark] Set required_ruby_version = ">= 2.1.0"Earlopain
`Process.clock_gettime` only works since 2.1 https://github.com/ruby/benchmark/commit/94cfe56291
2024-09-08[ruby/open-uri] Update error message for `request_specific_fields` option ↵otegami
validation Added `inspect` to the `request_specific_fields` value to provide better visibility for users in the exception message. https://github.com/ruby/open-uri/commit/f89ce5112d
2024-09-08[ruby/open-uri] Add documentation for `request_specific_fields` optionotegami
https://github.com/ruby/open-uri/commit/2e7734c061
2024-09-08[ruby/open-uri] Add `request_specific_fields` option for customizing headersotegami
This commit introduces the `request_specific_fields` option in OpenURI. It provides two methods for customizing headers as follows. 1. Specify headers only for the initial request Use a Hash to apply headers only to the first request. These headers are automatically removed during redirects. 2. Specify headers dynamically for each request Use a Proc to dynamically generate headers for each request, including during redirects, based on the request URL. This feature allows users to control headers flexibly, ensuring that sensitive headers like "Authorization" are not unintentionally transferred during redirects unless explicitly specified. https://github.com/ruby/open-uri/commit/460f858e3c
2024-09-08[ruby/rdoc] Use pointer cursor for navigation toggleMads Ohm Larsen
(https://github.com/ruby/rdoc/pull/1175) https://github.com/ruby/rdoc/commit/964a1982c8
2024-09-07[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`Koichi ITO
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for left parenthesis. ## Parser gem (Expected) Returns `tLPAREN2` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 \ -ve 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` ## `Prism::Translation::Parser` (Actual) Previously, the parser returned `tLPAREN` token when parsing the following: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` After the update, the parser now returns `tLPAREN2` token for the same input: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem. The tokens that were previously all classified as `tLPAREN` are now also classified to `tLPAREN2`. With this change, the following code could be removed from `test/prism/ruby/parser_test.rb`: ```diff - when :tLPAREN - actual_token[0] = expected_token[0] if expected_token[0] == :tLPAREN2 ``` https://github.com/ruby/prism/commit/04d6f3478d
2024-09-06[ruby/rdoc] Add more space after magnifying glassMads Ohm Larsen
(https://github.com/ruby/rdoc/pull/1173) https://github.com/ruby/rdoc/commit/6a9cad4c54
2024-09-06[rubygems/rubygems] Remove unnecessary "./" when appending string to uriDavid Rodríguez
https://github.com/rubygems/rubygems/commit/732679306d
2024-09-06[rubygems/rubygems] Fix `gem install does-not-exist` being super slowDavid Rodríguez
Every time a gem is not found in the Compact Index API, RubyGems will fallback to the full index, which is very slow. This is unnecessary because both indexes should be providing the same gems, so if a gem can't be found in the Compact Index API, it won't be found in the full index. We _do_ want a fallback to the full index, whenever the Compact Index API is not implemented. To detect that, we check that the API responds to the "/versions" endpoint, just like Bundler does. Before: ``` $ time gem install fooasdsfafs ERROR: Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository gem 20,77s user 0,59s system 96% cpu 22,017 total ``` After: ``` $ time gem install fooasdsfafs ERROR: Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository gem 5,02s user 0,09s system 91% cpu 5,568 total ``` https://github.com/rubygems/rubygems/commit/c0d6b9eea7
2024-09-06[rubygems/rubygems] Deprecate constant that has been unused for a long timeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/282dbb3d62
2024-09-06[rubygems/rubygems] Remove incorrect documentationDavid Rodríguez
This exception has not been raised for a long time. https://github.com/rubygems/rubygems/commit/a6271a0b21
2024-09-06[rubygems/rubygems] Remove unreachable codeDavid Rodríguez
Nothing is actually raising this at the moment. https://github.com/rubygems/rubygems/commit/3b824ca7a6
2024-09-06[rubygems/rubygems] Ensure that the lock file will be removedNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/2706acb271
2024-09-06[rubygems/rubygems] Workaround for TruffleRubyNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/b82e43fd54
2024-09-06[rubygems/rubygems] Remove the lock file for binstubsNobuyoshi Nakada
https://github.com/rubygems/rubygems/pull/7806#issuecomment-2241662488 https://github.com/rubygems/rubygems/commit/4f06ee234a
2024-09-06Merge GH-11492Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11560
2024-09-06Warn irb, reline for Ruby 3.5Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11560
2024-09-06[ruby/time] Bump up v0.4.0Hiroshi SHIBATA
https://github.com/ruby/time/commit/a14fa00ef7
2024-09-05[ruby/time] Do not redefine Time#xmlschema if it already existsJean Boussier
[Feature #20707] Ruby 3.4 will define this method natively, so the time gem shouldn't redefine it with a slower version. https://github.com/ruby/time/commit/f05099ce38
2024-09-05`rake install` command is failed (#1170)mterada1228
* `rake install` command is failed \### Problems Several file paths were changed by following PR. - https://github.com/ruby/rdoc/commit/4211292ffe80dd4737db2450d72df404a9d55051 - https://github.com/ruby/rdoc/commit/d7bca12c13b8b3f1632d698d497e67d4ea8a88bc Because rdoc.gemspec doesn't take in this changes, the `rake install` command is permanently failed. \### Test \#### before ```console ❯ bundle exec rake install Running RuboCop... Inspecting 4 files .... 4 files inspected, no offenses detected Tip: Based on detected gems, the following RuboCop extension libraries might be helpful: * rubocop-rake (https://rubygems.org/gems/rubocop-rake) You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options): AllCops: SuggestExtensions: false rake aborted! Running `gem build -V /Users/mterada/dev/redDataTools/remove_dependency/rdoc/rdoc.gemspec` failed with the following output: WARNING: See https://guides.rubygems.org/specification-reference/ for help ERROR: While executing gem ... (Gem::InvalidSpecificationException) ["RI.rdoc", "lib/rdoc/alias.rb", "lib/rdoc/anon_class.rb", "lib/rdoc/any_method.rb", "lib/rdoc/attr.rb", "lib/rdoc/class_module.rb", "lib/rdoc/constant.rb", "lib/rdoc/context.rb", "lib/rdoc/context/section.rb", "lib/rdoc/extend.rb", "lib/rdoc/ghost_method.rb", "lib/rdoc/include.rb", "lib/rdoc/meta_method.rb", "lib/rdoc/method_attr.rb", "lib/rdoc/mixin.rb", "lib/rdoc/normal_class.rb", "lib/rdoc/normal_module.rb", "lib/rdoc/require.rb", "lib/rdoc/single_class.rb", "lib/rdoc/top_level.rb"] are not files /Users/mterada/.rbenv/versions/3.1.0/bin/bundle:25:in `load' /Users/mterada/.rbenv/versions/3.1.0/bin/bundle:25:in `<main>' Tasks: TOP => install => build (See full trace by running task with --trace) ``` \#### after ```console ❯ bundle exec rake install Running RuboCop... Inspecting 4 files .... 4 files inspected, no offenses detected Tip: Based on detected gems, the following RuboCop extension libraries might be helpful: * rubocop-rake (https://rubygems.org/gems/rubocop-rake) You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options): AllCops: SuggestExtensions: false rdoc 6.7.0 built to pkg/rdoc-6.7.0.gem. rdoc (6.7.0) installed. ``` * Add a `bundle exec rake install` step to github workflow * make intentionally CI failed * Revert "make intentionally CI failed" This reverts commit 9fc5dd9423a024594ad26d86a8a6af829e7017f8.
2024-09-05[ruby/reline] Bump version to 0.5.10Mari Imaizumi
(https://github.com/ruby/reline/pull/745) https://github.com/ruby/reline/commit/0ebd54f675