summaryrefslogtreecommitdiff
path: root/lib/bundler/definition.rb
diff options
context:
space:
mode:
authorAdrian Gomez <adri4n.steam@gmail.com>2017-05-12 12:36:48 -0300
committerAdrian Gomez <adri4n.steam@gmail.com>2017-08-02 21:22:45 -0300
commitc9c4f23e46673ac953b34774934447c779b25e0b (patch)
tree3b89eac6efc87629aa60e388f0fc3594a83bcf6d /lib/bundler/definition.rb
parent92f7781eda8e429a189c1d2ebc642ec4f8febdbf (diff)
downloadbundler-c9c4f23e46673ac953b34774934447c779b25e0b.tar.gz
Allow to add username and password to a remote during a deployment
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r--lib/bundler/definition.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 6726cf95e8..27e7172bcc 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -407,8 +407,8 @@ module Bundler
# Check if it is possible that the source is only changed thing
if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
- new_sources.reject! {|source| source.is_a_path? && source.path.exist? }
- deleted_sources.reject! {|source| source.is_a_path? && source.path.exist? }
+ new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
+ deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
end
if @locked_sources != gemfile_sources
@@ -636,7 +636,7 @@ module Bundler
if !locked_gem_sources.empty? && !actual_remotes.empty?
locked_gem_sources.each do |locked_gem|
# Merge the remotes from the Gemfile into the Gemfile.lock
- changes |= locked_gem.replace_remotes(actual_remotes)
+ changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
end
end
@@ -964,5 +964,11 @@ module Bundler
requirements
end.values
end
+
+ def equivalent_rubygems_remotes?(source)
+ return false unless source.is_a?(Source::Rubygems)
+
+ Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
+ end
end
end