зеркало из https://github.com/github/ruby.git
Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20
This commit is contained in:
Родитель
5537adf719
Коммит
69ed64949b
|
@ -122,9 +122,7 @@ module Bundler
|
|||
else command = "bundle-#{cli}"
|
||||
end
|
||||
|
||||
man_path = File.expand_path("../../../man", __FILE__)
|
||||
# man files are located under ruby's mandir with the default gems of bundler
|
||||
man_path = RbConfig::CONFIG["mandir"] unless File.directory?(man_path)
|
||||
man_path = File.expand_path("man", __dir__)
|
||||
man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
|
||||
[File.basename(f, ".*"), f]
|
||||
end]
|
||||
|
@ -134,8 +132,7 @@ module Bundler
|
|||
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
||||
Kernel.exec "man #{man_page}"
|
||||
else
|
||||
fallback_man_path = File.expand_path("../man", __FILE__)
|
||||
puts File.read("#{fallback_man_path}/#{File.basename(man_page)}.ronn")
|
||||
puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
|
||||
end
|
||||
elsif command_path = Bundler.which("bundler-#{cli}")
|
||||
Kernel.exec(command_path, "--help")
|
||||
|
|
|
@ -95,7 +95,7 @@ module Bundler
|
|||
when "minitest"
|
||||
templates.merge!(
|
||||
"test/minitest/test_helper.rb.tt" => "test/test_helper.rb",
|
||||
"test/minitest/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
|
||||
"test/minitest/test_newgem.rb.tt" => "test/test_#{namespaced_path}.rb"
|
||||
)
|
||||
config[:test_task] = :test
|
||||
when "test-unit"
|
||||
|
|
|
@ -7,6 +7,11 @@ module Bundler
|
|||
class Definition
|
||||
include GemHelpers
|
||||
|
||||
class << self
|
||||
# Do not create or modify a lockfile (Makes #lock a noop)
|
||||
attr_accessor :no_lock
|
||||
end
|
||||
|
||||
attr_reader(
|
||||
:dependencies,
|
||||
:locked_deps,
|
||||
|
@ -336,6 +341,8 @@ module Bundler
|
|||
end
|
||||
|
||||
def lock(file, preserve_unknown_sections = false)
|
||||
return if Definition.no_lock
|
||||
|
||||
contents = to_lock
|
||||
|
||||
# Convert to \r\n if the existing lock has them
|
||||
|
|
|
@ -69,8 +69,8 @@ module Bundler
|
|||
:HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
|
||||
FAIL_ERRORS = begin
|
||||
fail_errors = [AuthenticationRequiredError, BadAuthenticationError, FallbackError]
|
||||
fail_errors << Gem::Requirement::BadRequirementError if defined?(Gem::Requirement::BadRequirementError)
|
||||
fail_errors.concat(NET_ERRORS.map {|e| SharedHelpers.const_get_safely(e, Net) }.compact)
|
||||
fail_errors << Gem::Requirement::BadRequirementError
|
||||
fail_errors.concat(NET_ERRORS.map {|e| Net.const_get(e) })
|
||||
end.freeze
|
||||
|
||||
class << self
|
||||
|
|
|
@ -117,13 +117,13 @@ module Bundler
|
|||
def git_push(remote = nil)
|
||||
remote ||= default_remote
|
||||
perform_git_push remote
|
||||
perform_git_push "#{remote} #{version_tag}"
|
||||
perform_git_push "#{remote} refs/tags/#{version_tag}"
|
||||
Bundler.ui.confirm "Pushed git commits and release tag."
|
||||
end
|
||||
|
||||
def default_remote
|
||||
current_branch = sh(%w[git rev-parse --abbrev-ref HEAD]).strip
|
||||
return "origin" if current_branch.empty?
|
||||
# We can replace this with `git branch --show-current` once we drop support for git < 2.22.0
|
||||
current_branch = sh(%w[git rev-parse --abbrev-ref HEAD]).gsub(%r{\Aheads/}, "").strip
|
||||
|
||||
remote_for_branch = sh(%W[git config --get branch.#{current_branch}.remote]).strip
|
||||
return "origin" if remote_for_branch.empty?
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-ADD" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-ADD" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-BINSTUBS" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-BINSTUBS" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-CACHE" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-CACHE" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-CHECK" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-CHECK" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-CLEAN" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-CLEAN" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-CONFIG" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-CONFIG" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-config\fR \- Set bundler configuration options
|
||||
|
@ -211,10 +211,10 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|||
\fBignore_messages\fR (\fBBUNDLE_IGNORE_MESSAGES\fR): When set, no post install messages will be printed\. To silence a single gem, use dot notation like \fBignore_messages\.httparty true\fR\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBinit_gems_rb\fR (\fBBUNDLE_INIT_GEMS_RB\fR) Generate a \fBgems\.rb\fR instead of a \fBGemfile\fR when running \fBbundle init\fR\.
|
||||
\fBinit_gems_rb\fR (\fBBUNDLE_INIT_GEMS_RB\fR): Generate a \fBgems\.rb\fR instead of a \fBGemfile\fR when running \fBbundle init\fR\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBjobs\fR (\fBBUNDLE_JOBS\fR): The number of gems Bundler can install in parallel\. Defaults to 1\.
|
||||
\fBjobs\fR (\fBBUNDLE_JOBS\fR): The number of gems Bundler can install in parallel\. Defaults to 1 on Windows, and to the the number of processors on other platforms\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBno_install\fR (\fBBUNDLE_NO_INSTALL\fR): Whether \fBbundle package\fR should skip installing gems\.
|
||||
|
@ -241,7 +241,7 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|||
\fBprefer_patch\fR (BUNDLE_PREFER_PATCH): Prefer updating only to next patch version during updates\. Makes \fBbundle update\fR calls equivalent to \fBbundler update \-\-patch\fR\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBprint_only_version_number\fR (\fBBUNDLE_PRINT_ONLY_VERSION_NUMBER\fR) Print only version number from \fBbundler \-\-version\fR\.
|
||||
\fBprint_only_version_number\fR (\fBBUNDLE_PRINT_ONLY_VERSION_NUMBER\fR): Print only version number from \fBbundler \-\-version\fR\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBredirect\fR (\fBBUNDLE_REDIRECT\fR): The number of redirects allowed for network requests\. Defaults to \fB5\fR\.
|
||||
|
@ -283,7 +283,7 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|||
\fBunlock_source_unlocks_spec\fR (\fBBUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC\fR): Whether running \fBbundle update \-\-source NAME\fR unlocks a gem with the given name\. Defaults to \fBtrue\fR\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBupdate_requires_all_flag\fR (\fBBUNDLE_UPDATE_REQUIRES_ALL_FLAG\fR) Require passing \fB\-\-all\fR to \fBbundle update\fR when everything should be updated, and disallow passing no options to \fBbundle update\fR\.
|
||||
\fBupdate_requires_all_flag\fR (\fBBUNDLE_UPDATE_REQUIRES_ALL_FLAG\fR): Require passing \fB\-\-all\fR to \fBbundle update\fR when everything should be updated, and disallow passing no options to \fBbundle update\fR\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBuser_agent\fR (\fBBUNDLE_USER_AGENT\fR): The custom user agent fragment Bundler includes in API requests\.
|
||||
|
@ -458,7 +458,7 @@ export BUNDLE_GITHUB__COM=username:password
|
|||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
This is especially useful for private repositories on hosts such as Github, where you can use personal OAuth tokens:
|
||||
This is especially useful for private repositories on hosts such as GitHub, where you can use personal OAuth tokens:
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
|
@ -206,13 +206,14 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|||
* `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
|
||||
Whether Bundler should cache all gems globally, rather than locally to the
|
||||
installing Ruby installation.
|
||||
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
|
||||
messages will be printed. To silence a single gem, use dot notation like
|
||||
`ignore_messages.httparty true`.
|
||||
* `init_gems_rb` (`BUNDLE_INIT_GEMS_RB`)
|
||||
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`):
|
||||
When set, no post install messages will be printed. To silence a single gem,
|
||||
use dot notation like `ignore_messages.httparty true`.
|
||||
* `init_gems_rb` (`BUNDLE_INIT_GEMS_RB`):
|
||||
Generate a `gems.rb` instead of a `Gemfile` when running `bundle init`.
|
||||
* `jobs` (`BUNDLE_JOBS`):
|
||||
The number of gems Bundler can install in parallel. Defaults to 1.
|
||||
The number of gems Bundler can install in parallel. Defaults to 1 on Windows,
|
||||
and to the the number of processors on other platforms.
|
||||
* `no_install` (`BUNDLE_NO_INSTALL`):
|
||||
Whether `bundle package` should skip installing gems.
|
||||
* `no_prune` (`BUNDLE_NO_PRUNE`):
|
||||
|
@ -233,7 +234,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|||
Enable Bundler's experimental plugin system.
|
||||
* `prefer_patch` (BUNDLE_PREFER_PATCH):
|
||||
Prefer updating only to next patch version during updates. Makes `bundle update` calls equivalent to `bundler update --patch`.
|
||||
* `print_only_version_number` (`BUNDLE_PRINT_ONLY_VERSION_NUMBER`)
|
||||
* `print_only_version_number` (`BUNDLE_PRINT_ONLY_VERSION_NUMBER`):
|
||||
Print only version number from `bundler --version`.
|
||||
* `redirect` (`BUNDLE_REDIRECT`):
|
||||
The number of redirects allowed for network requests. Defaults to `5`.
|
||||
|
@ -269,7 +270,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|||
* `unlock_source_unlocks_spec` (`BUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC`):
|
||||
Whether running `bundle update --source NAME` unlocks a gem with the given
|
||||
name. Defaults to `true`.
|
||||
* `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`)
|
||||
* `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`):
|
||||
Require passing `--all` to `bundle update` when everything should be updated,
|
||||
and disallow passing no options to `bundle update`.
|
||||
* `user_agent` (`BUNDLE_USER_AGENT`):
|
||||
|
@ -369,7 +370,7 @@ Or you can set the credentials as an environment variable like so:
|
|||
|
||||
export BUNDLE_GITHUB__COM=username:password
|
||||
|
||||
This is especially useful for private repositories on hosts such as Github,
|
||||
This is especially useful for private repositories on hosts such as GitHub,
|
||||
where you can use personal OAuth tokens:
|
||||
|
||||
export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-DOCTOR" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-DOCTOR" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-doctor\fR \- Checks the bundle for common problems
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-EXEC" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-EXEC" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-exec\fR \- Execute a command in the context of the bundle
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-GEM" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-GEM" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-INFO" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-INFO" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-info\fR \- Show information for the given gem in your bundle
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-INIT" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-INIT" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-INJECT" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-INJECT" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-INSTALL" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-INSTALL" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-LIST" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-LIST" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-list\fR \- List all the gems in the bundle
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-LOCK" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-LOCK" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-OPEN" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-OPEN" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-OUTDATED" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-OUTDATED" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-outdated\fR \- List installed gems with newer versions available
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-PLATFORM" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-PLATFORM" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-platform\fR \- Displays platform compatibility information
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-PRISTINE" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-PRISTINE" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-REMOVE" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-REMOVE" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-remove\fR \- Removes gems from the Gemfile
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-SHOW" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-SHOW" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-UPDATE" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-UPDATE" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE\-VIZ" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE\-VIZ" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "BUNDLE" "1" "November 2020" "" ""
|
||||
.TH "BUNDLE" "1" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBbundle\fR \- Ruby Dependency Management
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GEMFILE" "5" "November 2020" "" ""
|
||||
.TH "GEMFILE" "5" "December 2020" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
||||
|
@ -507,7 +507,7 @@ gem "rails", :git => "git://github\.com/rails/rails\.git"
|
|||
Since the \fBgithub\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
||||
.
|
||||
.SS "GIST"
|
||||
If the git repository you want to use is hosted as a Github Gist and is public, you can use the :gist shorthand to specify the gist identifier (without the trailing "\.git")\.
|
||||
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use the :gist shorthand to specify the gist identifier (without the trailing "\.git")\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
|
@ -374,7 +374,7 @@ Since the `github` method is a specialization of `git_source`, it accepts a `:br
|
|||
|
||||
### GIST
|
||||
|
||||
If the git repository you want to use is hosted as a Github Gist and is public, you can use
|
||||
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use
|
||||
the :gist shorthand to specify the gist identifier (without the trailing ".git").
|
||||
|
||||
gem "the_hatch", :gist => "4815162342"
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
Gemfile(5) gemfile.5
|
||||
bundle(1) bundle.1
|
||||
bundle-add(1) bundle-add.1
|
||||
bundle-binstubs(1) bundle-binstubs.1
|
||||
bundle-cache(1) bundle-cache.1
|
||||
bundle-check(1) bundle-check.1
|
||||
bundle-clean(1) bundle-clean.1
|
||||
bundle-config(1) bundle-config.1
|
||||
bundle-doctor(1) bundle-doctor.1
|
||||
bundle-exec(1) bundle-exec.1
|
||||
bundle-gem(1) bundle-gem.1
|
||||
bundle-info(1) bundle-info.1
|
||||
bundle-init(1) bundle-init.1
|
||||
bundle-inject(1) bundle-inject.1
|
||||
bundle-install(1) bundle-install.1
|
||||
bundle-list(1) bundle-list.1
|
||||
bundle-lock(1) bundle-lock.1
|
||||
bundle-open(1) bundle-open.1
|
||||
bundle-outdated(1) bundle-outdated.1
|
||||
bundle-platform(1) bundle-platform.1
|
||||
bundle-pristine(1) bundle-pristine.1
|
||||
bundle-remove(1) bundle-remove.1
|
||||
bundle-show(1) bundle-show.1
|
||||
bundle-update(1) bundle-update.1
|
||||
bundle-viz(1) bundle-viz.1
|
|
@ -12,7 +12,7 @@ module Bundler
|
|||
yield
|
||||
f.flock(File::LOCK_UN)
|
||||
end
|
||||
rescue Errno::EACCES, Errno::ENOLCK, *[SharedHelpers.const_get_safely(:ENOTSUP, Errno)].compact
|
||||
rescue Errno::EACCES, Errno::ENOLCK, Errno::ENOTSUP
|
||||
# In the case the user does not have access to
|
||||
# create the lock file or is using NFS where
|
||||
# locks are not available we skip locking.
|
||||
|
|
|
@ -109,7 +109,7 @@ module Bundler
|
|||
raise VirtualProtocolError.new
|
||||
rescue Errno::ENOSPC
|
||||
raise NoSpaceOnDeviceError.new(path, action)
|
||||
rescue *[const_get_safely(:ENOTSUP, Errno)].compact
|
||||
rescue Errno::ENOTSUP
|
||||
raise OperationNotSupportedError.new(path, action)
|
||||
rescue Errno::EEXIST, Errno::ENOENT
|
||||
raise
|
||||
|
@ -117,13 +117,6 @@ module Bundler
|
|||
raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.")
|
||||
end
|
||||
|
||||
def const_get_safely(constant_name, namespace)
|
||||
const_in_namespace = namespace.constants.include?(constant_name.to_s) ||
|
||||
namespace.constants.include?(constant_name.to_sym)
|
||||
return nil unless const_in_namespace
|
||||
namespace.const_get(constant_name)
|
||||
end
|
||||
|
||||
def major_deprecation(major_version, message, print_caller_location: false)
|
||||
if print_caller_location
|
||||
caller_location = caller_locations(2, 2).first
|
||||
|
|
|
@ -67,13 +67,13 @@ module Bundler
|
|||
|
||||
def branch
|
||||
@branch ||= allowed_with_path do
|
||||
git("rev-parse --abbrev-ref HEAD", :dir => path).strip
|
||||
git("rev-parse", "--abbrev-ref", "HEAD", :dir => path).strip
|
||||
end
|
||||
end
|
||||
|
||||
def contains?(commit)
|
||||
allowed_with_path do
|
||||
result, status = git_null("branch --contains #{commit}", :dir => path)
|
||||
result, status = git_null("branch", "--contains", commit, :dir => path)
|
||||
status.success? && result =~ /^\* (.*)$/
|
||||
end
|
||||
end
|
||||
|
@ -88,20 +88,22 @@ module Bundler
|
|||
|
||||
def checkout
|
||||
return if path.exist? && has_revision_cached?
|
||||
extra_ref = "#{Shellwords.shellescape(ref)}:#{Shellwords.shellescape(ref)}" if ref && ref.start_with?("refs/")
|
||||
extra_ref = "#{ref}:#{ref}" if ref && ref.start_with?("refs/")
|
||||
|
||||
Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
|
||||
|
||||
configured_uri = configured_uri_for(uri).to_s
|
||||
|
||||
unless path.exist?
|
||||
SharedHelpers.filesystem_access(path.dirname) do |p|
|
||||
FileUtils.mkdir_p(p)
|
||||
end
|
||||
git_retry %(clone #{uri_escaped_with_configured_credentials} "#{path}" --bare --no-hardlinks --quiet)
|
||||
git_retry "clone", configured_uri, path.to_s, "--bare", "--no-hardlinks", "--quiet"
|
||||
return unless extra_ref
|
||||
end
|
||||
|
||||
with_path do
|
||||
git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref}), :dir => path
|
||||
git_retry(*["fetch", "--force", "--quiet", "--tags", configured_uri, "refs/heads/*:refs/heads/*", extra_ref].compact, :dir => path)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -115,7 +117,7 @@ module Bundler
|
|||
SharedHelpers.filesystem_access(destination) do |p|
|
||||
FileUtils.rm_rf(p)
|
||||
end
|
||||
git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}")
|
||||
git_retry "clone", "--no-checkout", "--quiet", path.to_s, destination.to_s
|
||||
File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination)
|
||||
rescue Errno::EEXIST => e
|
||||
file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1]
|
||||
|
@ -125,46 +127,45 @@ module Bundler
|
|||
end
|
||||
end
|
||||
# method 2
|
||||
git_retry %(fetch --force --quiet --tags "#{path}"), :dir => destination
|
||||
git_retry "fetch", "--force", "--quiet", "--tags", path.to_s, :dir => destination
|
||||
|
||||
begin
|
||||
git "reset --hard #{@revision}", :dir => destination
|
||||
git "reset", "--hard", @revision, :dir => destination
|
||||
rescue GitCommandError => e
|
||||
raise MissingGitRevisionError.new(e.command, path, destination, @revision, URICredentialsFilter.credential_filtered_uri(uri))
|
||||
end
|
||||
|
||||
if submodules
|
||||
git_retry "submodule update --init --recursive", :dir => destination
|
||||
git_retry "submodule", "update", "--init", "--recursive", :dir => destination
|
||||
elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
|
||||
inner_command = "git -C $toplevel submodule deinit --force $sm_path"
|
||||
inner_command = inner_command.gsub("$") { '\$' } unless Bundler::WINDOWS
|
||||
git_retry "submodule foreach --quiet \"#{inner_command}\"", :dir => destination
|
||||
git_retry "submodule", "foreach", "--quiet", inner_command, :dir => destination
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def git_null(command, dir: SharedHelpers.pwd)
|
||||
def git_null(*command, dir: SharedHelpers.pwd)
|
||||
check_allowed(command)
|
||||
|
||||
out, status = SharedHelpers.with_clean_git_env do
|
||||
capture_and_ignore_stderr("git #{command}", :chdir => dir.to_s)
|
||||
capture_and_ignore_stderr("git", "-C", dir.to_s, *command)
|
||||
end
|
||||
|
||||
[URICredentialsFilter.credential_filtered_string(out, uri), status]
|
||||
end
|
||||
|
||||
def git_retry(command, dir: SharedHelpers.pwd)
|
||||
Bundler::Retry.new("`git #{URICredentialsFilter.credential_filtered_string(command, uri)}`", GitNotAllowedError).attempts do
|
||||
git(command, :dir => dir)
|
||||
def git_retry(*command, dir: SharedHelpers.pwd)
|
||||
Bundler::Retry.new("`git -C #{dir} #{URICredentialsFilter.credential_filtered_string(command.shelljoin, uri)}`", GitNotAllowedError).attempts do
|
||||
git(*command, :dir => dir)
|
||||
end
|
||||
end
|
||||
|
||||
def git(command, dir: SharedHelpers.pwd)
|
||||
def git(*command, dir: SharedHelpers.pwd)
|
||||
command_with_no_credentials = check_allowed(command)
|
||||
|
||||
out, status = SharedHelpers.with_clean_git_env do
|
||||
capture_and_filter_stderr(uri, "git #{command}", :chdir => dir.to_s)
|
||||
capture_and_filter_stderr("git", "-C", dir.to_s, *command)
|
||||
end
|
||||
|
||||
raise GitCommandError.new(command_with_no_credentials, path, dir) unless status.success?
|
||||
|
@ -174,7 +175,7 @@ module Bundler
|
|||
|
||||
def has_revision_cached?
|
||||
return unless @revision
|
||||
with_path { git("cat-file -e #{@revision}", :dir => path) }
|
||||
with_path { git("cat-file", "-e", @revision, :dir => path) }
|
||||
true
|
||||
rescue GitError
|
||||
false
|
||||
|
@ -186,26 +187,12 @@ module Bundler
|
|||
|
||||
def find_local_revision
|
||||
allowed_with_path do
|
||||
git("rev-parse --verify #{Shellwords.shellescape(ref)}", :dir => path).strip
|
||||
git("rev-parse", "--verify", ref, :dir => path).strip
|
||||
end
|
||||
rescue GitCommandError => e
|
||||
raise MissingGitRevisionError.new(e.command, path, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
|
||||
end
|
||||
|
||||
# Escape the URI for git commands
|
||||
def uri_escaped_with_configured_credentials
|
||||
remote = configured_uri_for(uri)
|
||||
if Bundler::WINDOWS
|
||||
# Windows quoting requires double quotes only, with double quotes
|
||||
# inside the string escaped by being doubled.
|
||||
'"' + remote.gsub('"') { '""' } + '"'
|
||||
else
|
||||
# Bash requires single quoted strings, with the single quotes escaped
|
||||
# by ending the string, escaping the quote, and restarting the string.
|
||||
"'" + remote.gsub("'") { "'\\''" } + "'"
|
||||
end
|
||||
end
|
||||
|
||||
# Adds credentials to the URI as Fetcher#configured_uri_for does
|
||||
def configured_uri_for(uri)
|
||||
if /https?:/ =~ uri
|
||||
|
@ -233,21 +220,21 @@ module Bundler
|
|||
end
|
||||
|
||||
def check_allowed(command)
|
||||
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri)
|
||||
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command.shelljoin, uri)
|
||||
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
|
||||
command_with_no_credentials
|
||||
end
|
||||
|
||||
def capture_and_filter_stderr(uri, cmd, chdir: SharedHelpers.pwd)
|
||||
def capture_and_filter_stderr(*cmd)
|
||||
require "open3"
|
||||
return_value, captured_err, status = Open3.capture3(cmd, :chdir => chdir)
|
||||
Bundler.ui.warn URICredentialsFilter.credential_filtered_string(captured_err, uri) if uri && !captured_err.empty?
|
||||
return_value, captured_err, status = Open3.capture3(*cmd)
|
||||
Bundler.ui.warn URICredentialsFilter.credential_filtered_string(captured_err, uri) unless captured_err.empty?
|
||||
[return_value, status]
|
||||
end
|
||||
|
||||
def capture_and_ignore_stderr(cmd, chdir: SharedHelpers.pwd)
|
||||
def capture_and_ignore_stderr(*cmd)
|
||||
require "open3"
|
||||
return_value, _, status = Open3.capture3(cmd, :chdir => chdir)
|
||||
return_value, _, status = Open3.capture3(*cmd)
|
||||
[return_value, status]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -487,8 +487,15 @@ module Bundler
|
|||
uri = spec.remote.uri
|
||||
Bundler.ui.confirm("Fetching #{version_message(spec)}")
|
||||
rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
|
||||
|
||||
# older rubygems return varying file:// variants depending on version
|
||||
rubygems_local_path = rubygems_local_path.gsub(/\Afile:/, "") unless Bundler.rubygems.provides?(">= 3.2.0.rc.2")
|
||||
rubygems_local_path = rubygems_local_path.gsub(%r{\A//}, "") if Bundler.rubygems.provides?("< 3.1.0")
|
||||
|
||||
if rubygems_local_path != local_path
|
||||
FileUtils.mv(rubygems_local_path, local_path)
|
||||
SharedHelpers.filesystem_access(local_path) do
|
||||
FileUtils.mv(rubygems_local_path, local_path)
|
||||
end
|
||||
end
|
||||
cache_globally(spec, local_path)
|
||||
end
|
||||
|
|
|
@ -3,7 +3,16 @@
|
|||
require "bundler/gem_tasks"
|
||||
<% default_task_names = [config[:test_task]].compact -%>
|
||||
<% case config[:test] -%>
|
||||
<% when "minitest", "test-unit" -%>
|
||||
<% when "minitest" -%>
|
||||
require "rake/testtask"
|
||||
|
||||
Rake::TestTask.new(:test) do |t|
|
||||
t.libs << "test"
|
||||
t.libs << "lib"
|
||||
t.test_files = FileList["test/**/test_*.rb"]
|
||||
end
|
||||
|
||||
<% when "test-unit" -%>
|
||||
require "rake/testtask"
|
||||
|
||||
Rake::TestTask.new(:test) do |t|
|
||||
|
|
|
@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
|
|||
# Specify which files should be added to the gem when it is released.
|
||||
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
||||
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
||||
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
||||
`git ls-files -z`.split("\x0").reject do |f|
|
||||
f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
||||
end
|
||||
end
|
||||
spec.bindir = "exe"
|
||||
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require "test_helper"
|
||||
|
||||
class <%= config[:constant_name] %>Test < Minitest::Test
|
||||
class Test<%= config[:constant_name] %> < Minitest::Test
|
||||
def test_that_it_has_a_version_number
|
||||
refute_nil ::<%= config[:constant_name] %>::VERSION
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: false
|
||||
|
||||
module Bundler
|
||||
VERSION = "2.2.3".freeze
|
||||
VERSION = "2.3.0.dev".freeze
|
||||
|
||||
def self.bundler_major_version
|
||||
@bundler_major_version ||= VERSION.split(".").first.to_i
|
||||
|
|
|
@ -31,6 +31,16 @@ RSpec.describe Bundler::Definition do
|
|||
to raise_error(Bundler::TemporaryResourceError, /temporarily unavailable/)
|
||||
end
|
||||
end
|
||||
context "when Bundler::Definition.no_lock is set to true" do
|
||||
subject { Bundler::Definition.new(nil, [], Bundler::SourceList.new, []) }
|
||||
before { Bundler::Definition.no_lock = true }
|
||||
after { Bundler::Definition.no_lock = false }
|
||||
|
||||
it "does not create a lock file" do
|
||||
subject.lock("Gemfile.lock")
|
||||
expect(File.file?("Gemfile.lock")).to eq false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "detects changes" do
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "bundler/settings"
|
||||
require "openssl"
|
||||
|
||||
RSpec.describe Bundler::Env do
|
||||
let(:git_proxy_stub) { Bundler::Source::Git::GitProxy.new(nil, nil, nil) }
|
||||
|
|
|
@ -256,6 +256,16 @@ RSpec.describe Bundler::GemHelper do
|
|||
|
||||
Rake.application["release"].invoke
|
||||
end
|
||||
|
||||
it "also works when releasing from an ambiguous reference" do
|
||||
# Create a branch with the same name as the tag
|
||||
sys_exec("git checkout -b v#{app_version}", :dir => app_path)
|
||||
sys_exec("git push -u origin v#{app_version}", :dir => app_path)
|
||||
|
||||
expect(subject).to receive(:rubygem_push).with(app_gem_path.to_s)
|
||||
|
||||
Rake.application["release"].invoke
|
||||
end
|
||||
end
|
||||
|
||||
context "on releasing with a custom tag prefix" do
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../support/streams"
|
||||
|
||||
RSpec.describe Bundler::Plugin do
|
||||
Plugin = Bundler::Plugin
|
||||
|
||||
|
@ -296,11 +294,9 @@ RSpec.describe Bundler::Plugin do
|
|||
end
|
||||
|
||||
it "executes the hook" do
|
||||
out = capture(:stdout) do
|
||||
expect do
|
||||
Plugin.hook(Bundler::Plugin::Events::EVENT_1)
|
||||
end.strip
|
||||
|
||||
expect(out).to eq("hook for event 1")
|
||||
end.to output("hook for event 1\n").to_stdout
|
||||
end
|
||||
|
||||
context "single plugin declaring more than one hook" do
|
||||
|
@ -311,12 +307,10 @@ RSpec.describe Bundler::Plugin do
|
|||
RUBY
|
||||
|
||||
it "evals plugins.rb once" do
|
||||
out = capture(:stdout) do
|
||||
expect do
|
||||
Plugin.hook(Bundler::Plugin::Events::EVENT_1)
|
||||
Plugin.hook(Bundler::Plugin::Events::EVENT_2)
|
||||
end.strip
|
||||
|
||||
expect(out).to eq("loaded")
|
||||
end.to output("loaded\n").to_stdout
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -326,11 +320,9 @@ RSpec.describe Bundler::Plugin do
|
|||
RUBY
|
||||
|
||||
it "is passed to the hook" do
|
||||
out = capture(:stdout) do
|
||||
expect do
|
||||
Plugin.hook(Bundler::Plugin::Events::EVENT_1) { puts "win" }
|
||||
end.strip
|
||||
|
||||
expect(out).to eq("win")
|
||||
end.to output("win\n").to_stdout
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -494,28 +494,4 @@ RSpec.describe Bundler::SharedHelpers do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#const_get_safely" do
|
||||
module TargetNamespace
|
||||
VALID_CONSTANT = 1
|
||||
end
|
||||
|
||||
context "when the namespace does have the requested constant" do
|
||||
it "returns the value of the requested constant" do
|
||||
expect(subject.const_get_safely(:VALID_CONSTANT, TargetNamespace)).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
context "when the requested constant is passed as a string" do
|
||||
it "returns the value of the requested constant" do
|
||||
expect(subject.const_get_safely("VALID_CONSTANT", TargetNamespace)).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
context "when the namespace does not have the requested constant" do
|
||||
it "returns nil" do
|
||||
expect(subject.const_get_safely("INVALID_CONSTANT", TargetNamespace)).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,21 +11,21 @@ RSpec.describe Bundler::Source::Git::GitProxy do
|
|||
context "with configured credentials" do
|
||||
it "adds username and password to URI" do
|
||||
Bundler.settings.temporary(uri => "u:p") do
|
||||
expect(subject).to receive(:git_retry).with(match("https://u:p@github.com/rubygems/rubygems.git"))
|
||||
expect(subject).to receive(:git_retry).with("clone", "https://u:p@github.com/rubygems/rubygems.git", any_args)
|
||||
subject.checkout
|
||||
end
|
||||
end
|
||||
|
||||
it "adds username and password to URI for host" do
|
||||
Bundler.settings.temporary("github.com" => "u:p") do
|
||||
expect(subject).to receive(:git_retry).with(match("https://u:p@github.com/rubygems/rubygems.git"))
|
||||
expect(subject).to receive(:git_retry).with("clone", "https://u:p@github.com/rubygems/rubygems.git", any_args)
|
||||
subject.checkout
|
||||
end
|
||||
end
|
||||
|
||||
it "does not add username and password to mismatched URI" do
|
||||
Bundler.settings.temporary("https://u:p@github.com/rubygems/rubygems-mismatch.git" => "u:p") do
|
||||
expect(subject).to receive(:git_retry).with(match(uri))
|
||||
expect(subject).to receive(:git_retry).with("clone", uri, any_args)
|
||||
subject.checkout
|
||||
end
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ RSpec.describe Bundler::Source::Git::GitProxy do
|
|||
Bundler.settings.temporary("github.com" => "u:p") do
|
||||
original = "https://orig:info@github.com/rubygems/rubygems.git"
|
||||
subject = described_class.new(Pathname("path"), original, "HEAD")
|
||||
expect(subject).to receive(:git_retry).with(match(original))
|
||||
expect(subject).to receive(:git_retry).with("clone", original, any_args)
|
||||
subject.checkout
|
||||
end
|
||||
end
|
||||
|
@ -129,12 +129,12 @@ RSpec.describe Bundler::Source::Git::GitProxy do
|
|||
|
||||
context "when given a SHA as a revision" do
|
||||
let(:revision) { "abcd" * 10 }
|
||||
let(:command) { "reset --hard #{revision}" }
|
||||
let(:command) { ["reset", "--hard", revision] }
|
||||
|
||||
it "fails gracefully when resetting to the revision fails" do
|
||||
expect(subject).to receive(:git_retry).with(start_with("clone ")) { destination.mkpath }
|
||||
expect(subject).to receive(:git_retry).with(start_with("fetch "), :dir => destination)
|
||||
expect(subject).to receive(:git).with(command, :dir => destination).and_raise(Bundler::Source::Git::GitCommandError.new(command, cache, destination))
|
||||
expect(subject).to receive(:git_retry).with("clone", any_args) { destination.mkpath }
|
||||
expect(subject).to receive(:git_retry).with("fetch", any_args, :dir => destination)
|
||||
expect(subject).to receive(:git).with(*command, :dir => destination).and_raise(Bundler::Source::Git::GitCommandError.new(command, cache, destination))
|
||||
expect(subject).not_to receive(:git)
|
||||
|
||||
expect { subject.copy_to(destination, submodules) }.
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../../support/streams"
|
||||
|
||||
RSpec.describe Bundler::UI::Shell do
|
||||
subject { described_class.new }
|
||||
|
||||
|
@ -43,10 +41,19 @@ RSpec.describe Bundler::UI::Shell do
|
|||
|
||||
context "when stderr is closed" do
|
||||
it "doesn't report anything" do
|
||||
output = capture(:stderr, :closed => true) do
|
||||
subject.error("Something went wrong")
|
||||
end
|
||||
expect(output).to_not eq("Something went wrong\n")
|
||||
output = begin
|
||||
result = StringIO.new
|
||||
result.close
|
||||
|
||||
$stderr = result
|
||||
|
||||
subject.error("Something went wrong")
|
||||
|
||||
result.string
|
||||
ensure
|
||||
$stderr = STDERR
|
||||
end
|
||||
expect(output).to_not eq("Something went wrong")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -221,7 +221,7 @@ RSpec.describe "bundle cache" do
|
|||
end
|
||||
end
|
||||
|
||||
bundle "config --local without wo"
|
||||
bundle "config set --local without wo"
|
||||
install_gemfile <<-G
|
||||
source "file:#{gem_repo1}"
|
||||
gem "rack"
|
||||
|
@ -237,7 +237,7 @@ RSpec.describe "bundle cache" do
|
|||
expect(the_bundle).to include_gem "rack 1.0"
|
||||
expect(the_bundle).not_to include_gems "weakling", "uninstallable"
|
||||
|
||||
bundle "config --local without wo"
|
||||
bundle "config set --local without wo"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gem "rack 1.0"
|
||||
expect(the_bundle).not_to include_gems "weakling", "uninstallable"
|
||||
|
@ -254,7 +254,7 @@ RSpec.describe "bundle cache" do
|
|||
end
|
||||
|
||||
subject do
|
||||
bundle "config --local frozen true"
|
||||
bundle "config set --local frozen true"
|
||||
bundle :cache, :raise_on_error => false
|
||||
end
|
||||
|
||||
|
@ -304,8 +304,8 @@ RSpec.describe "bundle install with gem sources" do
|
|||
simulate_new_machine
|
||||
FileUtils.rm_rf gem_repo2
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local deployment true"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||
end
|
||||
|
|
|
@ -124,7 +124,7 @@ RSpec.describe "bundle check" do
|
|||
gem "rack", :group => :foo
|
||||
G
|
||||
|
||||
bundle "config --local without foo"
|
||||
bundle "config set --local without foo"
|
||||
bundle :install
|
||||
|
||||
gemfile <<-G
|
||||
|
@ -217,7 +217,7 @@ RSpec.describe "bundle check" do
|
|||
gem "foo"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle "install"
|
||||
FileUtils.rm(bundled_app_lock)
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ RSpec.describe ".bundle/config" do
|
|||
|
||||
it "can be moved with an environment variable" do
|
||||
ENV["BUNDLE_APP_CONFIG"] = tmp("foo/bar").to_s
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle "install"
|
||||
|
||||
expect(bundled_app(".bundle")).not_to exist
|
||||
|
@ -57,7 +57,7 @@ RSpec.describe ".bundle/config" do
|
|||
FileUtils.mkdir_p bundled_app("omg")
|
||||
|
||||
ENV["BUNDLE_APP_CONFIG"] = "../foo"
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle "install", :dir => bundled_app("omg")
|
||||
|
||||
expect(bundled_app(".bundle")).not_to exist
|
||||
|
|
|
@ -295,7 +295,7 @@ RSpec.describe "bundle exec" do
|
|||
end
|
||||
|
||||
it "handles gems installed with --without" do
|
||||
bundle "config --local without middleware"
|
||||
bundle "config set --local without middleware"
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "rack" # rack 0.9.1 and 1.0 exist
|
||||
|
@ -448,35 +448,35 @@ RSpec.describe "bundle exec" do
|
|||
with_fake_man do
|
||||
bundle "#{exec} --help cat"
|
||||
end
|
||||
expect(out).to include(%(["#{root}/man/bundle-exec.1"]))
|
||||
expect(out).to include(%(["#{man_dir}/bundle-exec.1"]))
|
||||
end
|
||||
|
||||
it "shows bundle-exec's man page when --help is before exec" do
|
||||
with_fake_man do
|
||||
bundle "--help #{exec}"
|
||||
end
|
||||
expect(out).to include(%(["#{root}/man/bundle-exec.1"]))
|
||||
expect(out).to include(%(["#{man_dir}/bundle-exec.1"]))
|
||||
end
|
||||
|
||||
it "shows bundle-exec's man page when -h is before exec" do
|
||||
with_fake_man do
|
||||
bundle "-h #{exec}"
|
||||
end
|
||||
expect(out).to include(%(["#{root}/man/bundle-exec.1"]))
|
||||
expect(out).to include(%(["#{man_dir}/bundle-exec.1"]))
|
||||
end
|
||||
|
||||
it "shows bundle-exec's man page when --help is after exec" do
|
||||
with_fake_man do
|
||||
bundle "#{exec} --help"
|
||||
end
|
||||
expect(out).to include(%(["#{root}/man/bundle-exec.1"]))
|
||||
expect(out).to include(%(["#{man_dir}/bundle-exec.1"]))
|
||||
end
|
||||
|
||||
it "shows bundle-exec's man page when -h is after exec" do
|
||||
with_fake_man do
|
||||
bundle "#{exec} -h"
|
||||
end
|
||||
expect(out).to include(%(["#{root}/man/bundle-exec.1"]))
|
||||
expect(out).to include(%(["#{man_dir}/bundle-exec.1"]))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,14 +5,14 @@ RSpec.describe "bundle help" do
|
|||
with_fake_man do
|
||||
bundle "help gemfile"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/gemfile.5"]))
|
||||
expect(out).to eq(%(["#{man_dir}/gemfile.5"]))
|
||||
end
|
||||
|
||||
it "prefixes bundle commands with bundle- when finding the man files" do
|
||||
with_fake_man do
|
||||
bundle "help install"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/bundle-install.1"]))
|
||||
expect(out).to eq(%(["#{man_dir}/bundle-install.1"]))
|
||||
end
|
||||
|
||||
it "simply outputs the human readable file when there is no man on the path" do
|
||||
|
@ -45,28 +45,28 @@ RSpec.describe "bundle help" do
|
|||
with_fake_man do
|
||||
bundle "install --help"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/bundle-install.1"]))
|
||||
expect(out).to eq(%(["#{man_dir}/bundle-install.1"]))
|
||||
end
|
||||
|
||||
it "is called when the --help flag is used before the command" do
|
||||
with_fake_man do
|
||||
bundle "--help install"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/bundle-install.1"]))
|
||||
expect(out).to eq(%(["#{man_dir}/bundle-install.1"]))
|
||||
end
|
||||
|
||||
it "is called when the -h flag is used before the command" do
|
||||
with_fake_man do
|
||||
bundle "-h install"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/bundle-install.1"]))
|
||||
expect(out).to eq(%(["#{man_dir}/bundle-install.1"]))
|
||||
end
|
||||
|
||||
it "is called when the -h flag is used after the command" do
|
||||
with_fake_man do
|
||||
bundle "install -h"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/bundle-install.1"]))
|
||||
expect(out).to eq(%(["#{man_dir}/bundle-install.1"]))
|
||||
end
|
||||
|
||||
it "has helpful output when using --help flag for a non-existent command" do
|
||||
|
@ -80,11 +80,11 @@ RSpec.describe "bundle help" do
|
|||
with_fake_man do
|
||||
bundle "--help"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/bundle.1"]))
|
||||
expect(out).to eq(%(["#{man_dir}/bundle.1"]))
|
||||
|
||||
with_fake_man do
|
||||
bundle "-h"
|
||||
end
|
||||
expect(out).to eq(%(["#{root}/man/bundle.1"]))
|
||||
expect(out).to eq(%(["#{man_dir}/bundle.1"]))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -291,7 +291,7 @@ RSpec.describe "bundle install with gem sources" do
|
|||
end
|
||||
|
||||
it "works" do
|
||||
bundle "config --local path vendor"
|
||||
bundle "config set --local path vendor"
|
||||
bundle "install"
|
||||
expect(the_bundle).to include_gems "rack 1.0"
|
||||
end
|
||||
|
@ -580,8 +580,10 @@ RSpec.describe "bundle install with gem sources" do
|
|||
end
|
||||
|
||||
describe "when bundle path does not have write access", :permissions do
|
||||
let(:bundle_path) { bundled_app("vendor") }
|
||||
|
||||
before do
|
||||
FileUtils.mkdir_p(bundled_app("vendor"))
|
||||
FileUtils.mkdir_p(bundle_path)
|
||||
gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem 'rack'
|
||||
|
@ -589,11 +591,32 @@ RSpec.describe "bundle install with gem sources" do
|
|||
end
|
||||
|
||||
it "should display a proper message to explain the problem" do
|
||||
FileUtils.chmod(0o500, bundled_app("vendor"))
|
||||
FileUtils.chmod(0o500, bundle_path)
|
||||
|
||||
bundle "config --local path vendor"
|
||||
bundle "config set --local path vendor"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include(bundled_app("vendor").to_s)
|
||||
expect(err).to include(bundle_path.to_s)
|
||||
expect(err).to include("grant write permissions")
|
||||
end
|
||||
end
|
||||
|
||||
describe "when bundle cache path does not have write access", :permissions do
|
||||
let(:cache_path) { bundled_app("vendor/#{Bundler.ruby_scope}/cache") }
|
||||
|
||||
before do
|
||||
FileUtils.mkdir_p(cache_path)
|
||||
gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem 'rack'
|
||||
G
|
||||
end
|
||||
|
||||
it "should display a proper message to explain the problem" do
|
||||
FileUtils.chmod(0o500, cache_path)
|
||||
|
||||
bundle "config set --local path vendor"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include(cache_path.to_s)
|
||||
expect(err).to include("grant write permissions")
|
||||
end
|
||||
end
|
||||
|
@ -604,7 +627,7 @@ RSpec.describe "bundle install with gem sources" do
|
|||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "rack"
|
||||
G
|
||||
bundle "config --local path bundle"
|
||||
bundle "config set --local path bundle"
|
||||
bundle "install", :standalone => true
|
||||
end
|
||||
|
||||
|
|
|
@ -536,7 +536,7 @@ RSpec.describe "bundle gem" do
|
|||
end
|
||||
|
||||
it "builds spec skeleton" do
|
||||
expect(bundled_app("#{gem_name}/test/#{require_path}_test.rb")).to exist
|
||||
expect(bundled_app("#{gem_name}/test/test_#{require_path}.rb")).to exist
|
||||
expect(bundled_app("#{gem_name}/test/test_helper.rb")).to exist
|
||||
end
|
||||
end
|
||||
|
@ -556,7 +556,7 @@ RSpec.describe "bundle gem" do
|
|||
end
|
||||
|
||||
it "builds spec skeleton" do
|
||||
expect(bundled_app("#{gem_name}/test/#{require_path}_test.rb")).to exist
|
||||
expect(bundled_app("#{gem_name}/test/test_#{require_path}.rb")).to exist
|
||||
expect(bundled_app("#{gem_name}/test/test_helper.rb")).to exist
|
||||
end
|
||||
|
||||
|
@ -565,11 +565,11 @@ RSpec.describe "bundle gem" do
|
|||
end
|
||||
|
||||
it "requires 'test_helper'" do
|
||||
expect(bundled_app("#{gem_name}/test/#{require_path}_test.rb").read).to include(%(require "test_helper"))
|
||||
expect(bundled_app("#{gem_name}/test/test_#{require_path}.rb").read).to include(%(require "test_helper"))
|
||||
end
|
||||
|
||||
it "creates a default test which fails" do
|
||||
expect(bundled_app("#{gem_name}/test/#{require_path}_test.rb").read).to include("assert false")
|
||||
expect(bundled_app("#{gem_name}/test/test_#{require_path}.rb").read).to include("assert false")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -589,7 +589,7 @@ RSpec.describe "bundle gem" do
|
|||
Rake::TestTask.new(:test) do |t|
|
||||
t.libs << "test"
|
||||
t.libs << "lib"
|
||||
t.test_files = FileList["test/**/*_test.rb"]
|
||||
t.test_files = FileList["test/**/test_*.rb"]
|
||||
end
|
||||
|
||||
task default: :test
|
||||
|
|
|
@ -29,21 +29,21 @@ RSpec.describe "post bundle message" do
|
|||
expect(out).to include(bundle_complete_message)
|
||||
expect(out).to include(installed_gems_stats)
|
||||
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(out).to include(bundle_show_message)
|
||||
expect(out).to include("Gems in the group emo were not installed")
|
||||
expect(out).to include(bundle_complete_message)
|
||||
expect(out).to include(installed_gems_stats)
|
||||
|
||||
bundle "config --local without emo test"
|
||||
bundle "config set --local without emo test"
|
||||
bundle :install
|
||||
expect(out).to include(bundle_show_message)
|
||||
expect(out).to include("Gems in the groups emo and test were not installed")
|
||||
expect(out).to include(bundle_complete_message)
|
||||
expect(out).to include("4 Gemfile dependencies, 3 gems now installed.")
|
||||
|
||||
bundle "config --local without emo obama test"
|
||||
bundle "config set --local without emo obama test"
|
||||
bundle :install
|
||||
expect(out).to include(bundle_show_message)
|
||||
expect(out).to include("Gems in the groups emo, obama and test were not installed")
|
||||
|
@ -55,28 +55,28 @@ RSpec.describe "post bundle message" do
|
|||
let(:bundle_path) { "./vendor" }
|
||||
|
||||
it "shows proper messages according to the configured groups" do
|
||||
bundle "config --local path vendor"
|
||||
bundle "config set --local path vendor"
|
||||
bundle :install
|
||||
expect(out).to include(bundle_show_path_message)
|
||||
expect(out).to_not include("Gems in the group")
|
||||
expect(out).to include(bundle_complete_message)
|
||||
|
||||
bundle "config --local path vendor"
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local path vendor"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(out).to include(bundle_show_path_message)
|
||||
expect(out).to include("Gems in the group emo were not installed")
|
||||
expect(out).to include(bundle_complete_message)
|
||||
|
||||
bundle "config --local path vendor"
|
||||
bundle "config --local without emo test"
|
||||
bundle "config set --local path vendor"
|
||||
bundle "config set --local without emo test"
|
||||
bundle :install
|
||||
expect(out).to include(bundle_show_path_message)
|
||||
expect(out).to include("Gems in the groups emo and test were not installed")
|
||||
expect(out).to include(bundle_complete_message)
|
||||
|
||||
bundle "config --local path vendor"
|
||||
bundle "config --local without emo obama test"
|
||||
bundle "config set --local path vendor"
|
||||
bundle "config set --local without emo obama test"
|
||||
bundle :install
|
||||
expect(out).to include(bundle_show_path_message)
|
||||
expect(out).to include("Gems in the groups emo, obama and test were not installed")
|
||||
|
@ -88,7 +88,7 @@ RSpec.describe "post bundle message" do
|
|||
let(:bundle_path) { bundled_app("cache") }
|
||||
|
||||
it "shows proper messages according to the configured groups" do
|
||||
bundle "config --local path #{bundle_path}"
|
||||
bundle "config set --local path #{bundle_path}"
|
||||
bundle :install
|
||||
expect(out).to include("Bundled gems are installed into `./cache`")
|
||||
expect(out).to_not include("Gems in the group")
|
||||
|
@ -100,7 +100,7 @@ RSpec.describe "post bundle message" do
|
|||
let(:bundle_path) { tmp("not_bundled_app") }
|
||||
|
||||
it "shows proper messages according to the configured groups" do
|
||||
bundle "config --local path #{bundle_path}"
|
||||
bundle "config set --local path #{bundle_path}"
|
||||
bundle :install
|
||||
expect(out).to include("Bundled gems are installed into `#{tmp("not_bundled_app")}`")
|
||||
expect(out).to_not include("Gems in the group")
|
||||
|
@ -193,19 +193,19 @@ The source does not contain any versions of 'not-a-gem'
|
|||
expect(out).not_to include("Gems in the groups")
|
||||
expect(out).to include(bundle_updated_message)
|
||||
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
bundle :update, :all => true
|
||||
expect(out).to include("Gems in the group emo were not updated")
|
||||
expect(out).to include(bundle_updated_message)
|
||||
|
||||
bundle "config --local without emo test"
|
||||
bundle "config set --local without emo test"
|
||||
bundle :install
|
||||
bundle :update, :all => true
|
||||
expect(out).to include("Gems in the groups emo and test were not updated")
|
||||
expect(out).to include(bundle_updated_message)
|
||||
|
||||
bundle "config --local without emo obama test"
|
||||
bundle "config set --local without emo obama test"
|
||||
bundle :install
|
||||
bundle :update, :all => true
|
||||
expect(out).to include("Gems in the groups emo, obama and test were not updated")
|
||||
|
|
|
@ -44,8 +44,8 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
it "still works if you are not in the app directory and specify --gemfile" do
|
||||
bundle "install"
|
||||
simulate_new_machine
|
||||
bundle "config --local deployment true"
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local deployment true"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle "install --gemfile #{tmp}/bundled_app/Gemfile", :dir => tmp
|
||||
expect(the_bundle).to include_gems "rack 1.0"
|
||||
end
|
||||
|
@ -58,8 +58,8 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
end
|
||||
G
|
||||
bundle :install
|
||||
bundle "config --local deployment true"
|
||||
bundle "config --local without test"
|
||||
bundle "config set --local deployment true"
|
||||
bundle "config set --local without test"
|
||||
bundle :install
|
||||
end
|
||||
|
||||
|
@ -67,7 +67,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
skip "doesn't find bundle" if Gem.win_platform?
|
||||
|
||||
bundle :install
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install
|
||||
bundle "exec bundle check", :env => { "PATH" => path }
|
||||
end
|
||||
|
@ -81,7 +81,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
G
|
||||
|
||||
bundle :install
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install
|
||||
end
|
||||
|
||||
|
@ -92,7 +92,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
gem "rack-obama", ">= 1.0"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :artifice => "endpoint_strict_basic_authentication"
|
||||
end
|
||||
|
||||
|
@ -103,7 +103,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
end
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install
|
||||
|
||||
expect(the_bundle).to include_gems "rack 1.0"
|
||||
|
@ -111,7 +111,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
|
||||
context "when replacing a host with the same host with credentials" do
|
||||
before do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle "install"
|
||||
gemfile <<-G
|
||||
source "http://user_name:password@localgemserver.test/"
|
||||
|
@ -215,7 +215,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
gem "rack-obama"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include("deployment mode")
|
||||
expect(err).to include("You have added to the Gemfile")
|
||||
|
@ -234,9 +234,9 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
expect(the_bundle).to include_gems "path_gem 1.0"
|
||||
FileUtils.rm_r lib_path("path_gem-1.0")
|
||||
|
||||
bundle "config --local path .bundle"
|
||||
bundle "config --local without development"
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local path .bundle"
|
||||
bundle "config set --local without development"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :env => { "DEBUG" => "1" }
|
||||
run "puts :WIN"
|
||||
expect(out).to eq("WIN")
|
||||
|
@ -252,8 +252,8 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
expect(the_bundle).to include_gems "path_gem 1.0"
|
||||
FileUtils.rm_r lib_path("path_gem-1.0")
|
||||
|
||||
bundle "config --local path .bundle"
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local path .bundle"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.")
|
||||
end
|
||||
|
@ -324,7 +324,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
gem "activesupport"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include("deployment mode")
|
||||
expect(err).to include("You have added to the Gemfile:\n* activesupport\n\n")
|
||||
|
@ -338,7 +338,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
gem "rack", :git => "git://hubz.com"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include("deployment mode")
|
||||
expect(err).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
|
||||
|
@ -358,7 +358,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
gem "rack"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include("deployment mode")
|
||||
expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}")
|
||||
|
@ -382,7 +382,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
|||
gem "foo", :git => "#{lib_path("rack")}"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include("deployment mode")
|
||||
expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`")
|
||||
|
|
|
@ -47,7 +47,7 @@ RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
|
|||
# parsed lockfile and the evaluated gemfile.
|
||||
it "bundles with deployment mode configured" do
|
||||
bundle :install
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install
|
||||
end
|
||||
end
|
||||
|
|
|
@ -291,7 +291,7 @@ RSpec.describe "bundle install from an existing gemspec" do
|
|||
s.add_dependency "activesupport", ">= 1.0.1"
|
||||
end
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :raise_on_error => false
|
||||
|
||||
expect(err).to include("changed")
|
||||
|
@ -558,7 +558,7 @@ RSpec.describe "bundle install from an existing gemspec" do
|
|||
it "installs the ruby platform gemspec and skips dev deps with `without development` configured" do
|
||||
simulate_platform "ruby"
|
||||
|
||||
bundle "config --local without development"
|
||||
bundle "config set --local without development"
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
|
||||
|
|
|
@ -128,7 +128,7 @@ RSpec.describe "bundle install with git sources" do
|
|||
end
|
||||
|
||||
it "still works after moving the application directory" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle "install"
|
||||
|
||||
FileUtils.mv bundled_app, tmp("bundled_app.bck")
|
||||
|
@ -137,7 +137,7 @@ RSpec.describe "bundle install with git sources" do
|
|||
end
|
||||
|
||||
it "can still install after moving the application directory" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle "install"
|
||||
|
||||
FileUtils.mv bundled_app, tmp("bundled_app.bck")
|
||||
|
@ -1064,7 +1064,7 @@ RSpec.describe "bundle install with git sources" do
|
|||
|
||||
simulate_new_machine
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install
|
||||
end
|
||||
end
|
||||
|
|
|
@ -86,7 +86,7 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "installs gems in the default group" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default]
|
||||
end
|
||||
|
@ -117,7 +117,7 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "does not install gems from the excluded group" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default]
|
||||
end
|
||||
|
@ -130,13 +130,13 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "does not say it installed gems from the excluded group" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(out).not_to include("activesupport")
|
||||
end
|
||||
|
||||
it "allows Bundler.setup for specific groups" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
run("require 'rack'; puts RACK", :default)
|
||||
expect(out).to eq("1.0.0")
|
||||
|
@ -151,7 +151,7 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
G
|
||||
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => [:default]
|
||||
end
|
||||
|
@ -188,7 +188,7 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "installs gems from the optional group when requested" do
|
||||
bundle "config --local with debugging"
|
||||
bundle "config set --local with debugging"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "thin 1.0"
|
||||
end
|
||||
|
@ -214,13 +214,13 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "removes groups from without when passed at --with", :bundler => "< 3" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle "install --with emo"
|
||||
expect(the_bundle).to include_gems "activesupport 2.3.5"
|
||||
end
|
||||
|
||||
it "removes groups from with when passed at --without", :bundler => "< 3" do
|
||||
bundle "config --local with debugging"
|
||||
bundle "config set --local with debugging"
|
||||
bundle "install --without debugging", :raise_on_error => false
|
||||
expect(the_bundle).not_to include_gem "thin 1.0"
|
||||
end
|
||||
|
@ -251,13 +251,13 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "has no effect when listing a not optional group in with" do
|
||||
bundle "config --local with emo"
|
||||
bundle "config set --local with emo"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "activesupport 2.3.5"
|
||||
end
|
||||
|
||||
it "has no effect when listing an optional group in without" do
|
||||
bundle "config --local without debugging"
|
||||
bundle "config set --local without debugging"
|
||||
bundle :install
|
||||
expect(the_bundle).not_to include_gems "thin 1.0"
|
||||
end
|
||||
|
@ -275,13 +275,13 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "installs gems in the default group" do
|
||||
bundle "config --local without emo lolercoaster"
|
||||
bundle "config set --local without emo lolercoaster"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||
end
|
||||
|
||||
it "installs the gem if any of its groups are installed" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
|
||||
end
|
||||
|
@ -303,19 +303,19 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "installs the gem unless all groups are excluded" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "activesupport 2.3.5"
|
||||
|
||||
bundle "config --local without lolercoaster"
|
||||
bundle "config set --local without lolercoaster"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "activesupport 2.3.5"
|
||||
|
||||
bundle "config --local without emo lolercoaster"
|
||||
bundle "config set --local without emo lolercoaster"
|
||||
bundle :install
|
||||
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
|
||||
|
||||
bundle "config --local without 'emo lolercoaster'"
|
||||
bundle "config set --local without 'emo lolercoaster'"
|
||||
bundle :install
|
||||
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
|
||||
end
|
||||
|
@ -336,13 +336,13 @@ RSpec.describe "bundle install with groups" do
|
|||
end
|
||||
|
||||
it "installs gems in the default group" do
|
||||
bundle "config --local without emo lolercoaster"
|
||||
bundle "config set --local without emo lolercoaster"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||
end
|
||||
|
||||
it "installs the gem if any of its groups are installed" do
|
||||
bundle "config --local without emo"
|
||||
bundle "config set --local without emo"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
|
||||
end
|
||||
|
@ -380,7 +380,7 @@ RSpec.describe "bundle install with groups" do
|
|||
|
||||
system_gems "rack-0.9.1"
|
||||
|
||||
bundle "config --local without rack"
|
||||
bundle "config set --local without rack"
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo2)}"
|
||||
gem "rack"
|
||||
|
@ -404,7 +404,7 @@ RSpec.describe "bundle install with groups" do
|
|||
|
||||
it "does not hit the remote a second time" do
|
||||
FileUtils.rm_rf gem_repo2
|
||||
bundle "config --local without rack"
|
||||
bundle "config set --local without rack"
|
||||
bundle :install, :verbose => true
|
||||
expect(last_command.stdboth).not_to match(/fetching/i)
|
||||
end
|
||||
|
|
|
@ -131,7 +131,7 @@ RSpec.describe "bundle install with explicit source paths" do
|
|||
gem 'foo', :path => File.expand_path("../foo-1.0", __FILE__)
|
||||
G
|
||||
|
||||
bundle "config --local frozen true"
|
||||
bundle "config set --local frozen true"
|
||||
bundle :install
|
||||
end
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ RSpec.describe "bundle install across platforms" do
|
|||
gem "rack", "1.0.0"
|
||||
G
|
||||
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
|
||||
FileUtils.mv(vendored_gems, bundled_app("vendor/bundle", Gem.ruby_engine, "1.8"))
|
||||
|
|
|
@ -107,7 +107,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
||||
expect(bundled_app("vendor/cache/rack-obama-1.0.gem")).to exist
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install
|
||||
|
||||
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0")
|
||||
|
@ -486,7 +486,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
|||
gem 'bar', '~> 0.1', :source => '#{file_uri_for(gem_repo4)}'
|
||||
G
|
||||
|
||||
bundle "config --local path ../gems/system"
|
||||
bundle "config set --local path ../gems/system"
|
||||
bundle :install
|
||||
|
||||
# And then we add some new versions...
|
||||
|
|
|
@ -80,8 +80,8 @@ RSpec.describe "compact index api" do
|
|||
G
|
||||
bundle :install, :artifice => "compact_index"
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local deployment true"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install, :artifice => "compact_index"
|
||||
expect(out).to include("Fetching gem metadata from #{source_uri}")
|
||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||
|
@ -118,7 +118,7 @@ RSpec.describe "compact index api" do
|
|||
|
||||
bundle :install, :artifice => "compact_index"
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :artifice => "compact_index"
|
||||
|
||||
expect(the_bundle).to include_gems("rails 2.3.2")
|
||||
|
@ -132,7 +132,7 @@ RSpec.describe "compact index api" do
|
|||
G
|
||||
|
||||
bundle "install", :artifice => "compact_index"
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :artifice => "compact_index"
|
||||
|
||||
expect(the_bundle).to include_gems("foo 1.0")
|
||||
|
@ -503,7 +503,7 @@ The checksum of /versions does not match the checksum provided by the server! So
|
|||
G
|
||||
|
||||
bundle :install, :artifice => "compact_index_extra"
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :artifice => "compact_index_extra"
|
||||
expect(the_bundle).to include_gems "back_deps 1.0"
|
||||
end
|
||||
|
|
|
@ -60,8 +60,8 @@ RSpec.describe "gemcutter's dependency API" do
|
|||
G
|
||||
bundle :install, :artifice => "endpoint"
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local deployment true"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install, :artifice => "endpoint"
|
||||
expect(out).to include("Fetching gem metadata from #{source_uri}")
|
||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||
|
@ -98,7 +98,7 @@ RSpec.describe "gemcutter's dependency API" do
|
|||
|
||||
bundle :install, :artifice => "endpoint"
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :artifice => "endpoint"
|
||||
|
||||
expect(the_bundle).to include_gems("rails 2.3.2")
|
||||
|
@ -112,7 +112,7 @@ RSpec.describe "gemcutter's dependency API" do
|
|||
G
|
||||
|
||||
bundle "install", :artifice => "endpoint"
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle :install, :artifice => "endpoint"
|
||||
|
||||
expect(the_bundle).to include_gems("foo 1.0")
|
||||
|
@ -475,7 +475,7 @@ RSpec.describe "gemcutter's dependency API" do
|
|||
|
||||
bundle :install, :artifice => "endpoint_extra"
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
bundle "install", :artifice => "endpoint_extra"
|
||||
expect(the_bundle).to include_gems "back_deps 1.0"
|
||||
end
|
||||
|
|
|
@ -55,7 +55,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "rails"
|
||||
G
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle :install, :standalone => true, :dir => cwd
|
||||
end
|
||||
|
||||
|
@ -71,7 +71,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
|
||||
describe "with gems with native extension", :ruby_repo do
|
||||
before do
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
install_gemfile <<-G, :standalone => true, :dir => cwd
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "very_simple_binary"
|
||||
|
@ -105,7 +105,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
end
|
||||
G
|
||||
end
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
install_gemfile <<-G, :standalone => true, :dir => cwd, :raise_on_error => false
|
||||
gem "bar", :git => "#{lib_path("bar-1.0")}"
|
||||
G
|
||||
|
@ -126,7 +126,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
gem "rails"
|
||||
gem "devise", :git => "#{lib_path("devise-1.0")}"
|
||||
G
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle :install, :standalone => true, :dir => cwd
|
||||
end
|
||||
|
||||
|
@ -154,7 +154,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
gem "rack-test"
|
||||
end
|
||||
G
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle :install, :standalone => true, :dir => cwd
|
||||
end
|
||||
|
||||
|
@ -168,7 +168,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
include_examples "common functionality"
|
||||
|
||||
it "allows creating a standalone file with limited groups" do
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle :install, :standalone => "default", :dir => cwd
|
||||
|
||||
load_error_ruby <<-RUBY, "spec"
|
||||
|
@ -185,8 +185,8 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
end
|
||||
|
||||
it "allows `without` configuration to limit the groups used in a standalone" do
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config --local without test"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local without test"
|
||||
bundle :install, :standalone => true, :dir => cwd
|
||||
|
||||
load_error_ruby <<-RUBY, "spec"
|
||||
|
@ -203,7 +203,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
end
|
||||
|
||||
it "allows `path` configuration to change the location of the standalone bundle" do
|
||||
bundle "config --local path path/to/bundle"
|
||||
bundle "config set --local path path/to/bundle"
|
||||
bundle "install", :standalone => true, :dir => cwd
|
||||
|
||||
ruby <<-RUBY
|
||||
|
@ -218,9 +218,9 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
end
|
||||
|
||||
it "allows `without` to limit the groups used in a standalone" do
|
||||
bundle "config --local without test"
|
||||
bundle "config set --local without test"
|
||||
bundle :install, :dir => cwd
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle :install, :standalone => true, :dir => cwd
|
||||
|
||||
load_error_ruby <<-RUBY, "spec"
|
||||
|
@ -246,7 +246,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
source "#{source_uri}"
|
||||
gem "rails"
|
||||
G
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle :install, :standalone => true, :artifice => "endpoint", :dir => cwd
|
||||
end
|
||||
|
||||
|
@ -267,7 +267,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "rails"
|
||||
G
|
||||
bundle "config --local path #{bundled_app("bundle")}"
|
||||
bundle "config set --local path #{bundled_app("bundle")}"
|
||||
bundle :install, :standalone => true, :binstubs => true, :dir => cwd
|
||||
end
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ RSpec.describe "bundle install" do
|
|||
foo!
|
||||
L
|
||||
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config --local without development"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle "config set --local without development"
|
||||
bundle :install
|
||||
|
||||
expect(out).to include("Bundle complete!")
|
||||
|
|
|
@ -14,14 +14,14 @@ RSpec.describe "bundle install" do
|
|||
end
|
||||
|
||||
it "does not use available system gems with `vendor/bundle" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||
end
|
||||
|
||||
it "uses system gems with `path.system` configured with more priority than `path`" do
|
||||
bundle "config --local path.system true"
|
||||
bundle "config --global path vendor/bundle"
|
||||
bundle "config set --local path.system true"
|
||||
bundle "config set --global path vendor/bundle"
|
||||
bundle :install
|
||||
run "require 'rack'", :raise_on_error => false
|
||||
expect(out).to include("FAIL")
|
||||
|
@ -31,7 +31,7 @@ RSpec.describe "bundle install" do
|
|||
dir = bundled_app("bun++dle")
|
||||
dir.mkpath
|
||||
|
||||
bundle "config --local path #{dir.join("vendor/bundle")}"
|
||||
bundle "config set --local path #{dir.join("vendor/bundle")}"
|
||||
bundle :install, :dir => dir
|
||||
expect(out).to include("installed into `./vendor/bundle`")
|
||||
|
||||
|
@ -39,7 +39,7 @@ RSpec.describe "bundle install" do
|
|||
end
|
||||
|
||||
it "prints a message to let the user know where gems where installed" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
expect(out).to include("gems are installed into `./vendor/bundle`")
|
||||
end
|
||||
|
@ -109,7 +109,7 @@ RSpec.describe "bundle install" do
|
|||
context "when set via #{type}" do
|
||||
it "installs gems to a path if one is specified" do
|
||||
set_bundle_path(type, bundled_app("vendor2").to_s)
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
|
||||
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
|
||||
|
@ -159,7 +159,7 @@ RSpec.describe "bundle install" do
|
|||
end
|
||||
|
||||
it "sets BUNDLE_PATH as the first argument to bundle install" do
|
||||
bundle "config --local path ./vendor/bundle"
|
||||
bundle "config set --local path ./vendor/bundle"
|
||||
bundle :install
|
||||
|
||||
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
|
||||
|
@ -169,7 +169,7 @@ RSpec.describe "bundle install" do
|
|||
it "disables system gems when passing a path to install" do
|
||||
# This is so that vendored gems can be distributed to others
|
||||
build_gem "rack", "1.1.0", :to_system => true
|
||||
bundle "config --local path ./vendor/bundle"
|
||||
bundle "config set --local path ./vendor/bundle"
|
||||
bundle :install
|
||||
|
||||
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
|
||||
|
@ -186,7 +186,7 @@ RSpec.describe "bundle install" do
|
|||
gem "very_simple_binary"
|
||||
G
|
||||
|
||||
bundle "config --local path ./vendor/bundle"
|
||||
bundle "config set --local path ./vendor/bundle"
|
||||
bundle :install
|
||||
|
||||
expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
|
||||
|
@ -198,7 +198,7 @@ RSpec.describe "bundle install" do
|
|||
run "require 'very_simple_binary_c'", :raise_on_error => false
|
||||
expect(err).to include("Bundler::GemNotFound")
|
||||
|
||||
bundle "config --local path ./vendor/bundle"
|
||||
bundle "config set --local path ./vendor/bundle"
|
||||
bundle :install
|
||||
|
||||
expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
|
||||
|
@ -218,7 +218,7 @@ RSpec.describe "bundle install" do
|
|||
gem "rack"
|
||||
G
|
||||
|
||||
bundle "config --local path bundle"
|
||||
bundle "config set --local path bundle"
|
||||
bundle :install, :raise_on_error => false
|
||||
expect(err).to include("file already exists")
|
||||
end
|
||||
|
|
|
@ -1202,7 +1202,7 @@ RSpec.describe "the lockfile format" do
|
|||
gem "omg", :git => "#{lib_path("omg")}", :branch => 'master'
|
||||
G
|
||||
|
||||
bundle "config --local path vendor"
|
||||
bundle "config set --local path vendor"
|
||||
bundle :install
|
||||
expect(the_bundle).to include_gems "omg 1.0"
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ RSpec.describe "bundler plugin install" do
|
|||
gem 'rack', "1.0.0"
|
||||
G
|
||||
|
||||
bundle "config --local deployment true"
|
||||
bundle "config set --local deployment true"
|
||||
install_gemfile <<-G
|
||||
source '#{file_uri_for(gem_repo2)}'
|
||||
plugin 'foo'
|
||||
|
|
|
@ -132,7 +132,7 @@ RSpec.describe "real source plugins" do
|
|||
end
|
||||
|
||||
it "copies repository to vendor cache and uses it even when installed with `path` configured" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
bundle "config set cache_all true"
|
||||
bundle :cache
|
||||
|
@ -144,7 +144,7 @@ RSpec.describe "real source plugins" do
|
|||
end
|
||||
|
||||
it "bundler package copies repository to vendor cache" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
bundle "config set cache_all true"
|
||||
bundle :cache
|
||||
|
|
|
@ -249,7 +249,7 @@ RSpec.describe "The library itself" do
|
|||
end
|
||||
|
||||
it "does not use require internally, but require_relative" do
|
||||
exempt = %r{templates/|man/|vendor/}
|
||||
exempt = %r{templates/|\.5|\.1|vendor/}
|
||||
all_bad_requires = []
|
||||
lib_tracked_files.each do |filename|
|
||||
next if filename =~ exempt
|
||||
|
|
|
@ -12,7 +12,7 @@ RSpec.describe "Bundler.setup" do
|
|||
G
|
||||
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
Bundler.setup
|
||||
|
||||
require 'rack'
|
||||
|
@ -34,7 +34,7 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
it "doesn't make all groups available" do
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
Bundler.setup(:default)
|
||||
|
||||
begin
|
||||
|
@ -49,7 +49,7 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
it "accepts string for group name" do
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
Bundler.setup(:default, 'test')
|
||||
|
||||
require 'rack'
|
||||
|
@ -61,7 +61,7 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
it "leaves all groups available if they were already" do
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
Bundler.setup
|
||||
Bundler.setup(:default)
|
||||
|
||||
|
@ -74,7 +74,7 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
it "leaves :default available if setup is called twice" do
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
Bundler.setup(:default)
|
||||
Bundler.setup(:default, :test)
|
||||
|
||||
|
@ -91,7 +91,7 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
it "handles multiple non-additive invocations" do
|
||||
ruby <<-RUBY, :raise_on_error => false
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
Bundler.setup(:default, :test)
|
||||
Bundler.setup(:default)
|
||||
require 'rack'
|
||||
|
@ -122,7 +122,7 @@ RSpec.describe "Bundler.setup" do
|
|||
ENV["RUBYLIB"] = "rubylib_dir"
|
||||
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
Bundler.setup
|
||||
puts $LOAD_PATH
|
||||
RUBY
|
||||
|
@ -143,6 +143,10 @@ RSpec.describe "Bundler.setup" do
|
|||
gem "rails"
|
||||
G
|
||||
|
||||
# We require an absolute path because relying on the $LOAD_PATH behaves
|
||||
# inconsistently depending on whether we're in a ruby-core setup (and
|
||||
# bundler's lib is in RUBYLIB) or not.
|
||||
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
Bundler.setup
|
||||
|
@ -171,6 +175,10 @@ RSpec.describe "Bundler.setup" do
|
|||
gem "terranova"
|
||||
G
|
||||
|
||||
# We require an absolute path because relying on the $LOAD_PATH behaves
|
||||
# inconsistently depending on whether we're in a ruby-core setup (and
|
||||
# bundler's lib is in RUBYLIB) or not.
|
||||
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler/setup'
|
||||
puts $LOAD_PATH
|
||||
|
@ -192,8 +200,10 @@ RSpec.describe "Bundler.setup" do
|
|||
gem "rack"
|
||||
G
|
||||
|
||||
entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler" : "bundler"
|
||||
|
||||
ruby <<-R
|
||||
require '#{lib_dir}/bundler'
|
||||
require '#{entrypoint}'
|
||||
|
||||
begin
|
||||
Bundler.setup
|
||||
|
@ -213,7 +223,7 @@ RSpec.describe "Bundler.setup" do
|
|||
G
|
||||
|
||||
ruby <<-R, :raise_on_error => false
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
|
||||
Bundler.setup
|
||||
R
|
||||
|
@ -236,7 +246,7 @@ RSpec.describe "Bundler.setup" do
|
|||
G
|
||||
|
||||
ruby <<-R, :raise_on_error => false
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
|
||||
Bundler.setup
|
||||
R
|
||||
|
@ -289,7 +299,7 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
ENV["BUNDLE_GEMFILE"] = "Gemfile"
|
||||
ruby <<-R
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
|
||||
begin
|
||||
Bundler.setup
|
||||
|
@ -444,7 +454,7 @@ RSpec.describe "Bundler.setup" do
|
|||
break_git!
|
||||
|
||||
ruby <<-R
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
|
||||
begin
|
||||
Bundler.setup
|
||||
|
@ -464,8 +474,10 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
break_git!
|
||||
|
||||
entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler" : "bundler"
|
||||
|
||||
ruby <<-R
|
||||
require "#{lib_dir}/bundler"
|
||||
require "#{entrypoint}"
|
||||
|
||||
begin
|
||||
Bundler.setup
|
||||
|
@ -481,14 +493,14 @@ RSpec.describe "Bundler.setup" do
|
|||
end
|
||||
|
||||
it "works even when the cache directory has been deleted" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
FileUtils.rm_rf vendored_gems("cache")
|
||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||
end
|
||||
|
||||
it "does not randomly change the path when specifying --path and the bundle directory becomes read only" do
|
||||
bundle "config --local path vendor/bundle"
|
||||
bundle "config set --local path vendor/bundle"
|
||||
bundle :install
|
||||
|
||||
with_read_only("#{bundled_app}/**/*") do
|
||||
|
@ -592,7 +604,7 @@ RSpec.describe "Bundler.setup" do
|
|||
|
||||
describe "when excluding groups" do
|
||||
it "doesn't change the resolve if --without is used" do
|
||||
bundle "config --local without rails"
|
||||
bundle "config set --local without rails"
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "activesupport"
|
||||
|
@ -608,7 +620,7 @@ RSpec.describe "Bundler.setup" do
|
|||
end
|
||||
|
||||
it "remembers --without and does not bail on bare Bundler.setup" do
|
||||
bundle "config --local without rails"
|
||||
bundle "config set --local without rails"
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "activesupport"
|
||||
|
@ -624,7 +636,7 @@ RSpec.describe "Bundler.setup" do
|
|||
end
|
||||
|
||||
it "remembers --without and does not bail on bare Bundler.setup, even in the case of path gems no longer available" do
|
||||
bundle "config --local without development"
|
||||
bundle "config set --local without development"
|
||||
|
||||
path = bundled_app(File.join("vendor", "foo"))
|
||||
build_lib "foo", :path => path
|
||||
|
@ -644,7 +656,7 @@ RSpec.describe "Bundler.setup" do
|
|||
end
|
||||
|
||||
it "remembers --without and does not include groups passed to Bundler.setup" do
|
||||
bundle "config --local without rails"
|
||||
bundle "config set --local without rails"
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "activesupport"
|
||||
|
@ -798,7 +810,7 @@ end
|
|||
# Don't build extensions.
|
||||
s.class.send(:define_method, :build_extensions) { nil }
|
||||
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
gem '#{gem_name}'
|
||||
|
||||
puts $LOAD_PATH.count {|path| path =~ /#{gem_name}/} >= 2
|
||||
|
@ -1056,7 +1068,7 @@ end
|
|||
bundle "install"
|
||||
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler'
|
||||
require 'bundler'
|
||||
bundler_module = class << Bundler; self; end
|
||||
bundler_module.send(:remove_method, :require)
|
||||
def Bundler.require(path)
|
||||
|
@ -1104,6 +1116,8 @@ end
|
|||
end
|
||||
|
||||
before do
|
||||
bundle "config set --local path.system true"
|
||||
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem "rack"
|
||||
|
@ -1112,8 +1126,9 @@ end
|
|||
|
||||
context "is not present" do
|
||||
it "does not change the lock" do
|
||||
entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler/setup" : "bundler/setup"
|
||||
lockfile lock_with(nil)
|
||||
ruby "require '#{lib_dir}/bundler/setup'"
|
||||
ruby "require '#{entrypoint}'"
|
||||
lockfile_should_be lock_with(nil)
|
||||
end
|
||||
end
|
||||
|
@ -1121,7 +1136,7 @@ end
|
|||
context "is newer" do
|
||||
it "does not change the lock or warn" do
|
||||
lockfile lock_with(Bundler::VERSION.succ)
|
||||
ruby "require '#{lib_dir}/bundler/setup'"
|
||||
ruby "require 'bundler/setup'"
|
||||
expect(out).to be_empty
|
||||
expect(err).to be_empty
|
||||
lockfile_should_be lock_with(Bundler::VERSION.succ)
|
||||
|
@ -1130,8 +1145,10 @@ end
|
|||
|
||||
context "is older" do
|
||||
it "does not change the lock" do
|
||||
entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler/setup" : "bundler/setup"
|
||||
system_gems "bundler-1.10.1"
|
||||
lockfile lock_with("1.10.1")
|
||||
ruby "require '#{lib_dir}/bundler/setup'"
|
||||
ruby "require '#{entrypoint}'"
|
||||
lockfile_should_be lock_with("1.10.1")
|
||||
end
|
||||
end
|
||||
|
@ -1178,14 +1195,14 @@ end
|
|||
|
||||
context "is not present" do
|
||||
it "does not change the lock" do
|
||||
expect { ruby "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
|
||||
expect { ruby "require 'bundler/setup'" }.not_to change { lockfile }
|
||||
end
|
||||
end
|
||||
|
||||
context "is newer" do
|
||||
let(:ruby_version) { "5.5.5" }
|
||||
it "does not change the lock or warn" do
|
||||
expect { ruby "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
|
||||
expect { ruby "require 'bundler/setup'" }.not_to change { lockfile }
|
||||
expect(out).to be_empty
|
||||
expect(err).to be_empty
|
||||
end
|
||||
|
@ -1194,7 +1211,7 @@ end
|
|||
context "is older" do
|
||||
let(:ruby_version) { "1.0.0" }
|
||||
it "does not change the lock" do
|
||||
expect { ruby "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
|
||||
expect { ruby "require 'bundler/setup'" }.not_to change { lockfile }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1202,8 +1219,9 @@ end
|
|||
describe "with gemified standard libraries" do
|
||||
it "does not load Psych" do
|
||||
gemfile ""
|
||||
entrypoint = mis_activates_prerelease_default_bundler? ? "#{lib_dir}/bundler/setup" : "bundler/setup"
|
||||
ruby <<-RUBY
|
||||
require '#{lib_dir}/bundler/setup'
|
||||
require '#{entrypoint}'
|
||||
puts defined?(Psych::VERSION) ? Psych::VERSION : "undefined"
|
||||
require 'psych'
|
||||
puts Psych::VERSION
|
||||
|
@ -1216,7 +1234,7 @@ end
|
|||
it "does not load openssl" do
|
||||
install_gemfile ""
|
||||
ruby <<-RUBY
|
||||
require "#{lib_dir}/bundler/setup"
|
||||
require "bundler/setup"
|
||||
puts defined?(OpenSSL) || "undefined"
|
||||
require "openssl"
|
||||
puts defined?(OpenSSL) || "undefined"
|
||||
|
@ -1274,7 +1292,7 @@ end
|
|||
|
||||
it "activates no gems with -rbundler/setup" do
|
||||
install_gemfile ""
|
||||
ruby code, :env => { "RUBYOPT" => activation_warning_hack_rubyopt + " -r#{lib_dir}/bundler/setup" }
|
||||
ruby code, :env => { "RUBYOPT" => activation_warning_hack_rubyopt + " -rbundler/setup" }
|
||||
expect(out).to eq("{}")
|
||||
end
|
||||
|
||||
|
@ -1327,7 +1345,7 @@ end
|
|||
if File.exist?(ext_folder.join("#{require_name}.rb"))
|
||||
{ :exclude_from_load_path => ext_folder.to_s }
|
||||
else
|
||||
lib_folder = source_root.join("lib")
|
||||
lib_folder = source_lib_dir
|
||||
if File.exist?(lib_folder.join("#{require_name}.rb"))
|
||||
{ :exclude_from_load_path => lib_folder.to_s }
|
||||
else
|
||||
|
@ -1383,7 +1401,7 @@ end
|
|||
G
|
||||
|
||||
ruby <<-RUBY
|
||||
require "#{lib_dir}/bundler/setup"
|
||||
require "bundler/setup"
|
||||
Object.new.gem "rack"
|
||||
puts Gem.loaded_specs["rack"].full_name
|
||||
RUBY
|
||||
|
@ -1398,7 +1416,7 @@ end
|
|||
G
|
||||
|
||||
ruby <<-RUBY, :raise_on_error => false
|
||||
require "#{lib_dir}/bundler/setup"
|
||||
require "bundler/setup"
|
||||
Object.new.gem "rack"
|
||||
puts "FAIL"
|
||||
RUBY
|
||||
|
@ -1414,7 +1432,7 @@ end
|
|||
G
|
||||
|
||||
ruby <<-RUBY, :raise_on_error => false
|
||||
require "#{lib_dir}/bundler/setup"
|
||||
require "bundler/setup"
|
||||
Object.new.require "rack"
|
||||
puts "FAIL"
|
||||
RUBY
|
||||
|
@ -1429,4 +1447,9 @@ end
|
|||
expect(last_command.stdboth).to eq("true")
|
||||
end
|
||||
end
|
||||
|
||||
# Tested rubygems does not include https://github.com/rubygems/rubygems/pull/2728 and will not always end up activating the current bundler
|
||||
def mis_activates_prerelease_default_bundler?
|
||||
Gem.rubygems_version < Gem::Version.new("3.1.a")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,6 +13,7 @@ require "bundler"
|
|||
require "rspec/core"
|
||||
require "rspec/expectations"
|
||||
require "rspec/mocks"
|
||||
require "diff/lcs"
|
||||
|
||||
require_relative "support/builders"
|
||||
require_relative "support/build_metadata"
|
||||
|
|
|
@ -63,6 +63,10 @@ module Spec
|
|||
@spec_dir ||= source_root.join(ruby_core? ? "spec/bundler" : "spec")
|
||||
end
|
||||
|
||||
def man_dir
|
||||
@man_dir ||= lib_dir.join("bundler/man")
|
||||
end
|
||||
|
||||
def tracked_files
|
||||
@tracked_files ||= git_ls_files(tracked_files_glob)
|
||||
end
|
||||
|
@ -236,7 +240,7 @@ module Spec
|
|||
end
|
||||
|
||||
def man_tracked_files_glob
|
||||
ruby_core? ? "man/bundle* man/gemfile*" : "man"
|
||||
ruby_core? ? "man/bundle* man/gemfile*" : "lib/bundler/man/bundle*.1 lib/bundler/man/gemfile*.5"
|
||||
end
|
||||
|
||||
def git_root
|
||||
|
|
|
@ -71,6 +71,26 @@ module Spec
|
|||
install_gems(test_gemfile, test_lockfile)
|
||||
end
|
||||
|
||||
def check_source_control_changes(success_message:, error_message:)
|
||||
require "open3"
|
||||
|
||||
output, status = Open3.capture2e("git status --porcelain")
|
||||
|
||||
if status.success? && output.empty?
|
||||
puts
|
||||
puts success_message
|
||||
puts
|
||||
else
|
||||
system("git status --porcelain")
|
||||
|
||||
puts
|
||||
puts error_message
|
||||
puts
|
||||
|
||||
exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Some rubygems versions include loaded specs when loading gemspec stubs
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "stringio"
|
||||
|
||||
def capture(*args)
|
||||
opts = args.pop if args.last.is_a?(Hash)
|
||||
opts ||= {}
|
||||
|
||||
args.map!(&:to_s)
|
||||
begin
|
||||
result = StringIO.new
|
||||
result.close if opts[:closed]
|
||||
args.each {|stream| eval "$#{stream} = result" }
|
||||
yield
|
||||
ensure
|
||||
args.each {|stream| eval("$#{stream} = #{stream.upcase}") }
|
||||
end
|
||||
result.string
|
||||
end
|
Загрузка…
Ссылка в новой задаче