summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-06-15Remove random codeDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Use space inside block braces everywhereDavid Rodríguez
To make rubygems code style consistent with bundler. Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Fix ruby-head failing testsDavid Rodríguez
In `ruby-head` (where system rubygems already has the `XDG` standard implementation), some tests currently depend on the presence of a `~/.gem` folder in the home of the user that runs the tests. If that file is present, tests pass, otherwise they don't. For example, the following passes if you have a `~/.gem` folder but fails otherwise with: ``` $ rake TESTOPTS="--name=/TestGemCommandsGenerateIndexCommand#test_execute$\|TestGemCommandsUpdateCommand#test_execute_user_install/ -v" Run options: "--name=/TestGemCommandsGenerateIndexCommand#test_execute$|TestGemCommandsUpdateCommand#test_execute_user_install/" -v --seed 17318 # Running: TestGemCommandsGenerateIndexCommand#test_execute = 0.02 s = . TestGemCommandsUpdateCommand#test_execute_user_install = /rubygems/test/rubygems/test_gem_commands_update_command.rb:412: warning: instance variable @user_install not initialized 0.04 s = F Finished in 0.095337s, 20.9783 runs/s, 20.9783 assertions/s. 1) Failure: TestGemCommandsUpdateCommand#test_execute_user_install [/rubygems/test/rubygems/test_gem_commands_update_command.rb:414]: user_install must be set on the installer 2 runs, 2 assertions, 1 failures, 0 errors, 0 skips rake aborted! Command failed with status (1) Tasks: TOP => default => test (See full trace by running task with --trace) ``` This is because the very initial `require` of the default `did_you_mean` gem that ruby does on startup runs _before_ the global `setup` hook of our tests run. During this require `Gem.data_home` and its value is memoized to a path in the real users home (not the fake user's home that our tests setup, since that code hasn't run yet). Then that memoized value is used when looking for the default folders to look for gems, and since there's no `~/.gem` folder, its value is actually used as part of the `Gem.user_dir` folder in `Gem::Specification.dirs` (this is how we've approached backwards compatibility for the `XDG` feature). That means dummy test gems with the `--user-install` flag are installed to global, real locations and everything is messed up. This commit fixes the issue by resetting the `Gem.data_home` value in case it has already been memoized. Notes: Merged: https://github.com/ruby/ruby/pull/3211
2020-06-15Revert "Revert "[rubygems/rubygems] Remove unneeded global teardown""David Rodríguez
This reverts commit ac2c07e98373bb62be618001c897fa9d5809d8a4. Notes: Merged: https://github.com/ruby/ruby/pull/3211
2020-06-15Use filesystem encoding in do_GET of filehandlerKazuhiro NISHIYAMA
Try to fix 404 error on mswinci. https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-master/log/20200614T225859Z.fail.html.gz ``` 1) Failure: WEBrick::TestFileHandler#test_cjk_in_path [D:/tmp/mswin-build20200615-24932-11ykstf/ruby/test/webrick/utils.rb:72]: exceptions on 2 threads: webrick log start: [2020-06-15 09:48:29] ERROR `/あ.txt' not found. webrick log end. <"200"> expected but was <"404">. --- <[]> expected but was <["[2020-06-15 09:48:29] ERROR `/\xE3\x81\x82.txt' not found.\n"]>. ``` Notes: Merged: https://github.com/ruby/ruby/pull/3227
2020-06-12Revert "[ruby/fileutils] Make verbose output go to stdout instead of stderr"Nobuyoshi Nakada
This reverts commit 7cddb844e6d51f954c6669341b9cc656bd7d3492, because the test of rake 13.0.1 is depending on the previous behavior.
2020-06-12[ruby/fileutils] Fix #install with "X" mode optionNobuyoshi Nakada
`FileUtils#install` methed raises an unexpected `TypeError`, when called with `mode:` option which has `"X"`. ``` $ ruby -rfileutils -e 'FileUtils.install("tmp/a", "tmp/b", mode: "o+X")' /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `directory?': no implicit conversion of File::Stat into String (TypeError) from /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `block (3 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each_char' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `block (2 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each_slice' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `block in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:973:in `fu_mode' from /opt/local/lib/ruby/2.7.0/fileutils.rb:883:in `block in install' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1588:in `block in fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1604:in `fu_each_src_dest0' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1586:in `fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:877:in `install' from -e:1:in `<main>' ``` In spite of that `symbolic_modes_to_i` considers the `File::Stat` `path` case at the beginning, in `"X"` case, `path` is passed to `FileTest.directory?` method which requires a `String`. In such case, the mode in `path` should be examined instead. https://github.com/ruby/fileutils/commit/af675af6b2
2020-06-12[ruby/fileutils] Make verbose output go to stdout instead of stderrJeremy Evans
Verbose output is not error output, and should be sent to stdout and not stderr. Fixes Ruby bug 4436 https://github.com/ruby/fileutils/commit/563a383025
2020-06-11Make mutating the result of SortedSet#to_a not affect the setJeremy Evans
Fixes [Bug #15834] Notes: Merged: https://github.com/ruby/ruby/pull/3215
2020-06-11Revert encoding to `::Encoding::UTF_8` if `fu_windows?`Kazuhiro NISHIYAMA
2020-06-11Fix error in `remove_entry`Kazuhiro NISHIYAMA
When `LANG=C`, dir is `UTF-8` and `base` is 'ASCII-8BIT` in `FileUtils::Entry_#join`. So `Encoding::CompatibilityError` occurred and files are not removed. https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20200611T060002Z.fail.html.gz ``` 1) Error: WEBrick::TestFileHandler#test_cjk_in_path: Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/tmp/???20200611-1887828-3nn72a /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1460:in `rmdir' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1460:in `block in remove_dir1' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1471:in `platform_support' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1459:in `remove_dir1' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1452:in `remove' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:780:in `block in remove_entry' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1509:in `ensure in postorder_traverse' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:1509:in `postorder_traverse' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/fileutils.rb:778:in `remove_entry' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/lib/tmpdir.rb:97:in `mktmpdir' /home/chkbuild/chkbuild/tmp/build/20200611T060002Z/ruby/test/webrick/test_filehandler.rb:292:in `test_cjk_in_path' ```
2020-06-11[ruby/logger] Mention `File::Null` in Logger#new documentMasataka Pocke Kuwabara
https://github.com/ruby/logger/commit/2e772770be
2020-06-11[ruby/logger] Mention behavior when logdev is a nil in the documentMasataka Pocke Kuwabara
https://github.com/ruby/logger/commit/8dc270ee23
2020-06-11[ruby/logger] Let Logger#reopen not raise on nil log devicesLourens Naudé
https://github.com/ruby/logger/commit/da7bf844e5
2020-06-11[ruby/logger] Let File::NULL ("/dev/null", "NUL" etc.) be considered a nil ↵Lourens Naudé
log device https://github.com/ruby/logger/commit/b42a1b99aa
2020-06-11[ruby/matrix] Drop to Ruby 2.4 and 2.5Hiroshi SHIBATA
https://github.com/ruby/matrix/commit/3244d82804
2020-06-11[ruby/webrick] Fix httpd error in CJK directoryKazuhiro NISHIYAMA
[Bug #16753] https://github.com/ruby/webrick/commit/83cf440858
2020-06-11[ruby/webrick] Extract creation of Net::HTTP in httpproxyJohn W Higgins
https://github.com/ruby/webrick/commit/e58195faf8
2020-06-11Drop to Ruby 2.4Hiroshi SHIBATA
2020-06-11[ruby/net-imap] Drop to Ruby 2.4Hiroshi SHIBATA
https://github.com/ruby/net-imap/commit/c3256e3848
2020-06-11[ruby/delegate] Fixed superclass missmatchHiroshi SHIBATA
https://github.com/ruby/delegate/commit/3ab3add800
2020-06-09the default gems couldn't use ruby2_keywords gem.Hiroshi SHIBATA
We avoid to use the current delegate library under the Ruby 2.7.
2020-06-09Added ruby2_keywords for Ruby 2.6 and 2.5Hiroshi SHIBATA
2020-06-09[ruby/singleton] Remove unnecessaray spacetaki
https://github.com/ruby/singleton/commit/b7c583f5cd
2020-06-06Remove experimental feaures and related code completelyYuki Nishijima
Original pull request: https://github.com/ruby/did_you_mean/pull/147
2020-06-06Sync did_you_meanYuki Nishijima
Notes: Merged: https://github.com/ruby/ruby/pull/3135
2020-06-05Update docs in net/http.rbKir Shatrov
...to reflect that Net::HTTP.start accepts keep_alive_timeout as an option. Notes: Merged: https://github.com/ruby/ruby/pull/3185
2020-06-05[rubygems/rubygems] Use LoadError#path to figure out the argument passed to ↵Yuki Nishijima
'require' https://github.com/rubygems/rubygems/commit/5995394ec4 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Only run optional validations in packaging contextsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f4fe949dfa Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Split validations into required and optionalDavid Rodríguez
https://github.com/rubygems/rubygems/commit/55b09a7aa2 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Mention that some validations only warnDavid Rodríguez
https://github.com/rubygems/rubygems/commit/32c7f7f484 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Reword `validate` method headerDavid Rodríguez
It's not so basic anymore, and it does much more than validating required fields. https://github.com/rubygems/rubygems/commit/3c0be4cdeb Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Reuse `error` helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3a44b6f846 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Move docs to a better placeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c87ac90528 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Deprecate some methods that are only there for compatibilityDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b4948bda74 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05Enable rubocop-performance StartWith copOlle Jonsson
- this would keep the could-be-a-string-method matches few Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Respect files loaded from default gems before rubygemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f3da3c1190 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Remove direct reference to PRDavid Rodríguez
The code is quite different now, so I think the link might be even confusing. If you want to know more, use git history. https://github.com/rubygems/rubygems/commit/db872c7a18 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix `$LOADED_FEATURES` cache sometimes not respectedDavid Rodríguez
In the cases where the initial manually `-I` path resolution succeeded, we were passing a full path to the original require effectively skipping the `$LOADED_FEATURES` cache. With this change, we _only_ do the resolution when a matching requirable path is found in a default gem. In that case, we skip activation of the default gem if we detect that the required file will be picked up for a `-I` path. https://github.com/rubygems/rubygems/commit/22ad5717c3 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Extract a local outside the loopDavid Rodríguez
https://github.com/rubygems/rubygems/commit/da1492e9d7 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Refactor `Gem.load_path_insert_index`David Rodríguez
https://github.com/rubygems/rubygems/commit/ae95885dff Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix performance regression in `require`David Rodríguez
Our check for `-I` paths should not go through all activated gems. https://github.com/rubygems/rubygems/commit/00d98eb8a3 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05Fix `ruby setup.rb` warningsDavid Rodríguez
Currently we get the following warnings on `ruby setup.rb`: ``` /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/exceptions.rb:281: warning: already initialized constant Gem::UnsatisfiableDepedencyError /home/deivid/Code/rubygems/lib/rubygems/exceptions.rb:281: warning: previous definition of UnsatisfiableDepedencyError was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/user_interaction.rb:557: warning: already initialized constant Gem::StreamUI::ThreadedDownloadReporter::MUTEX /home/deivid/Code/rubygems/lib/rubygems/user_interaction.rb:557: warning: previous definition of MUTEX was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:20: warning: already initialized constant Gem::Ext::Builder::CHDIR_MUTEX /home/deivid/Code/rubygems/lib/rubygems/ext/builder.rb:20: warning: previous definition of CHDIR_MUTEX was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:14: warning: already initialized constant Gem::Ext::ExtConfBuilder::FileEntry /home/deivid/Code/rubygems/lib/rubygems/ext/ext_conf_builder.rb:14: warning: previous definition of FileEntry was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/version.rb:158: warning: already initialized constant Gem::Version::VERSION_PATTERN /home/deivid/Code/rubygems/lib/rubygems/version.rb:158: warning: previous definition of VERSION_PATTERN was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/version.rb:159: warning: already initialized constant Gem::Version::ANCHORED_VERSION_PATTERN /home/deivid/Code/rubygems/lib/rubygems/version.rb:159: warning: previous definition of ANCHORED_VERSION_PATTERN was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:14: warning: already initialized constant Gem::Requirement::OPS /home/deivid/Code/rubygems/lib/rubygems/requirement.rb:14: warning: previous definition of OPS was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:24: warning: already initialized constant Gem::Requirement::SOURCE_SET_REQUIREMENT /home/deivid/Code/rubygems/lib/rubygems/requirement.rb:24: warning: previous definition of SOURCE_SET_REQUIREMENT was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:27: warning: already initialized constant Gem::Requirement::PATTERN_RAW /home/deivid/Code/rubygems/lib/rubygems/requirement.rb:27: warning: previous definition of PATTERN_RAW was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:32: warning: already initialized constant Gem::Requirement::PATTERN /home/deivid/Code/rubygems/lib/rubygems/requirement.rb:32: warning: previous definition of PATTERN was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:37: warning: already initialized constant Gem::Requirement::DefaultRequirement /home/deivid/Code/rubygems/lib/rubygems/requirement.rb:37: warning: previous definition of DefaultRequirement was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:42: warning: already initialized constant Gem::Requirement::DefaultPrereleaseRequirement /home/deivid/Code/rubygems/lib/rubygems/requirement.rb:42: warning: previous definition of DefaultPrereleaseRequirement was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:311: warning: already initialized constant Gem::Version::Requirement /home/deivid/Code/rubygems/lib/rubygems/requirement.rb:311: warning: previous definition of Requirement was here /home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/command.rb:626: warning: already initialized constant Gem::Command::HELP /home/deivid/Code/rubygems/lib/rubygems/command.rb:626: warning: previous definition of HELP was here Successfully built RubyGem Name: bundler Version: 2.2.0.dev File: bundler-2.2.0.dev.gem Bundler 2.2.0.dev installed RubyGems 3.2.0.pre1 installed Regenerating binstubs Regenerating plugins ------------------------------------------------------------------------------ RubyGems installed the following executables: /home/deivid/.rbenv/versions/2.7.1/bin/gem /home/deivid/.rbenv/versions/2.7.1/bin/bundle ``` This is because the `$LOAD_PATH` entry added by `setup.rb` is relatively and when the offending require happens, we're installing `bundler` and have switched folders to `bundler/`. So the require fallsback to the system rubygems. To avoid that, add an absolute path to the `$LOAD_PATH`. On jruby, somehow the $LOAD_PATH is manipulated so that we end up requiring stuff inside the built package even if we have specified the `-I` flag, so we get redefinition warnings anyways. I'm not sure about the root cause, but relative requiring fixes it, and it's faster anyways. Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Require ext only in validate_extension, mention gemspec ↵Josef Šimánek
in warning. https://github.com/rubygems/rubygems/commit/5e31e1a421 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Add build warning when rake based extension is present, ↵Josef Šimánek
but rake is not specified as dependency. https://github.com/rubygems/rubygems/commit/75fe5475b6 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Prefer start_with? and end_with? over regex.Olle Jonsson
- In one of the cases, filenames were checked for ending with "gz" - this is changed to check for ending with ".gz" - The change was made to make it even easier to read the code, and to match only from the start of the input (as opposed to start of the line) https://github.com/rubygems/rubygems/commit/aac4290271 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix template cleanup as wellDavid Rodríguez
https://github.com/rubygems/rubygems/commit/10cc79ee21 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix installing template files with dotsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a82a77251d Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Remove unnecessary parenthesisDavid Rodríguez
https://github.com/rubygems/rubygems/commit/97772bb066 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Make sure rubygems/package can be directly required reliablybronzdoc
https://github.com/rubygems/rubygems/commit/73c199b087 Notes: Merged: https://github.com/ruby/ruby/pull/3184