lib/bundler/definition.rb in bundler-1.14.4 vs lib/bundler/definition.rb in bundler-1.14.5

- old
+ new

@@ -102,11 +102,11 @@ end @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version) add_current_platform unless Bundler.settings[:frozen] - converge_gemspec_sources + converge_path_sources_to_gemspec_sources @path_changes = converge_paths @source_changes = converge_sources unless @unlock[:lock_shared_dependencies] eager_unlock = expand_dependencies(@unlock[:gems]) @@ -460,16 +460,17 @@ gemfile_source_name = (dep && dep.source) || "no specified source" lockfile_source_name = lock_source || "no specified source" changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`" end + msg << "\n\n#{change_reason.split(", ").join("\n")}\n" msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any? msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any? msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any? msg << "\n" - raise ProductionError, msg if added.any? || deleted.any? || changed.any? + raise ProductionError, msg if added.any? || deleted.any? || changed.any? || !nothing_changed? end def validate_runtime! validate_ruby! validate_platforms! @@ -590,11 +591,12 @@ def specs_for_source_changed?(source) locked_index = Index.new locked_index.use(@locked_specs.select {|s| source.can_lock?(s) }) - source.specs != locked_index + # order here matters, since Index#== is checking source.specs.include?(locked_index) + locked_index != source.specs end # Get all locals and override their matching sources. # Return true if any of the locals changed (for example, # they point to a new revision) or depend on new specs. @@ -626,11 +628,11 @@ return source unless source.instance_of?(Source::Path) gemspec_source = sources.path_sources.find {|s| s.is_a?(Source::Gemspec) && s.as_path_source == source } gemspec_source || source end - def converge_gemspec_sources + def converge_path_sources_to_gemspec_sources @locked_sources.map! do |source| converge_path_source_to_gemspec_source(source) end @locked_specs.each do |spec| spec.source &&= converge_path_source_to_gemspec_source(spec.source) @@ -748,11 +750,12 @@ # If the spec is no longer in the path source, unlock it. This # commonly happens if the version changed in the gemspec next unless other deps2 = other.dependencies.select {|d| d.type != :development } + runtime_dependencies = s.dependencies.select {|d| d.type != :development } # If the dependencies of the path source have changed, unlock it - next unless s.dependencies.sort == deps2.sort + next unless runtime_dependencies.sort == deps2.sort end converged << s end