summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-08-23 18:18:27 -0500
committerAndre Arko <andre@arko.net>2014-08-23 22:13:38 -0500
commit938e30d373f98750e9f5cb3c7f341e69d64494aa (patch)
tree156df42e87dfddc3062fdda29c7c3a008ae986e1
parent3cfb807b5d4fe4d940670983258ff017deedc2d5 (diff)
downloadbundler-938e30d373f98750e9f5cb3c7f341e69d64494aa.tar.gz
Sort sources in lock the same as in 1.6
-rw-r--r--lib/bundler/source/path.rb2
-rw-r--r--lib/bundler/source/rubygems.rb1
-rw-r--r--lib/bundler/source_list.rb3
-rw-r--r--spec/bundler/source_list_spec.rb6
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',