aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove random codeDavid Rodríguez2020-06-151-3/+0
|
* Use space inside block braces everywhereDavid Rodríguez2020-06-1565-230/+230
| | | | To make rubygems code style consistent with bundler.
* Fix ruby-head failing testsDavid Rodríguez2020-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Revert "Revert "[rubygems/rubygems] Remove unneeded global teardown""David Rodríguez2020-06-151-5/+4
| | | | This reverts commit ac2c07e98373bb62be618001c897fa9d5809d8a4.
* Use filesystem encoding in do_GET of filehandlerKazuhiro NISHIYAMA2020-06-151-0/+5
| | | | | | | | | | | | | | | | | | | | 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"]>. ```
* Revert "[ruby/fileutils] Make verbose output go to stdout instead of stderr"Nobuyoshi Nakada2020-06-121-1/+1
| | | | | | This reverts commit 7cddb844e6d51f954c6669341b9cc656bd7d3492, because the test of rake 13.0.1 is depending on the previous behavior.
* [ruby/fileutils] Fix #install with "X" mode optionNobuyoshi Nakada2020-06-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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
* [ruby/fileutils] Make verbose output go to stdout instead of stderrJeremy Evans2020-06-121-1/+1
| | | | | | | | | 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
* Make mutating the result of SortedSet#to_a not affect the setJeremy Evans2020-06-111-1/+1
| | | | Fixes [Bug #15834]
* Revert encoding to `::Encoding::UTF_8` if `fu_windows?`Kazuhiro NISHIYAMA2020-06-111-1/+1
|
* Fix error in `remove_entry`Kazuhiro NISHIYAMA2020-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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' ```
* [ruby/logger] Mention `File::Null` in Logger#new documentMasataka Pocke Kuwabara2020-06-111-1/+2
| | | | https://github.com/ruby/logger/commit/2e772770be
* [ruby/logger] Mention behavior when logdev is a nil in the documentMasataka Pocke Kuwabara2020-06-111-2/+2
| | | | https://github.com/ruby/logger/commit/8dc270ee23
* [ruby/logger] Let Logger#reopen not raise on nil log devicesLourens Naudé2020-06-111-1/+1
| | | | https://github.com/ruby/logger/commit/da7bf844e5
* [ruby/logger] Let File::NULL ("/dev/null", "NUL" etc.) be considered a nil ↵Lourens Naudé2020-06-111-1/+1
| | | | | | log device https://github.com/ruby/logger/commit/b42a1b99aa
* [ruby/matrix] Drop to Ruby 2.4 and 2.5Hiroshi SHIBATA2020-06-111-0/+1
| | | | https://github.com/ruby/matrix/commit/3244d82804
* [ruby/webrick] Fix httpd error in CJK directoryKazuhiro NISHIYAMA2020-06-111-1/+1
| | | | | | [Bug #16753] https://github.com/ruby/webrick/commit/83cf440858
* [ruby/webrick] Extract creation of Net::HTTP in httpproxyJohn W Higgins2020-06-111-1/+5
| | | | https://github.com/ruby/webrick/commit/e58195faf8
* Drop to Ruby 2.4Hiroshi SHIBATA2020-06-111-0/+1
|
* [ruby/net-imap] Drop to Ruby 2.4Hiroshi SHIBATA2020-06-111-1/+1
| | | | https://github.com/ruby/net-imap/commit/c3256e3848
* [ruby/delegate] Fixed superclass missmatchHiroshi SHIBATA2020-06-111-1/+1
| | | | https://github.com/ruby/delegate/commit/3ab3add800
* the default gems couldn't use ruby2_keywords gem.Hiroshi SHIBATA2020-06-091-2/+1
| | | | We avoid to use the current delegate library under the Ruby 2.7.
* Added ruby2_keywords for Ruby 2.6 and 2.5Hiroshi SHIBATA2020-06-091-0/+2
|
* [ruby/singleton] Remove unnecessaray spacetaki2020-06-091-1/+1
| | | | https://github.com/ruby/singleton/commit/b7c583f5cd
* Remove experimental feaures and related code completelyYuki Nishijima2020-06-062-85/+0
| | | | Original pull request: https://github.com/ruby/did_you_mean/pull/147
* Sync did_you_meanYuki Nishijima2020-06-065-116/+119
|
* Update docs in net/http.rbKir Shatrov2020-06-051-1/+1
| | | ...to reflect that Net::HTTP.start accepts keep_alive_timeout as an option.
* [rubygems/rubygems] Use LoadError#path to figure out the argument passed to ↵Yuki Nishijima2020-06-051-1/+1
| | | | | | 'require' https://github.com/rubygems/rubygems/commit/5995394ec4
* [rubygems/rubygems] Only run optional validations in packaging contextsDavid Rodríguez2020-06-051-1/+1
| | | | https://github.com/rubygems/rubygems/commit/f4fe949dfa
* [rubygems/rubygems] Split validations into required and optionalDavid Rodríguez2020-06-051-13/+47
| | | | https://github.com/rubygems/rubygems/commit/55b09a7aa2
* [rubygems/rubygems] Mention that some validations only warnDavid Rodríguez2020-06-051-0/+3
| | | | https://github.com/rubygems/rubygems/commit/32c7f7f484
* [rubygems/rubygems] Reword `validate` method headerDavid Rodríguez2020-06-051-2/+1
| | | | | | | It's not so basic anymore, and it does much more than validating required fields. https://github.com/rubygems/rubygems/commit/3c0be4cdeb
* [rubygems/rubygems] Reuse `error` helperDavid Rodríguez2020-06-051-2/+1
| | | | https://github.com/rubygems/rubygems/commit/3a44b6f846
* [rubygems/rubygems] Move docs to a better placeDavid Rodríguez2020-06-052-7/+3
| | | | https://github.com/rubygems/rubygems/commit/c87ac90528
* [rubygems/rubygems] Deprecate some methods that are only there for compatibilityDavid Rodríguez2020-06-051-0/+3
| | | | https://github.com/rubygems/rubygems/commit/b4948bda74
* Enable rubocop-performance StartWith copOlle Jonsson2020-06-055-9/+7
| | | | - this would keep the could-be-a-string-method matches few
* [rubygems/rubygems] Respect files loaded from default gems before rubygemsDavid Rodríguez2020-06-052-0/+15
| | | | https://github.com/rubygems/rubygems/commit/f3da3c1190
* [rubygems/rubygems] Remove direct reference to PRDavid Rodríguez2020-06-051-1/+0
| | | | | | | 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
* [rubygems/rubygems] Fix `$LOADED_FEATURES` cache sometimes not respectedDavid Rodríguez2020-06-051-29/+24
| | | | | | | | | | | 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
* [rubygems/rubygems] Extract a local outside the loopDavid Rodríguez2020-06-051-1/+2
| | | | https://github.com/rubygems/rubygems/commit/da1492e9d7
* [rubygems/rubygems] Refactor `Gem.load_path_insert_index`David Rodríguez2020-06-052-14/+4
| | | | https://github.com/rubygems/rubygems/commit/ae95885dff
* [rubygems/rubygems] Fix performance regression in `require`David Rodríguez2020-06-053-1/+12
| | | | | | Our check for `-I` paths should not go through all activated gems. https://github.com/rubygems/rubygems/commit/00d98eb8a3
* Fix `ruby setup.rb` warningsDavid Rodríguez2020-06-056-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [rubygems/rubygems] Require ext only in validate_extension, mention gemspec ↵Josef Šimánek2020-06-051-2/+2
| | | | | | in warning. https://github.com/rubygems/rubygems/commit/5e31e1a421
* [rubygems/rubygems] Add build warning when rake based extension is present, ↵Josef Šimánek2020-06-052-0/+16
| | | | | | but rake is not specified as dependency. https://github.com/rubygems/rubygems/commit/75fe5475b6
* [rubygems/rubygems] Prefer start_with? and end_with? over regex.Olle Jonsson2020-06-054-5/+7
| | | | | | | | | | - 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
* [rubygems/rubygems] Fix template cleanup as wellDavid Rodríguez2020-06-051-1/+1
| | | | https://github.com/rubygems/rubygems/commit/10cc79ee21
* [rubygems/rubygems] Fix installing template files with dotsDavid Rodríguez2020-06-051-1/+1
| | | | https://github.com/rubygems/rubygems/commit/a82a77251d
* [rubygems/rubygems] Remove unnecessary parenthesisDavid Rodríguez2020-06-051-2/+2
| | | | https://github.com/rubygems/rubygems/commit/97772bb066
* [rubygems/rubygems] Make sure rubygems/package can be directly required reliablybronzdoc2020-06-051-0/+1
| | | | https://github.com/rubygems/rubygems/commit/73c199b087