summaryrefslogtreecommitdiff
path: root/lib/rubygems/gem_runner.rb
AgeCommit message (Collapse)Author
2024-11-04Validate user input encodingDavid Rodríguez
If the user has the encoding of her system messed up, she may end up sending us incorrectly encoding input, causing "invalid byte sequence in UTF-8" errors at random places. These errors can be forced on a system without encoding issues with something like: ``` $ gem install$(echo -e "\xFF") foo /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/config_file.rb:534:in `block in set_config_file_name': invalid byte sequence in UTF-8 (ArgumentError) from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/config_file.rb:530:in `each' from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/config_file.rb:530:in `set_config_file_name' from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/config_file.rb:177:in `initialize' from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/gem_runner.rb:71:in `new' from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/gem_runner.rb:71:in `do_configuration' from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/gem_runner.rb:33:in `run' from /Users/deivid/.asdf/installs/ruby/3.2.1/bin/gem:10:in `<main>' ``` This commit makes RubyGems print a better error in this case: ``` $ ruby -Ilib bin/gem install$(echo -e "\xFF") foo /Users/deivid/Code/rubygems/rubygems/lib/rubygems/gem_runner.rb:75:in `validate_encoding': invalid argument: 'install�' has invalid encoding (Gem::OptionParser::InvalidArgument) from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/gem_runner.rb:31:in `run' from bin/gem:10:in `<main>' ```
2023-03-23util/rubocop -A --only Layout/EmptyLineAfterMagicCommentHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/RescueStandardErrorHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/80b57da926
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/RescueModifierHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/b490379eab
2023-03-16[rubygems/rubygems] Change enforce style with Layout/CaseIndentation on rubygemsHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/d4938259c4
2022-07-22RubyGems: Enable Style/StringLiterals copTakuya Noguchi
Signed-off-by: Takuya Noguchi <[email protected]>
2022-07-13Merge RubyGems and Bundler masterHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6124
2022-01-19[rubygems/rubygems] Normalize end alignment style with BundlerDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f7f504b24c
2021-08-31[rubygems/rubygems] Prefer `require_relative` to `require` for internal requiresDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c74fc58695 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2020-09-23Revert "Manually merged from https://github.com/rubygems/rubygems/pull/2636"Hiroshi SHIBATA
31a6eaabc165d8a222e176f2c809d90622d88ec2 is obsoleted with https://github.com/rubygems/rubygems/pull/3820
2020-09-23Manually merged from https://github.com/rubygems/rubygems/pull/2636Hiroshi SHIBATA
Enable Style/EmptyLinesAroundClassBody rubocop cop.
2020-07-31[rubygems/rubygems] remove explicit require(s) for auto-loaded constant(s)Karol Bucek
the Gem module's auto-loads will handle loading these as needed, this started as a redundancy found in *rubygems.rb* which had: `autoload :Specification, 'rubygems/specification'` as well as `require 'rubygems/specification'` https://github.com/rubygems/rubygems/commit/43ceae7ac0 Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31Enforce no empty lines around class body in rubygemsDavid Rodríguez
To normalize the code style with `bundler`. Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-02-01Merge the current master branch of rubygems/rubygems.Hiroshi SHIBATA
Just started to develop RubyGems 3.2.0.
2018-11-21Merge master branch from rubygems/rubygems upstream.hsbt
* Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Merge rubygems master.hsbt
This is RC version of Rubygems 2.7.0. https://github.com/rubygems/rubygems/commit/688fb7e83c13c3fe7c2bb03c49a2db4c82852aee git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-01* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.hsbt
It supports to enable frozen string literal and add `--norc` option for disable to `.gemrc` configuration. See 2.5.2 release notes for other fixes and enhancements. https://github.com/rubygems/rubygems/blob/a8aa3bac723f045c52471c7b9328310a048561e0/History.txt#L3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-14Revert r42938 "* lib/rubygems: Update to RubyGems 2.1.3"naruse
It breaks build. http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20130913T200302Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-13* lib/rubygems: Update to RubyGems 2.1.3drbrain
Fixed installing platform gems Restored concurrent requires Fixed installing gems with extensions with --install-dir Fixed `gem fetch -v` to install the latest version Fixed installing gems with "./" in their files entries * test/rubygems/test_gem_package.rb: Tests for the above. * NEWS: Updated for RubyGems 2.1.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-09* lib/rubygems: Import RubyGems 2.1drbrain
* test/rubygems: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* lib/rubygems*: Updated to RubyGems 2.0drbrain
* test/rubygems*: ditto. * common.mk (prelude): Updated for RubyGems 2.0 source rearrangement. * tool/change_maker.rb: Allow invalid UTF-8 characters in source files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 * lib/rubygems: Update to RubyGems 1.8.6.1.drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-01Import rubygems 1.8.5 (released @ 137c80f)ryan
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-19Import rubygems 1.5.0 (release candidate)ryan
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-09Update to RubyGems 1.3.4 r2223drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-10Import RubyGems trunk revision 1493.drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e