Граф коммитов

13228 Коммитов

Автор SHA1 Сообщение Дата
David Rodríguez b5a0db8be0 [rubygems/rubygems] Remove unnecessary code from remote fetcher tests
This code is not necessary and has the bad side effect of causing
test failures in cascade once a single test inside the file fails.

See https://github.com/rubygems/rubygems/runs/538978838 for an example.

https://github.com/rubygems/rubygems/commit/2291d32915
2020-05-08 14:13:29 +09:00
David Rodríguez a433b82f13 [rubygems/rubygems] Now `Dir.tmpdir` is fixed and there's never such a folder
https://github.com/rubygems/rubygems/commit/44ebbded12
2020-05-08 14:13:29 +09:00
bronzdoc 7fb694fdb0 [rubygems/rubygems] Show gemspec location when a Gem::MissingSpecError is raised while trying to activate a gem
https://github.com/rubygems/rubygems/commit/4da54a8e8b
2020-05-08 14:13:29 +09:00
David Rodríguez 4a417b08ae [rubygems/rubygems] Fix incorrect bundler version being required
In ruby 2.7.0, there's a slight change in bundler's default gemspec file
where the executable folder of the bundler gem is `libexec` instead of
`exe`. I made that change in https://github.com/ruby/ruby/pull/2380 to
try to simplify the integration of the `bundler` gem with upstream,
minimizing the number of changes that need to be made to the gemspec to
adapt to the structure of ruby-core.

That worked ok, expected for this issue. The new name of the folder
including the executable files uncovered a bug in rubygems, which is the
following:

* In order to be able to use newer versions of default gems, `rubygems`
ships with a customized `require` that has knowledge about which files
belong to which default gem. If one of these files is required,
`rubygems` will detect that and activate its gem mechanism to choose the
newest version of the corresponding default gem present in the system
(unless a different version has already been activated). It's this part
of the custom require:

ea3e6f194d/lib/rubygems/core_ext/kernel_require.rb (L77-L85)

* In order to do that, `rubygems` registers a map of default gems and
their files when it is first required:

ea3e6f194d/lib/rubygems.rb (L1247-L1276)

As explained in the method's header, two types of default gem
specifications are supported. One of the formats is the style used by
some ruby-core gemspec files, where paths inside the `spec.files` array
don't include the `spec.require_paths` part. So in this "old style", if
a gem ships with a `lib/bundler.rb` file, it will be registered in this
array as `spec.files = ["bundler.rb"]`, not as `spec.files =
["lib/bundler.rb"]`. The `Gem.register_default_spec` method "detects"
this style by making sure that none of the files in the `spec.files`
array start with any of the `spec.require_paths`.

* Since in ruby 2.7 the default specification file of the `bundler` gem
includes a `libexec/bundle` file, this check would no longer work
correctly, because even though the specification file is still "old
style", it has one registered file which starts with "lib", one of the
"require paths" of the gem.

* This means that the gem is incorrectly detected as "new style", but
since none of the paths start with "lib/", no files are actually
registered, so the gem is not being considered a default gem, and thus
the default version is always used with no possibility of being
"upgraded".

The fix of the problem is simple: check that no files start with `lib/`
(or any other require paths), instead of with "lib" which doesn't
exclude other potential "non requirable folder" starting with lib, like
in the `bundler` case.

https://github.com/rubygems/rubygems/commit/94df740c2b
2020-05-08 14:13:29 +09:00
Nobuyoshi Nakada 6e80cabb90 [rubygems/rubygems] Specify explicit separator not to be affected by $;
https://github.com/rubygems/rubygems/commit/1cea3d4dce
2020-05-08 14:13:29 +09:00
David Rodríguez ece1690105 [rubygems/rubygems] Install man files when bundler installed as a default gem
https://github.com/rubygems/rubygems/commit/28d6d77d81
2020-05-08 14:13:29 +09:00
David Rodríguez 5400811db9 [rubygems/rubygems] Refactor dummy file creation
https://github.com/rubygems/rubygems/commit/665099fe53
2020-05-08 14:13:29 +09:00
David Rodríguez 74867e2dc1 [rubygems/rubygems] Fix super weird code style
https://github.com/rubygems/rubygems/commit/f1a5815896
2020-05-08 14:13:29 +09:00
David Rodríguez ed1e4504a4 [rubygems/rubygems] Follow the pattern of other test files for foo.pem
https://github.com/rubygems/rubygems/commit/a43cffddad
2020-05-08 14:13:29 +09:00
David Rodríguez 1090456370 [rubygems/rubygems] Move helper methods to private section of the test file
https://github.com/rubygems/rubygems/commit/b85db66e2d
2020-05-08 14:13:29 +09:00
David Rodríguez 53b548f438 [rubygems/rubygems] Install existing gems as regular gems
https://github.com/rubygems/rubygems/commit/a0880d78a8
2020-05-08 14:13:29 +09:00
David Rodríguez 6438c5848d [rubygems/rubygems] Remove misleading comments
`site_dir`, or `vendor_dir`, is the location where the default version
of bundler & rubygems gets installed. These folders are placed directly
in the LOAD_PATH, so they cannot hold any nested gem directory
structure. So a single copy of either rubygems or bundler can be placed
in these folders.

What the tests are actually testing is the TODO comment that I'm
removing: that installing the default copy of bundler doesn't affect any
already installed copies of bundler as regular gems.

https://github.com/rubygems/rubygems/commit/7ca8831d72
2020-05-08 14:13:29 +09:00
David Rodríguez 373d01bb7d [rubygems/rubygems] Remove unnecessary line
https://github.com/rubygems/rubygems/commit/1d0981809a
2020-05-08 14:13:29 +09:00
David Rodríguez c58d69e698 [rubygems/rubygems] Condense some artificially broken lines
Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/5f390478c7
2020-05-08 14:13:29 +09:00
David Rodríguez a49a131163 [rubygems/rubygems] Extract `gem_make_out` contents to a variable
Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/5f2b7474eb
2020-05-08 14:13:29 +09:00
David Rodríguez b1541606a2 [rubygems/rubygems] Fix incorrect `gem uninstall --all` message
Currently `gem uninstall --all` shows the following incorrect message
after completion:

```
INFO:  Uninstalled all gems in
```

Now it shows something that actually makes sense like:

```
INFO:  Uninstalled all gems in /home/deivid/Code/rubygems/tmp/test_rubygems_6986/gemhome
```

https://github.com/rubygems/rubygems/commit/8fa05e8f8c
2020-05-08 14:13:29 +09:00
David Rodríguez acb793b71c [rubygems/rubygems] Make cmake tests less verbose on jruby
These tests work on jruby, but the flags to the system command used to
detect whether `cmake` is present seem to be ignored on jruby and the
output is printed to screen instead of being sent to /dev/null. This
results in very verbose tests, like this:

```
$ rake TESTOPTS=--name=TestGemExtCmakeBuilder#test_self_build
(... warnings skipped ...)
Skipping `gem cert` tests on jruby.
Skipping Gem::Security tests on jruby.
Run options: --name=TestGemExtCmakeBuilder#test_self_build --seed 16839

# Running:

/home/deivid/Code/rubygems/test/rubygems/test_gem_ext_cmake_builder.rb:13: warning: system does not support options in JRuby yet: {:out=>"/dev/null", :err=>[:child, :out]}
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

.

Finished in 0.387301s, 2.5820 runs/s, 20.6558 assertions/s.

1 runs, 8 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to /home/deivid/Code/rubygems/coverage. 2258 / 8832 LOC (25.57%) covered.
```

By using `Open3`, we get the test output clean:

```
$ rake TESTOPTS=--name=TestGemExtCmakeBuilder#test_self_build
(... warnings skipped ...)
Skipping `gem cert` tests on jruby.
Skipping Gem::Security tests on jruby.
Run options: --name=TestGemExtCmakeBuilder#test_self_build --seed 22605

# Running:

.

Finished in 0.381959s, 2.6181 runs/s, 20.9446 assertions/s.

1 runs, 8 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to /home/deivid/Code/rubygems/coverage. 2258 / 8832 LOC (25.57%) covered.

```

https://github.com/rubygems/rubygems/commit/531ce37ea3
2020-05-08 14:13:29 +09:00
David Rodríguez 676d816ef1 [rubygems/rubygems] Refactor ruby command line building for tests
https://github.com/rubygems/rubygems/commit/43819b6973
2020-05-08 14:13:29 +09:00
Brandon Fish 1635394347 [rubygems/rubygems] Update test_realworld_default_gem to use rubygems project sources
https://github.com/rubygems/rubygems/commit/7506f7eb07
2020-05-08 14:13:29 +09:00
David Rodríguez 9042787508 [rubygems/rubygems] Remove unnecessary `@@ruby` variable
https://github.com/rubygems/rubygems/commit/5f20647ec1
2020-05-08 14:13:29 +09:00
David Rodríguez c6979feb02 [rubygems/rubygems] Remove unneeded explicit requires
https://github.com/rubygems/rubygems/commit/583316bf49
2020-05-08 14:13:29 +09:00
David Rodríguez df39476a12 [rubygems/rubygems] Remove unneeded dups
https://github.com/rubygems/rubygems/commit/2f072e3dc7
2020-05-08 14:13:29 +09:00
David Rodríguez fd5e4ca41f [rubygems/rubygems] Remove unneeded untainting
https://github.com/rubygems/rubygems/commit/ff223d8489
2020-05-08 14:13:29 +09:00
David Rodríguez 1039c32de6 [rubygems/rubygems] Simplify nested require exceptions
https://github.com/rubygems/rubygems/commit/7fbef2f0e3
2020-05-08 14:13:29 +09:00
David Rodríguez 43daf4d288 [rubygems/rubygems] Fix ruby warning about unused local variables
https://github.com/rubygems/rubygems/commit/cca2fccd95
2020-05-08 14:13:29 +09:00
David Rodríguez 2ece4d96f0 [rubygems/rubygems] Fix ruby warnings about a shadowed variable
https://github.com/rubygems/rubygems/commit/5cfb3252d9
2020-05-08 14:13:29 +09:00
Josef Šimánek a0c4d14acf [rubygems/rubygems] Fix symlink RubyGems test problems for non-admin user.
https://github.com/rubygems/rubygems/commit/75f672ff0e
2020-05-08 14:13:29 +09:00
Dmytro Shyrshov 03fe7da186 [rubygems/rubygems] Allow spaces in file headers during octal check
https://github.com/rubygems/rubygems/commit/e9e25731d8
2020-05-08 14:13:29 +09:00
Peter Zhu ce91c5615c Fix typo in test name 2020-05-08 07:46:33 +09:00
David Rodríguez 427eb2b93f [rubygems/rubygems] Remove unnecessary DIR constant
We have `__dir__` which is the same thing.

https://github.com/rubygems/rubygems/commit/f89776427f
2020-05-08 07:38:50 +09:00
David Rodríguez 1ede0c15a1 [rubygems/rubygems] Move stuff to the instance level
I don't know why it was living at the class level. At first I thought it
would be to reuse some server instances between tests, but they seem to
be cleaned up after every test anyways, so I don't think any of it is
needed.

https://github.com/rubygems/rubygems/commit/04bee71216
2020-05-08 07:38:50 +09:00
David Rodríguez 0b40279d7d Normalize heredoc case in rubygems code base 2020-05-08 07:38:50 +09:00
Benoit Daloze 31663e9e64 [rubygems/rubygems] These specs seem to work just fine on jruby
https://github.com/rubygems/rubygems/commit/a0219b9f27
2020-05-08 07:38:50 +09:00
Benoit Daloze 1464719f5f [rubygems/rubygems] Only run the $SAFE test on MRI < 2.7
* Other Ruby implementations don't support $SAFE.

https://github.com/rubygems/rubygems/commit/9a4ba16efa
2020-05-08 07:38:50 +09:00
Olle Jonsson bb3d80bbbe [rubygems/rubygems] Autoload name_tuple.rb before use
- Resolver asked Molinillo to resolve-then-activate, which led to using Gem::NameTuple before any require had been passed

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>

https://github.com/rubygems/rubygems/commit/e11782b0c8
2020-05-08 07:38:50 +09:00
Josef Šimánek 832a7b0458 [rubygems/rubygems] Add gem build test to check for removed methods.
https://github.com/rubygems/rubygems/commit/c07b9cf4f1
2020-05-08 07:38:50 +09:00
Josef Šimánek 856cbbdd52 [rubygems/rubygems] Track removed methods calls and warn during build time.
move rubyforge_project= to removed methods

https://github.com/rubygems/rubygems/commit/223f7fd470
2020-05-08 07:38:50 +09:00
Josef Šimánek 4dd46dbad0 [rubygems/rubygems] Deprecate rubyforge_project attribute only during build time.
https://github.com/rubygems/rubygems/commit/c44eb21648
2020-05-08 07:38:50 +09:00
Josef Šimánek 60cafe8ea9 [rubygems/rubygems] Revert deprecation of deprecate method for now.
https://github.com/rubygems/rubygems/commit/965eee1741
2020-05-08 07:38:50 +09:00
bronzdoc 0e85a39dc7 [rubygems/rubygems] Restore and deprecate old deprecate method
https://github.com/rubygems/rubygems/commit/024267fa60
2020-05-08 07:38:50 +09:00
bronzdoc 7db538a7c9 [rubygems/rubygems] Rename version horizon deprecation methods
https://github.com/rubygems/rubygems/commit/6afd914fda
2020-05-08 07:38:50 +09:00
bronzdoc 361ed8d0a6 [rubygems/rubygems] Avoid "ambiguous first argument" warning
https://github.com/rubygems/rubygems/commit/984bb9b815
2020-05-08 07:38:50 +09:00
bronzdoc ff37dd7e9e [rubygems/rubygems] Modify files to use new version horizon deprecations
https://github.com/rubygems/rubygems/commit/4fe5bb5bf3
2020-05-08 07:38:50 +09:00
David Rodríguez b8ef5ed8bd [rubygems/rubygems] Remove minitest compatibility code
https://github.com/rubygems/rubygems/commit/24213b97d8
2020-05-08 07:38:50 +09:00
David Rodríguez b72c56681e [rubygems/rubygems] Use newer module Minitest name
https://github.com/rubygems/rubygems/commit/2890622479
2020-05-08 07:38:50 +09:00
Kazuhiro NISHIYAMA 7ded8fd29a
Fix a typo [ci skip] 2020-05-08 01:22:38 +09:00
Jean Boussier cbe4f75ef8 Fix rb_profile_frame_classpath to handle module singletons
Right now `SomeClass.method` is properly named, but `SomeModule.method`
is displayed as `#<Module:0x000055eb5d95adc8>.method` which makes
profiling annoying.
2020-05-07 08:46:36 -07:00
Yusuke Endoh 1084b679bd Restore the external and internal encodings of STDIN, STDOUT, and STDERR
IRB::ReadlineInputMethod#initialize changes them via IRB.set_encoding.
2020-05-08 00:19:54 +09:00
Yusuke Endoh 3b147c4213 test/irb/test_cmd.rb: clear IRB.@CONF on setup
It caches a path to .irbrc file, which has caused random failure:

```
  1) Failure:
TestIRB::ExtendCommand#test_irb_info_multiline [/home/mame/work/ruby/test/irb/test_cmd.rb:49]:
Expected /
        Ruby\sversion: .+\n
        IRB\sversion:\sirb .+\n
        InputMethod:\sReidlineInputMethod\swith\sReline .+ and .+\n
        \.irbrc\spath: .+
      /x to match "Ruby version: 2.8.0\n" +
"IRB version: irb 1.2.3 (2020-02-15)\n" +
"InputMethod: ReidlineInputMethod with Reline 0.1.4 and /tmp/test_reline_config_155659/.inputrc\n".
```
2020-05-08 00:15:01 +09:00
Kazuhiro NISHIYAMA 6300e6d378
Remove test of ruby-mode.el
Because ruby-mode.el already removed at f03e68edb8
2020-05-07 14:56:08 +09:00