summaryrefslogtreecommitdiff
path: root/spec/support/rubygems_ext.rb
Commit message (Collapse)AuthorAgeFilesLines
* Bump rake version to 13.0 everywherebump_rakeDavid Rodríguez2020-02-211-1/+1
|
* Use whatever `rake` comes with rubyDavid Rodríguez2020-02-211-1/+0
|
* Unfreeze dep hashesfix_dev_deps_hashesDavid Rodríguez2020-02-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | These hashes are actually modified. For example, to exclude some dependencies under jruby. So they should not be frozen. Without this, running `bin/rake spec:deps` from jruby crashes with: ``` rake aborted! FrozenError: can't modify frozen Hash /path/to/bundler/spec/support/rubygems_ext.rb:36:in `dev_setup' /path/to/bundler/Rakefile:29:in `block in <main>' /path/to/bundler/Rakefile:14:in `block in invoke' /path/to/bundler/Rakefile:13:in `invoke' /path/to/bundler/spec/support/rubygems_ext.rb:98:in `gem_load_and_activate' /path/to/bundler/spec/support/rubygems_ext.rb:45:in `gem_load' Tasks: TOP => spec:deps (See full trace by running task with --trace) ```
* Lock rack to 2.0.8 for teststests/lock_rackDavid Rodríguez2020-01-111-1/+1
|
* Split test gem installation to a separate taskDavid Rodríguez2020-01-071-8/+28
| | | | | | | We run into a race condition when testing in parallel when all processors install test gems to their test folder (due to shared gem cache). So I figure we can instead run this setup sequentially beforehand.
* Simplify `install_gems` methodDavid Rodríguez2020-01-071-4/+1
|
* We don't need a manifestDavid Rodríguez2020-01-071-10/+1
| | | | This is precisely what the `--conservative` flag to `gem install` does.
* Fixed test failures with gem command path on ruby core repo.fixed-bundler-specs-on-ruby-repoHiroshi SHIBATA2019-12-141-1/+1
|
* Bump RuboCop to 0.77.0Koichi ITO2019-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RuboCop 0.77.0 has been released. https://github.com/rubocop-hq/rubocop/releases/tag/v0.77.0 This PR updates the following changes. ```console % bin/rake rubocop bin/rubocop --parallel Error: The `Layout/AlignArray` cop has been renamed to `Layout/ArrayAlignment`. (obsolete configuration found in .rubocop.yml, please update it) The `Layout/AlignParameters` cop has been renamed to `Layout/ParameterAlignment`. (obsolete configuration found in .rubocop.yml, please update it) The `Layout/IndentAssignment` cop has been renamed to `Layout/AssignmentIndentation`. (obsolete configuration found in .rubocop.yml, please update it) The `Layout/IndentFirstArgument` cop has been renamed to `Layout/FirstArgumentIndentation`. (obsolete configuration found in .rubocop.yml, please update it) The `Layout/IndentFirstArrayElement` cop has been renamed to `Layout/FirstArrayElementIndentation`. (obsolete configuration found in .rubocop.yml, please update it) The `Layout/IndentFirstHashElement` cop has been renamed to `Layout/FirstHashElementIndentation`. (obsolete configuration found in .rubocop.yml, please update it) The `Layout/LeadingBlankLines` cop has been renamed to `Layout/LeadingEmptyLines`. (obsolete configuration found in .rubocop.yml, please update it) The `Layout/TrailingBlankLines` cop has been renamed to `Layout/TrailingEmptyLines`. (obsolete configuration found in .rubocop.yml, please update it) The `Lint/DuplicatedKey` cop has been renamed to `Lint/DuplicateHashKey`. (obsolete configuration found in .rubocop.yml, please update it) The `Lint/MultipleCompare` cop has been renamed to `Lint/MultipleComparison`. (obsolete configuration found in .rubocop.yml, please update it) The `Lint/StringConversionInInterpolation` cop has been renamed to `Lint/RedundantStringCoercion`. (obsolete configuration found in .rubocop.yml, please update it) The `Naming/UncommunicativeBlockParamName` cop has been renamed to `Naming/BlockParameterName`. (obsolete configuration found in .rubocop.yml, please update it) rake aborted! Command failed with status (2): [bin/rubocop --parallel...] /Users/koic/src/github.com/bundler/bundler/Rakefile:123:in `block in <top (required)>' /Users/koic/src/github.com/bundler/bundler/Rakefile:15:in `block in invoke' /Users/koic/src/github.com/bundler/bundler/Rakefile:14:in `invoke' /Users/koic/src/github.com/bundler/bundler/spec/support/rubygems_ext.rb:87:in `load' /Users/koic/src/github.com/bundler/bundler/spec/support/rubygems_ext.rb:87:in `gem_load_and_activate' /Users/koic/src/github.com/bundler/bundler/spec/support/rubygems_ext.rb:45:in `gem_load' Tasks: TOP => rubocop (See full trace by running task with --trace) ``` And this PR has auto-correction of .rubocop.yml using Mry gem. https://github.com/pocke/mry ```console % gem i mry Fetching mry-0.77.0.2.gem Successfully installed mry-0.77.0.2 1 gem installed % mry .rubocop.yml ```
* Improve rubygems switching codeDavid Rodríguez2019-12-011-1/+3
| | | | | | | | | | | | Previous version was overly complicated and brittle, and didn't support, for example, using custom branches in rubygems inside the `RGV` environment variable. Now the `RGV` env variable supports: * Local paths. * Arbitrary tags or branches in rubygems repo. * Released rubygems versions.
* Merge #7452Bundlerbot2019-11-231-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7452: Bump rubocop and rubocop-performance r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was not really a problem, but it's good to keep our dependencies up to date. ### What is your fix for the problem, implemented in this PR? My fix is to bump rubocop and rubocop-performance. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
| * Bump rubocop and rubocop-performanceDavid Rodríguez2019-11-221-2/+2
| | | | | | | | To the latest 0.76.0, and 1.5.1, respectively.
* | Reuse installed gems with windows CIDavid Rodríguez2019-11-221-1/+1
|/ | | | | | | | I mounted the local copy of bundler to a Windows VM. I would like system gems to be reused between my Linux and Windows builds, but they are currently not reused because the manifest is written differently from both CIs, and when changing platform, it believes that it has changed when it has not.
* Merge #7435Bundlerbot2019-11-111-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7435: Fix RGV env variable specified as a path r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that using `RGV` (the environment variable we use to select the proper rubygems version to test bundler against) with a path was not quite working. Setting `RGV` to a path (`RGV=..`) is used in the rubygems repo to test the vendored copy of bundler (that lives at `bundler/` inside that repo) against the checked out copy of the repository. ### What was your diagnosis of the problem? My diagnosis was that the previous approach to switch the `rubygems` version, namely, reexec'ing with `--disable-gems` and explicitly requiring our "version switching code" was not quite working because nested subprocesses would end up "leaking" to the system copy of `rubygems` again. ### What is your fix for the problem, implemented in this PR? My fix is to use `RUBYOPT` to configure the path to the rubygems copy that should be used, since I found that even the `require "rubygems"` present's in [ruby's `gem_prelude.rb`](https://github.com/ruby/ruby/blob/c5eb24349a4535948514fe765c3ddb0628d81004/gem_prelude.rb#L1) respects the `-I` option in the `RUBYOPT` env variable. ### Why did you choose this fix out of the possible options? I chose this fix because it's simpler and works better. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
| * Improve rubygems version overriding mechanismDavid Rodríguez2019-11-111-1/+1
| | | | | | | | | | | | | | Rely on adding a path with a `rubygems.rb` file to load paths in RUBYOPT, instead of reexecing with `--disable-gems` and then explicitly requiring the overriding file. By doing this, the correct override mechanism is propagated around subprocesses.
* | Lazily require fileutilsDavid Rodríguez2019-11-111-1/+2
|/ | | | To avoid unintentionally activating the default gem too early.
* Properly avoid readline crashes when running specs on Windowsfix_warning_and_readline_crash_on_windowsDavid Rodríguez2019-11-061-0/+3
| | | | | | | | | | This also avoids the following warning when running specs on any platform: ``` `/home/deivid/Code/bundler/tmp/1/home` is not a directory. Bundler will use `/tmp/bundler/home/deivid' as your home directory temporarily ```
* Replace `with_rubygems` scriptDavid Rodríguez2019-09-191-0/+1
| | | | | | | | | | | | | | | | | | | | | Instead, use a better rubygems version manager that makes sure that `ENV["RGV"]` usage is always applied, and its usage is centralized at a single place. This simplifies the rake task organization and makes it much simpler to run locally exactly what's run in CI. For example, since it doesn't rely on the `RGV` being deleted for subsequent subprocesses, it also running `bin/rake spec:travis` task locally which previously would lead to ``` rake aborted! RubyGems version is required on Travis! ``` It also reduces duplication making it so that we only need to change the `.travis.yml` file when updating tested rubies, and not the `Rakefile` as well.
* Fail hard if activating dep deps failsDavid Rodríguez2019-09-151-1/+1
|
* Remove unnecessary outputDavid Rodríguez2019-09-151-1/+0
|
* Extract helper methodDavid Rodríguez2019-09-151-4/+8
|
* Lazily require rubygems/user_interactionDavid Rodríguez2019-09-151-1/+1
|
* Refactor activation errorsDavid Rodríguez2019-09-151-0/+2
|
* Add a private sectionDavid Rodríguez2019-09-151-5/+7
|
* Use `extend self`David Rodríguez2019-09-151-6/+8
| | | | Instead of repeating `self` on every method.
* Start using automatiek 0.3.0automatiek_0.3David Rodríguez2019-09-041-1/+1
|
* Parallelize test suiteDavid Rodríguez2019-08-181-0/+1
|
* Consistently use `Path` over `Spec::Path`David Rodríguez2019-08-161-1/+1
|
* Extract a `gem_bin` path helperDavid Rodríguez2019-08-161-1/+1
|
* Bump rspec dependency to 3.8bump_rspec_dev_dependencyDavid Rodríguez2019-08-081-1/+1
| | | | | Because we're using `config.bisect_runner` which is only available from 3.8.
* Bump rack and sinatra to latest versionsbump_test_depsDavid Rodríguez2019-08-061-3/+2
|
* Bump rubocop to 0.74.0bump_rubocopDavid Rodríguez2019-07-311-1/+1
| | | | | And reenable exclusion because the bug why we added them has been fixed. See https://github.com/rubocop-hq/rubocop/issues/6861.
* Bump automatiek to 0.2.0David Rodríguez2019-07-241-1/+1
|
* Remove development dependencies from gemspecremove_add_development_dependency_from_gemspecDavid Rodríguez2019-07-081-2/+35
| | | | And refactor development setup.
* Remove unnecessary begin-end blockDavid Rodríguez2019-07-081-15/+13
| | | | And freeze the resulting hash to appease rubocop.
* Remove unnecessary stuffsimplify_gems_used_by_tests_installationDavid Rodríguez2019-03-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Tests automatically download and install the test gems they need if not installed, so this should be unnecessary. However, removing it create a single spec failure only reproducible on a fresh clone (where the path where the test gems are installed, `tmp/gems`, has not yet been populated. The problem was that the code branch that installs the gems uses the `FileUtils` constant. Accessing that constant makes [this autoload] trigger the custom rubygems `require` behavior which will end up setting and memoizing `gem_home` to the value it has at that point (when calling `to_spec` on the selected default gem). But at that point, `Gem.clear_paths` call has already happened, that means `gem_home` won't be changed during the duration of the test because it's memoized. This situation makes a specific test that updates `ENV["HOME"]` and expects he path to the configuration file rubygems uses to be updated fail. This could be fixed by removing the `FileUtils` autoload, or stop memoizing `Gem.home`, but the simplest fix seemed to require `fileutils` early, so that `Gem.home` is not memoized again after calling `Gem.clear_paths`. [this autoload]: https://github.com/rubygems/rubygems/blob/511a0f5105ca95b8e389bf477b6c7cf3e90be7d1/lib/rubygems/source.rb#L3
* Remove unnecessary conditionDavid Rodríguez2019-03-131-1/+1
| | | | | | | This is require "built-in" behavior, it only loads files unless they have been loaded before. So if the constant is defined, the file should've been already loaded. Unless another file is defining that constant, but in that case I'd like to know.
* Fix TODODavid Rodríguez2019-03-081-2/+0
|
* Use ENV["BUNDLE_GEM"] instead of gem command provided by system ruby.SHIBATA Hiroshi2019-02-191-1/+2
| | | | | It break the examples of bundler. Because some examples detect the different version of system ruby than test target version like trunk.
* Remove exception since MRI 1.9.3 is no longer supporteddependency_reviewDavid Rodríguez2019-02-131-4/+3
|
* Bump builder gem since we no longer support MRI 1.9.2David Rodríguez2019-02-131-2/+1
|
* Bump rack-test since we no longer support MRI 1.8.7David Rodríguez2019-02-131-3/+1
|
* Fix TODO note since linked issue seems closedDavid Rodríguez2019-02-131-3/+1
|
* Remove no longer relevant commentDavid Rodríguez2019-02-131-1/+0
| | | | Ruby 2.2.2 is no longer supported.
* Fixed failing examples.SHIBATA Hiroshi2019-01-241-1/+1
|
* Remove unnecessary stuff from specsDavid Rodríguez2018-10-261-5/+1
| | | | Since we no longer test against rubygems versions that old.
* Make RakeTask spec:deps OS agnosticLeo Arnold2018-10-171-6/+6
| | | | | | | | @segiddins encouraged contributions towards support for Windows https://github.com/bundler/bundler/issues/5992#issuecomment-326809543 As a first step towards this goal this commit fixes file path specification in the first pieces of Ruby code called when setting up a test environment.
* Use helper method instead of hard-code path.SHIBATA Hiroshi2018-10-161-1/+1
|
* rubocop -ano-documentSHIBATA Hiroshi2018-07-121-3/+3
|
* To use --no-document option after RubyGems 2.0. RubyGems will remove --no-ri ↵SHIBATA Hiroshi2018-07-121-1/+5
| | | | and --no-rdoc options at RubyGems 3.0