From 938e30d373f98750e9f5cb3c7f341e69d64494aa Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Sat, 23 Aug 2014 18:18:27 -0500 Subject: Sort sources in lock the same as in 1.6 --- lib/bundler/source/path.rb | 2 +- lib/bundler/source/rubygems.rb | 1 + lib/bundler/source_list.rb | 3 ++- spec/bundler/source_list_spec.rb | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index c80ac61f46..398ed6025a 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -103,7 +103,7 @@ module Bundler name end - private + private def expand(somepath) somepath.expand_path(Bundler.root) diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 635bb993ad..f3b8b7c83b 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -344,6 +344,7 @@ module Bundler def remotes_equal?(other_remotes) remotes.map(&method(:suppress_configured_credentials)) == other_remotes.map(&method(:suppress_configured_credentials)) end + end end end diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb index 4f537c4a2b..0d9fb516c8 100644 --- a/lib/bundler/source_list.rb +++ b/lib/bundler/source_list.rb @@ -37,7 +37,8 @@ module Bundler end def lock_sources - (path_sources + git_sources) << combine_rubygems_sources + lock_sources = (path_sources + git_sources).sort_by(&:to_s) + lock_sources << combine_rubygems_sources end def replace_sources!(replacement_sources) diff --git a/spec/bundler/source_list_spec.rb b/spec/bundler/source_list_spec.rb index e74337f64e..67d4ef6a45 100644 --- a/spec/bundler/source_list_spec.rb +++ b/spec/bundler/source_list_spec.rb @@ -291,12 +291,12 @@ describe Bundler::SourceList do source_list.add_git_source('uri' => 'git://first-git.org/path.git') expect(source_list.lock_sources).to eq [ - Bundler::Source::Path.new('path' => '/first/path/to/gem'), - Bundler::Source::Path.new('path' => '/second/path/to/gem'), - Bundler::Source::Path.new('path' => '/third/path/to/gem'), Bundler::Source::Git.new('uri' => 'git://first-git.org/path.git'), Bundler::Source::Git.new('uri' => 'git://second-git.org/path.git'), Bundler::Source::Git.new('uri' => 'git://third-git.org/path.git'), + Bundler::Source::Path.new('path' => '/first/path/to/gem'), + Bundler::Source::Path.new('path' => '/second/path/to/gem'), + Bundler::Source::Path.new('path' => '/third/path/to/gem'), Bundler::Source::Rubygems.new('remotes' => [ 'https://first-rubygems.org', 'https://second-rubygems.org', -- cgit v1.2.1