diff options
author | Tim Moore <tmoore@incrementalism.net> | 2015-02-12 09:56:44 +1100 |
---|---|---|
committer | Tim Moore <tmoore@incrementalism.net> | 2015-02-12 09:56:44 +1100 |
commit | 91633430cb236ef71aaed9707f6c9e7031c11bc1 (patch) | |
tree | c05c0da08e1d6a357ee3896243394c528c48d61a | |
parent | 13f56970165613af53c7ab9b785527da2d98d890 (diff) | |
parent | 96293fe0a0b617030704ff18531f4e01ff60b7a5 (diff) | |
download | bundler-91633430cb236ef71aaed9707f6c9e7031c11bc1.tar.gz |
Merge branch '1-8-stable'
-rw-r--r-- | CHANGELOG.md | 34 | ||||
-rw-r--r-- | lib/bundler/cli/gem.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/install.rb | 2 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 24 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 8 | ||||
-rw-r--r-- | lib/bundler/fetcher.rb | 8 | ||||
-rw-r--r-- | lib/bundler/index.rb | 10 | ||||
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source.rb | 7 | ||||
-rw-r--r-- | lib/bundler/source/local_rubygems.rb | 16 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 32 | ||||
-rw-r--r-- | lib/bundler/source_list.rb | 5 | ||||
-rw-r--r-- | spec/bundler/dsl_spec.rb | 5 | ||||
-rw-r--r-- | spec/bundler/gem_helper_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/source_list_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/dependency_api_spec.rb | 48 | ||||
-rw-r--r-- | spec/support/artifice/endpoint.rb | 10 | ||||
-rw-r--r-- | spec/support/artifice/endpoint_extra_api.rb | 32 | ||||
-rw-r--r-- | spec/support/builders.rb | 113 | ||||
-rw-r--r-- | spec/support/path.rb | 4 |
20 files changed, 274 insertions, 94 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 396d4e03..45538337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +## 1.8.0 (2015-02-10) + +Bugfixes: + + - Gemfile `github` blocks now work (#3379, @indirect) + +Bugfixes from v1.7.13: + + - Look up installed gems in remote sources (#3300, #3368, #3377, #3380, #3381, @indirect) + - Look up gems across all sources to satisfy dependencies (#3365, @keiths-osc) + - Request dependencies for no more than 100 gems at a time (#3367, @segiddins) + +## 1.8.0.rc (2015-01-26) + +Features: + + - add `config disable_multisource` option to ensure sources can't compete (@indirect) + +Bugfixes: + + - don't add extra quotes around long, quoted config values (@aroben, #3338) + +Security: + + - warn when more than one top-level source is present (@indirect) + ## 1.8.0.pre (2015-01-26) Features: @@ -33,6 +59,14 @@ Documentation: - add missing Gemfile global `path` explanation (@agenteo) +## 1.7.13 (2015-02-07) + +Bugfixes: + + - Look up installed gems in remote sources (#3300, #3368, #3377, #3380, #3381, @indirect) + - Look up gems across all sources to satisfy dependencies (#3365, @keiths-osc) + - Request dependencies for no more than 100 gems at a time (#3367, @segiddins) + ## 1.7.12 (2015-01-08) Bugfixes: diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 78b7da52..4694a013 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -20,7 +20,7 @@ module Bundler underscored_name = name.tr('-', '_') namespaced_path = name.tr('-', '/') - constant_name = name.split('_').map{|p| p[0..0].upcase + p[1..-1] }.join + constant_name = name.split('_').map{|p| p[0..0].upcase + p[1..-1] unless p.empty?}.join constant_name = constant_name.split('-').map{|q| q[0..0].upcase + q[1..-1] }.join('::') if constant_name =~ /-/ constant_array = constant_name.split('::') git_user_name = `git config user.name`.chomp diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index ba712a09..43dd40a5 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -104,7 +104,7 @@ module Bundler Bundler.ui.error "You should add a source requirement to restrict this gem to your preferred source." Bundler.ui.error "For example:" Bundler.ui.error " gem '#{name}', :source => '#{installed_from_uri}'" - Bundler.ui.error "Then uninstall the gem '#{name}' (or delete all bundled gems) and install again." + Bundler.ui.error "Then uninstall the gem '#{name}' (or delete all bundled gems) and then install again." end if Bundler.settings[:clean] && Bundler.settings[:path] diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 29b3970b..59f8a69d 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -199,11 +199,11 @@ module Bundler @index ||= Index.build do |idx| dependency_names = @dependencies.map { |d| d.name } - sources.all_sources.each do |s| - s.dependency_names = dependency_names.dup - idx.add_source s.specs - s.specs.each { |spec| dependency_names.delete(spec.name) } - dependency_names.push(*s.unmet_deps).uniq! + sources.all_sources.each do |source| + source.dependency_names = dependency_names.dup + idx.add_source source.specs + dependency_names -= pinned_spec_names(source.specs) + dependency_names.push(*source.unmet_deps).uniq! end end end @@ -599,5 +599,19 @@ module Bundler source_requirements end + def pinned_spec_names(specs) + names = [] + specs.each do |s| + # TODO when two sources without blocks is an error, we can change + # this check to !s.source.is_a?(Source::LocalRubygems). For now, + # we need to ask every Rubygems for every gem name. + if s.source.is_a?(Source::Git) || s.source.is_a?(Source::Path) + names << s.name + end + end + names.uniq! + names + end + end end diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 0440a8c9..9736525a 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -149,8 +149,12 @@ module Bundler with_source(@sources.add_git_source(normalize_hash(options).merge("uri" => uri)), &blk) end - def github(repo, options = {}, &blk) - with_source(@sources.add_git_source(normalize_hash(options).merge("github" => repo)), &blk) + def github(repo, options = {}) + raise ArgumentError, "Github sources require a block" unless block_given? + github_uri = @git_sources["github"].call(repo) + git_options = normalize_hash(options).merge("uri" => github_uri) + git_source = @sources.add_git_source(git_options) + with_source(git_source) { yield } end def to_definition(lockfile, unlock) diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index 552227ba..64c265fb 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -320,10 +320,14 @@ module Bundler # fetch from Gemcutter Dependency Endpoint API def fetch_dependency_remote_specs(gem_names) Bundler.ui.debug "Query Gemcutter Dependency Endpoint API: #{gem_names.join(',')}" - marshalled_deps = fetch dependency_api_uri(gem_names) - gem_list = Bundler.load_marshal(marshalled_deps) + gem_list = [] deps_list = [] + gem_names.each_slice(Source::Rubygems::API_REQUEST_LIMIT) do |names| + marshalled_deps = fetch dependency_api_uri(names) + gem_list += Bundler.load_marshal(marshalled_deps) + end + spec_list = gem_list.map do |s| dependencies = s[:dependencies].map do |name, requirement| dep = well_formed_dependency(name, requirement.split(", ")) diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb index e3c1e83b..8076c685 100644 --- a/lib/bundler/index.rb +++ b/lib/bundler/index.rb @@ -101,13 +101,17 @@ module Bundler # returns a list of the dependencies def unmet_dependency_names - names = [] - each{|s| names.push(*s.dependencies.map{|d| d.name }) } - names.uniq! + names = dependency_names names.delete_if{|n| n == "bundler" } names.select{|n| search(n).empty? } end + def dependency_names + names = [] + each{|s| names.push(*s.dependencies.map{|d| d.name }) } + names.uniq + end + def use(other, override_dupes = false) return unless other other.each do |s| diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index 7c7357a1..07eb6766 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -29,7 +29,7 @@ module Bundler @state = :source @specs = {} - @rubygems_aggregate = Source::Rubygems.new + @rubygems_aggregate = Source::LocalRubygems.new if lockfile.match(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/) raise LockfileError, "Your Gemfile.lock contains merge conflicts.\n" \ diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index d1fd35a3..ace319d6 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -1,8 +1,9 @@ module Bundler class Source - autoload :Rubygems, 'bundler/source/rubygems' - autoload :Path, 'bundler/source/path' - autoload :Git, 'bundler/source/git' + autoload :Rubygems, 'bundler/source/rubygems' + autoload :LocalRubygems, 'bundler/source/local_rubygems' + autoload :Path, 'bundler/source/path' + autoload :Git, 'bundler/source/git' def self.mirror_for(uri) uri = URI(uri.to_s) unless uri.is_a?(URI) diff --git a/lib/bundler/source/local_rubygems.rb b/lib/bundler/source/local_rubygems.rb new file mode 100644 index 00000000..40f072f3 --- /dev/null +++ b/lib/bundler/source/local_rubygems.rb @@ -0,0 +1,16 @@ +module Bundler + class Source + class LocalRubygems < Rubygems + + def specs + @specs ||= begin + idx = super + idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote + idx.use(installed_specs, :override_dupes) + idx + end + end + + end + end +end diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index a888fd0f..a769ee69 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -5,7 +5,8 @@ require 'rubygems/spec_fetcher' module Bundler class Source class Rubygems < Source - API_REQUEST_LIMIT = 100 # threshold for switching back to the modern index instead of fetching every spec + # threshold for switching back to the modern index instead of fetching every spec + API_REQUEST_LIMIT = 100 attr_reader :remotes, :caches @@ -65,15 +66,10 @@ module Bundler alias_method :name, :to_s def specs - @specs ||= begin - # remote_specs usually generates a way larger Index than the other - # sources, and large_idx.use small_idx is way faster than - # small_idx.use large_idx. - idx = @allow_remote ? remote_specs.dup : Index.new - idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote - idx.use(installed_specs, :override_dupes) - idx - end + # remote_specs usually generates a way larger Index than the other + # sources, and large_idx.use small_idx is way faster than + # small_idx.use large_idx. + @specs ||= @allow_remote ? remote_specs.dup : Index.new end def install(spec) @@ -309,6 +305,20 @@ module Bundler Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over end + # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both + # sources A and B. At this point, the API request will have found all the versions of Bar in source A, + # but will not have found any versions of Bar from source B, which is a problem if the requested version + # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for + # each spec we found, we add all possible versions from all sources to the index. + begin + idxcount = idx.size + api_fetchers.each do |f| + Bundler.ui.info "Fetching version metadata from #{f.uri}", Bundler.ui.debug? + idx.use f.specs(idx.dependency_names, self), true + Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over + end + end until idxcount == idx.size + if api_fetchers.any? && api_fetchers.all?{|f| f.use_api } # it's possible that gems from one source depend on gems from some # other source, so now we download gemspecs and iterate over those @@ -317,7 +327,7 @@ module Bundler # if there are any cross-site gems we missed, get them now api_fetchers.each do |f| - Bundler.ui.info "Fetching additional metadata from #{f.uri}", Bundler.ui.debug? + Bundler.ui.info "Fetching dependency metadata from #{f.uri}", Bundler.ui.debug? idx.use f.specs(unmet, self) Bundler.ui.info "" if !Bundler.ui.debug? # new line now that the dots are over end if unmet.any? diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb index 49efbf7a..4329749e 100644 --- a/lib/bundler/source_list.rb +++ b/lib/bundler/source_list.rb @@ -6,7 +6,7 @@ module Bundler def initialize @path_sources = [] @git_sources = [] - @rubygems_aggregate = Source::Rubygems.new + @rubygems_aggregate = Source::LocalRubygems.new @rubygems_sources = [] end @@ -57,8 +57,7 @@ module Bundler end end - replacement_rubygems = - replacement_sources.detect { |s| s.is_a?(Source::Rubygems) } + replacement_rubygems = replacement_sources.detect { |s| s.is_a?(Source::LocalRubygems) } @rubygems_aggregate = replacement_rubygems if replacement_rubygems # Return true if there were changes diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index c2387637..e3ff2306 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -165,7 +165,10 @@ describe Bundler::Dsl do subject.github "spree" do spree_gems.each { |spree_gem| subject.send :gem, spree_gem } end - expect(subject.dependencies.map(&:name)).to match_array spree_gems + + subject.dependencies.each do |d| + expect(d.source.uri).to eq("git://github.com/spree/spree.git") + end end end end diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index f94dac6a..d605f2e7 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -3,7 +3,7 @@ require 'rake' require 'bundler/gem_helper' describe Bundler::GemHelper do - let(:app_name) { "test" } + let(:app_name) { "lorem__ipsum" } let(:app_path) { bundled_app app_name } let(:app_gemspec_path) { app_path.join("#{app_name}.gemspec") } @@ -43,7 +43,7 @@ describe Bundler::GemHelper do app_path = bundled_app "#{app_name}-foo_bar" lib = app_path.join("lib/#{app_name}/foo_bar.rb").read - expect(lib).to include("module #{app_name.capitalize}") + expect(lib).to include("module LoremIpsum") expect(lib).to include("module FooBar") end end diff --git a/spec/bundler/source_list_spec.rb b/spec/bundler/source_list_spec.rb index f5a8575a..b3e18863 100644 --- a/spec/bundler/source_list_spec.rb +++ b/spec/bundler/source_list_spec.rb @@ -91,7 +91,7 @@ describe Bundler::SourceList do end it "returns the aggregate rubygems source" do - expect(@returned_source).to be_instance_of(Bundler::Source::Rubygems) + expect(@returned_source).to be_instance_of(Bundler::Source::LocalRubygems) end it "adds the provided remote to the beginning of the aggregate source" do diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index d0c769e0..7f20039e 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -260,6 +260,52 @@ describe "gemcutter's dependency API" do should_be_installed "back_deps 1.0" end + it "fetches gem versions even when those gems are already installed" do + gemfile <<-G + source "#{source_uri}" + gem "rack", "1.0.0" + G + bundle :install, :artifice => "endpoint_extra_api" + + build_repo4 do + build_gem "rack", "1.2" do |s| + s.executables = "rackup" + end + end + + gemfile <<-G + source "#{source_uri}" do; end + source "#{source_uri}/extra" + gem "rack", "1.2" + G + bundle :install, :artifice => "endpoint_extra_api" + should_be_installed "rack 1.2" + end + + it "considers all possible versions of dependencies from all api gem sources" do + # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that + # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0 + # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other + # repo and installs it. + build_repo4 do + build_gem "activesupport", "1.2.0" + build_gem "somegem", "1.0.0" do |s| + s.add_dependency "activesupport", "1.2.3" #This version exists only in repo1 + end + end + + gemfile <<-G + source "#{source_uri}" + source "#{source_uri}/extra" + gem 'somegem', '1.0.0' + G + + bundle :install, :artifice => "endpoint_extra_api" + + should_be_installed "somegem 1.0.0" + should_be_installed "activesupport 1.2.3" + end + it "prints API output properly with back deps" do build_repo2 do build_gem "back_deps" do |s| @@ -280,7 +326,7 @@ describe "gemcutter's dependency API" do expect(out).to include("Fetching source index from http://localgemserver.test/extra") end - it "does not fetch every specs if the index of gems is large when doing back deps" do + it "does not fetch every spec if the index of gems is large when doing back deps" do build_repo2 do build_gem "back_deps" do |s| s.add_dependency "foo" diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb index 68b41b75..adff4a7b 100644 --- a/spec/support/artifice/endpoint.rb +++ b/spec/support/artifice/endpoint.rb @@ -14,14 +14,14 @@ require 'sinatra/base' class Endpoint < Sinatra::Base helpers do - def dependencies_for(gem_names, marshal = gem_repo1("specs.4.8")) + def dependencies_for(gem_names, gem_repo = gem_repo1) return [] if gem_names.nil? || gem_names.empty? require 'rubygems' require 'bundler' Bundler::Deprecate.skip_during do - Marshal.load(File.open(marshal).read).map do |name, version, platform| - spec = load_spec(name, version, platform) + Marshal.load(File.open(gem_repo.join("specs.4.8")).read).map do |name, version, platform| + spec = load_spec(name, version, platform, gem_repo) if gem_names.include?(spec.name) { :name => spec.name, @@ -36,10 +36,10 @@ class Endpoint < Sinatra::Base end end - def load_spec(name, version, platform) + def load_spec(name, version, platform, gem_repo) full_name = "#{name}-#{version}" full_name += "-#{platform}" if platform != "ruby" - Marshal.load(Gem.inflate(File.open(gem_repo1("quick/Marshal.4.8/#{full_name}.gemspec.rz")).read)) + Marshal.load(Gem.inflate(File.open(gem_repo.join("quick/Marshal.4.8/#{full_name}.gemspec.rz")).read)) end end diff --git a/spec/support/artifice/endpoint_extra_api.rb b/spec/support/artifice/endpoint_extra_api.rb new file mode 100644 index 00000000..d6d1c5a1 --- /dev/null +++ b/spec/support/artifice/endpoint_extra_api.rb @@ -0,0 +1,32 @@ +require File.expand_path("../endpoint", __FILE__) + +Artifice.deactivate + +class EndpointExtraApi < Endpoint + get "/extra/api/v1/dependencies" do + deps = dependencies_for(params[:gems], gem_repo4) + Marshal.dump(deps) + end + + get "/extra/specs.4.8.gz" do + File.read("#{gem_repo4}/specs.4.8.gz") + end + + get "/extra/prerelease_specs.4.8.gz" do + File.read("#{gem_repo4}/prerelease_specs.4.8.gz") + end + + get "/extra/quick/Marshal.4.8/:id" do + redirect "/extra/fetch/actual/gem/#{params[:id]}" + end + + get "/extra/fetch/actual/gem/:id" do + File.read("#{gem_repo4}/quick/Marshal.4.8/#{params[:id]}") + end + + get "/extra/gems/:id" do + File.read("#{gem_repo4}/gems/#{params[:id]}") + end +end + +Artifice.activate_with(EndpointExtraApi) diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 896228d1..dadaa731 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -260,6 +260,14 @@ module Spec FileUtils.rm_rf Dir[gem_repo3("prerelease*")] end + # A repo that has no pre-installed gems included. (The caller completely determines the contents with the block) + def build_repo4(&blk) + FileUtils.rm_rf gem_repo4 + build_repo(gem_repo4) do + yield if block_given? + end + end + def update_repo2 update_repo gem_repo2 do build_gem "rack", "1.2" do |s| @@ -625,57 +633,58 @@ module Spec end end - TEST_CERT = <<CERT ------BEGIN CERTIFICATE----- -MIIDMjCCAhqgAwIBAgIBATANBgkqhkiG9w0BAQUFADAnMQwwCgYDVQQDDAN5b3Ux -FzAVBgoJkiaJk/IsZAEZFgdleGFtcGxlMB4XDTE0MDIwNTE0MTEwNloXDTE1MDIw -NTE0MTEwNlowJzEMMAoGA1UEAwwDeW91MRcwFQYKCZImiZPyLGQBGRYHZXhhbXBs -ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANlvFdpN43c4DMS9Jo06 -m0a7k3bQ3HWQ1yrYhZMi77F1F73NpBknYHIzDktQpGn6hs/4QFJT4m4zNEBF47UL -jHU5nTK5rjkS3niGYUjvh3ZEzVeo9zHUlD/UwflDo4ALl3TSo2KY/KdPS/UTdLXL -ajkQvaVJtEDgBPE3DPhlj5whp+Ik3mDHej7qpV6F502leAwYaFyOtlEG/ZGNG+nZ -L0clH0j77HpP42AylHDi+vakEM3xcjo9BeWQ6Vkboic93c9RTt6CWBWxMQP7Nol1 -MOebz9XOSQclxpxWteXNfPRtMdAhmRl76SMI8ywzThNPpa4EH/yz34ftebVOgKyM -nd0CAwEAAaNpMGcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFA7D -n9qo0np23qi3aOYuAAPn/5IdMBYGA1UdEQQPMA2BC3lvdUBleGFtcGxlMBYGA1Ud -EgQPMA2BC3lvdUBleGFtcGxlMA0GCSqGSIb3DQEBBQUAA4IBAQB5N+71KiNX3k0Y -FWizUHUYOqo+fEk3aBoFbOFcx+M5TXPiA91pH8mgyyD9tVzqiYgCGk7g/UrOv5Ec -NHjYqsFecNPayj8u2Po07pp2Nbc9aqt9uxoRSENZ72Dzrk3YDStgji7Sk/LZW5Kn -4JFTeRof+B7/ZijLZWBEnMfSHSIPaQu0Ig6c19OEhiiuhGOn4WUhGFYCadciKgnj -PtaUcxKuvXMwRPG3NZqeGZivTlrhAmmf7iPV/E334qzMytvAV8zycZFj2J5hvyLk -432zLezmbFGc0uLIUjXDu9bM5WYGy1BOTuzuApyuCs9S1greqz17f8f01J87DX3X -wJsshs4b ------END CERTIFICATE----- -CERT - - TEST_PKEY = <<PKEY ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA2W8V2k3jdzgMxL0m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XUyQ6KnZrG2ih90xQ8+iMyqFOIm/52R2fFKNrdoWoALC6E3ct8+ZS -pMRLrelFXx8K3it4SwMJR2H8XBEfFW4bH0UtsW7Zafv+AunUs9LETP5gKG1LgXsq -qgXX43yy2LQ61O365YPZfdUCgYBVbTvA3MhARbvYldrFEnUL3GtfZbNgdxuD9Mee -xig0eJMBIrgfBLuOlqtVB70XYnM4xAbKCso4loKSHnofO1N99siFkRlM2JOUY2tz -kMWZmmxKdFjuF0WZ5f/5oYxI/QsFGC+rUQEbbWl56mMKd5qkvEhKWudxoklF0yiV -ufC8SwKBgDWb8iWqWN5a/kfvKoxFcDM74UHk/SeKMGAL+ujKLf58F+CbweM5pX9C -EUsxeoUEraVWTiyFVNqD81rCdceus9TdBj0ZIK1vUttaRZyrMAwF0uQSfjtxsOpd -l69BkyvzjgDPkmOHVGiSZDLi3YDvypbUpo6LOy4v5rVg5U2F/A0v ------END RSA PRIVATE KEY----- -PKEY + TEST_CERT = <<-CERT.gsub /^\s*/, '' + -----BEGIN CERTIFICATE----- + MIIDMjCCAhqgAwIBAgIBATANBgkqhkiG9w0BAQUFADAnMQwwCgYDVQQDDAN5b3Ux + FzAVBgoJkiaJk/IsZAEZFgdleGFtcGxlMB4XDTE1MDIwODAwMTIyM1oXDTQyMDYy + NTAwMTIyM1owJzEMMAoGA1UEAwwDeW91MRcwFQYKCZImiZPyLGQBGRYHZXhhbXBs + ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANlvFdpN43c4DMS9Jo06 + m0a7k3bQ3HWQ1yrYhZMi77F1F73NpBknYHIzDktQpGn6hs/4QFJT4m4zNEBF47UL + jHU5nTK5rjkS3niGYUjvh3ZEzVeo9zHUlD/UwflDo4ALl3TSo2KY/KdPS/UTdLXL + ajkQvaVJtEDgBPE3DPhlj5whp+Ik3mDHej7qpV6F502leAwYaFyOtlEG/ZGNG+nZ + L0clH0j77HpP42AylHDi+vakEM3xcjo9BeWQ6Vkboic93c9RTt6CWBWxMQP7Nol1 + MOebz9XOSQclxpxWteXNfPRtMdAhmRl76SMI8ywzThNPpa4EH/yz34ftebVOgKyM + nd0CAwEAAaNpMGcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFA7D + n9qo0np23qi3aOYuAAPn/5IdMBYGA1UdEQQPMA2BC3lvdUBleGFtcGxlMBYGA1Ud + EgQPMA2BC3lvdUBleGFtcGxlMA0GCSqGSIb3DQEBBQUAA4IBAQA7Gyk62sWOUX/N + vk4tJrgKESph6Ns8+E36A7n3jt8zCep8ldzMvwTWquf9iqhsC68FilEoaDnUlWw7 + d6oNuaFkv7zfrWGLlvqQJC+cu2X5EpcCksg5oRp8VNbwJysJ6JgwosxzROII8eXc + R+j1j6mDvQYqig2QOnzf480pjaqbP+tspfDFZbhKPrgM3Blrb3ZYuFpv4zkqI7aB + 6fuk2DUhNO1CuwrJA84TqC+jGo73bDKaT5hrIDiaJRrN5+zcWja2uEWrj5jSbep4 + oXdEdyH73hOHMBP40uds3PqnUsxEJhzjB2sCCe1geV24kw9J4m7EQXPVkUKDgKrt + LlpDmOoo + -----END CERTIFICATE----- + CERT + + TEST_PKEY = <<-PKEY.gsub /^\s*/, '' + -----BEGIN RSA PRIVATE KEY----- + MIIEowIBAAKCAQEA2W8V2k3jdzgMxL0mjTqbRruTdtDcdZDXKtiFkyLvsXUXvc2k + GSdgcjMOS1CkafqGz/hAUlPibjM0QEXjtQuMdTmdMrmuORLeeIZhSO+HdkTNV6j3 + MdSUP9TB+UOjgAuXdNKjYpj8p09L9RN0tctqORC9pUm0QOAE8TcM+GWPnCGn4iTe + YMd6PuqlXoXnTaV4DBhoXI62UQb9kY0b6dkvRyUfSPvsek/jYDKUcOL69qQQzfFy + Oj0F5ZDpWRuiJz3dz1FO3oJYFbExA/s2iXUw55vP1c5JByXGnFa15c189G0x0CGZ + GXvpIwjzLDNOE0+lrgQf/LPfh+15tU6ArIyd3QIDAQABAoIBACbDqz20TS1gDMa2 + gj0D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f58F+CbweM5pX9C + EUsxeoUEraVWTiyFVNqD81rCdceus9TdBj0ZIK1vUttaRZyrMAwF0uQSfjtxsOpd + l69BkyvzjgDPkmOHVGiSZDLi3YDvypbUpo6LOy4v5rVg5U2F/A0v + -----END RSA PRIVATE KEY----- + PKEY + end end diff --git a/spec/support/path.rb b/spec/support/path.rb index 74dbd891..56e8dd8b 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -60,6 +60,10 @@ module Spec tmp("gems/remote3", *args) end + def gem_repo4(*args) + tmp("gems/remote4", *args) + end + def security_repo(*args) tmp("gems/security_repo", *args) end |