shopify-bundler 1.10.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +96 -0
  5. data/.rubocop_todo.yml +177 -0
  6. data/.travis.yml +104 -0
  7. data/CHANGELOG.md +2131 -0
  8. data/CODE_OF_CONDUCT.md +42 -0
  9. data/CONTRIBUTING.md +32 -0
  10. data/DEVELOPMENT.md +118 -0
  11. data/ISSUES.md +96 -0
  12. data/LICENSE.md +23 -0
  13. data/README.md +40 -0
  14. data/Rakefile +309 -0
  15. data/bin/rake +14 -0
  16. data/bin/rspec +10 -0
  17. data/bin/rubocop +11 -0
  18. data/bundler.gemspec +34 -0
  19. data/exe/bundle +21 -0
  20. data/exe/bundle_ruby +60 -0
  21. data/exe/bundler +21 -0
  22. data/lib/bundler.rb +499 -0
  23. data/lib/bundler/capistrano.rb +16 -0
  24. data/lib/bundler/cli.rb +435 -0
  25. data/lib/bundler/cli/binstubs.rb +37 -0
  26. data/lib/bundler/cli/cache.rb +34 -0
  27. data/lib/bundler/cli/check.rb +37 -0
  28. data/lib/bundler/cli/clean.rb +25 -0
  29. data/lib/bundler/cli/common.rb +56 -0
  30. data/lib/bundler/cli/config.rb +88 -0
  31. data/lib/bundler/cli/console.rb +37 -0
  32. data/lib/bundler/cli/exec.rb +51 -0
  33. data/lib/bundler/cli/gem.rb +208 -0
  34. data/lib/bundler/cli/init.rb +32 -0
  35. data/lib/bundler/cli/inject.rb +32 -0
  36. data/lib/bundler/cli/install.rb +188 -0
  37. data/lib/bundler/cli/lock.rb +35 -0
  38. data/lib/bundler/cli/open.rb +22 -0
  39. data/lib/bundler/cli/outdated.rb +86 -0
  40. data/lib/bundler/cli/package.rb +45 -0
  41. data/lib/bundler/cli/platform.rb +42 -0
  42. data/lib/bundler/cli/show.rb +74 -0
  43. data/lib/bundler/cli/update.rb +72 -0
  44. data/lib/bundler/cli/viz.rb +26 -0
  45. data/lib/bundler/constants.rb +5 -0
  46. data/lib/bundler/current_ruby.rb +218 -0
  47. data/lib/bundler/definition.rb +675 -0
  48. data/lib/bundler/dep_proxy.rb +45 -0
  49. data/lib/bundler/dependency.rb +119 -0
  50. data/lib/bundler/deployment.rb +62 -0
  51. data/lib/bundler/deprecate.rb +17 -0
  52. data/lib/bundler/dsl.rb +478 -0
  53. data/lib/bundler/endpoint_specification.rb +100 -0
  54. data/lib/bundler/env.rb +82 -0
  55. data/lib/bundler/environment.rb +41 -0
  56. data/lib/bundler/fetcher.rb +288 -0
  57. data/lib/bundler/fetcher/base.rb +26 -0
  58. data/lib/bundler/fetcher/dependency.rb +88 -0
  59. data/lib/bundler/fetcher/downloader.rb +60 -0
  60. data/lib/bundler/fetcher/index.rb +32 -0
  61. data/lib/bundler/friendly_errors.rb +92 -0
  62. data/lib/bundler/gem_helper.rb +191 -0
  63. data/lib/bundler/gem_helpers.rb +26 -0
  64. data/lib/bundler/gem_installer.rb +9 -0
  65. data/lib/bundler/gem_path_manipulation.rb +8 -0
  66. data/lib/bundler/gem_tasks.rb +5 -0
  67. data/lib/bundler/graph.rb +173 -0
  68. data/lib/bundler/index.rb +199 -0
  69. data/lib/bundler/injector.rb +62 -0
  70. data/lib/bundler/inline.rb +58 -0
  71. data/lib/bundler/installer.rb +242 -0
  72. data/lib/bundler/installer/parallel_installer.rb +122 -0
  73. data/lib/bundler/installer/standalone.rb +48 -0
  74. data/lib/bundler/lazy_specification.rb +82 -0
  75. data/lib/bundler/lockfile_parser.rb +199 -0
  76. data/lib/bundler/match_platform.rb +13 -0
  77. data/lib/bundler/psyched_yaml.rb +26 -0
  78. data/lib/bundler/remote_specification.rb +82 -0
  79. data/lib/bundler/resolver.rb +350 -0
  80. data/lib/bundler/retry.rb +60 -0
  81. data/lib/bundler/ruby_dsl.rb +11 -0
  82. data/lib/bundler/ruby_version.rb +116 -0
  83. data/lib/bundler/rubygems_ext.rb +175 -0
  84. data/lib/bundler/rubygems_integration.rb +674 -0
  85. data/lib/bundler/runtime.rb +285 -0
  86. data/lib/bundler/settings.rb +263 -0
  87. data/lib/bundler/setup.rb +26 -0
  88. data/lib/bundler/shared_helpers.rb +176 -0
  89. data/lib/bundler/similarity_detector.rb +61 -0
  90. data/lib/bundler/source.rb +35 -0
  91. data/lib/bundler/source/git.rb +286 -0
  92. data/lib/bundler/source/git/git_proxy.rb +190 -0
  93. data/lib/bundler/source/path.rb +224 -0
  94. data/lib/bundler/source/path/installer.rb +43 -0
  95. data/lib/bundler/source/rubygems.rb +436 -0
  96. data/lib/bundler/source/rubygems/remote.rb +38 -0
  97. data/lib/bundler/source_list.rb +101 -0
  98. data/lib/bundler/spec_set.rb +156 -0
  99. data/lib/bundler/ssl_certs/.document +1 -0
  100. data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +25 -0
  101. data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +32 -0
  102. data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +14 -0
  103. data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +23 -0
  104. data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +28 -0
  105. data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +20 -0
  106. data/lib/bundler/ssl_certs/certificate_manager.rb +64 -0
  107. data/lib/bundler/stub_specification.rb +23 -0
  108. data/lib/bundler/templates/Executable +16 -0
  109. data/lib/bundler/templates/Executable.standalone +12 -0
  110. data/lib/bundler/templates/Gemfile +4 -0
  111. data/lib/bundler/templates/newgem/.travis.yml.tt +4 -0
  112. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +22 -0
  113. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  114. data/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  115. data/lib/bundler/templates/newgem/README.md.tt +41 -0
  116. data/lib/bundler/templates/newgem/Rakefile.tt +29 -0
  117. data/lib/bundler/templates/newgem/bin/console.tt +14 -0
  118. data/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  119. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  120. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
  121. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  122. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  123. data/lib/bundler/templates/newgem/gitignore.tt +16 -0
  124. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
  125. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  126. data/lib/bundler/templates/newgem/newgem.gemspec.tt +43 -0
  127. data/lib/bundler/templates/newgem/rspec.tt +2 -0
  128. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
  129. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  130. data/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
  131. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
  132. data/lib/bundler/ui.rb +7 -0
  133. data/lib/bundler/ui/rg_proxy.rb +17 -0
  134. data/lib/bundler/ui/shell.rb +108 -0
  135. data/lib/bundler/ui/silent.rb +44 -0
  136. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -0
  137. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +277 -0
  138. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -0
  139. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +3 -0
  140. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +99 -0
  141. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +63 -0
  142. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +434 -0
  143. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +43 -0
  144. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +51 -0
  145. data/lib/bundler/vendor/net/http/faster.rb +26 -0
  146. data/lib/bundler/vendor/net/http/persistent.rb +1230 -0
  147. data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +128 -0
  148. data/lib/bundler/vendor/thor/lib/thor.rb +484 -0
  149. data/lib/bundler/vendor/thor/lib/thor/actions.rb +319 -0
  150. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +103 -0
  151. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +59 -0
  152. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
  153. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +135 -0
  154. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +316 -0
  155. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +107 -0
  156. data/lib/bundler/vendor/thor/lib/thor/base.rb +656 -0
  157. data/lib/bundler/vendor/thor/lib/thor/command.rb +133 -0
  158. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +77 -0
  159. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +10 -0
  160. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +98 -0
  161. data/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
  162. data/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
  163. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  164. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  165. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +35 -0
  166. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  167. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  168. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +73 -0
  169. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
  170. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +125 -0
  171. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +218 -0
  172. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
  173. data/lib/bundler/vendor/thor/lib/thor/runner.rb +322 -0
  174. data/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  175. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +421 -0
  176. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
  177. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
  178. data/lib/bundler/vendor/thor/lib/thor/util.rb +267 -0
  179. data/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  180. data/lib/bundler/vendored_molinillo.rb +2 -0
  181. data/lib/bundler/vendored_persistent.rb +11 -0
  182. data/lib/bundler/vendored_thor.rb +3 -0
  183. data/lib/bundler/version.rb +6 -0
  184. data/lib/bundler/vlad.rb +11 -0
  185. data/lib/bundler/worker.rb +72 -0
  186. data/man/bundle-config.ronn +187 -0
  187. data/man/bundle-exec.ronn +136 -0
  188. data/man/bundle-gem.ronn +77 -0
  189. data/man/bundle-install.ronn +398 -0
  190. data/man/bundle-package.ronn +66 -0
  191. data/man/bundle-platform.ronn +42 -0
  192. data/man/bundle-update.ronn +188 -0
  193. data/man/bundle.ronn +98 -0
  194. data/man/gemfile.5.ronn +495 -0
  195. data/man/index.txt +8 -0
  196. metadata +346 -0
@@ -0,0 +1,101 @@
1
+ module Bundler
2
+ class SourceList
3
+ attr_reader :path_sources,
4
+ :git_sources
5
+
6
+ def initialize
7
+ @path_sources = []
8
+ @git_sources = []
9
+ @rubygems_aggregate = Source::Rubygems.new
10
+ @rubygems_sources = []
11
+ end
12
+
13
+ def add_path_source(options = {})
14
+ add_source_to_list Source::Path.new(options), path_sources
15
+ end
16
+
17
+ def add_git_source(options = {})
18
+ add_source_to_list Source::Git.new(options), git_sources
19
+ end
20
+
21
+ def add_rubygems_source(options = {})
22
+ add_source_to_list Source::Rubygems.new(options), @rubygems_sources
23
+ end
24
+
25
+ def add_rubygems_remote(uri)
26
+ @rubygems_aggregate.add_remote(uri)
27
+ @rubygems_aggregate
28
+ end
29
+
30
+ def rubygems_sources
31
+ @rubygems_sources + [@rubygems_aggregate]
32
+ end
33
+
34
+ def rubygems_remotes
35
+ rubygems_sources.map(&:remotes).flatten.uniq
36
+ end
37
+
38
+ def all_sources
39
+ path_sources + git_sources + rubygems_sources
40
+ end
41
+
42
+ def get(source)
43
+ source_list_for(source).find {|s| source == s }
44
+ end
45
+
46
+ def lock_sources
47
+ lock_sources = (path_sources + git_sources).sort_by(&:to_s)
48
+ lock_sources << combine_rubygems_sources
49
+ end
50
+
51
+ def replace_sources!(replacement_sources)
52
+ return true if replacement_sources.empty?
53
+
54
+ [path_sources, git_sources].each do |source_list|
55
+ source_list.map! do |source|
56
+ replacement_sources.find {|s| s == source } || source
57
+ end
58
+ end
59
+
60
+ replacement_rubygems =
61
+ replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
62
+ @rubygems_aggregate = replacement_rubygems if replacement_rubygems
63
+
64
+ # Return true if there were changes
65
+ lock_sources.to_set != replacement_sources.to_set ||
66
+ rubygems_remotes.to_set != replacement_rubygems.remotes.to_set
67
+ end
68
+
69
+ def cached!
70
+ all_sources.each(&:cached!)
71
+ end
72
+
73
+ def remote!
74
+ all_sources.each(&:remote!)
75
+ end
76
+
77
+ def rubygems_primary_remotes
78
+ @rubygems_aggregate.remotes
79
+ end
80
+
81
+ private
82
+
83
+ def add_source_to_list(source, list)
84
+ list.unshift(source).uniq!
85
+ source
86
+ end
87
+
88
+ def source_list_for(source)
89
+ case source
90
+ when Source::Git then git_sources
91
+ when Source::Path then path_sources
92
+ when Source::Rubygems then rubygems_sources
93
+ else raise ArgumentError, "Invalid source: #{source.inspect}"
94
+ end
95
+ end
96
+
97
+ def combine_rubygems_sources
98
+ Source::Rubygems.new("remotes" => rubygems_remotes)
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,156 @@
1
+ require "tsort"
2
+ require "forwardable"
3
+
4
+ module Bundler
5
+ class SpecSet
6
+ extend Forwardable
7
+ include TSort, Enumerable
8
+
9
+ def_delegators :@specs, :<<, :length, :add, :remove
10
+ def_delegators :sorted, :each
11
+
12
+ def initialize(specs)
13
+ @specs = specs.sort_by(&:name)
14
+ end
15
+
16
+ def for(dependencies, skip = [], check = false, match_current_platform = false)
17
+ handled = {}
18
+ deps = dependencies.dup
19
+ specs = []
20
+ skip << "bundler"
21
+
22
+ until deps.empty?
23
+ dep = deps.shift
24
+ next if handled[dep] || skip.include?(dep.name)
25
+
26
+ spec = lookup[dep.name].find do |s|
27
+ if match_current_platform
28
+ Gem::Platform.match(s.platform)
29
+ else
30
+ s.match_platform(dep.__platform)
31
+ end
32
+ end
33
+
34
+ handled[dep] = true
35
+
36
+ if spec
37
+ specs << spec
38
+
39
+ spec.dependencies.each do |d|
40
+ next if d.type == :development
41
+ d = DepProxy.new(d, dep.__platform) unless match_current_platform
42
+ deps << d
43
+ end
44
+ elsif check
45
+ return false
46
+ end
47
+ end
48
+
49
+ if spec = lookup["bundler"].first
50
+ specs << spec
51
+ end
52
+
53
+ check ? true : SpecSet.new(specs)
54
+ end
55
+
56
+ def valid_for?(deps)
57
+ self.for(deps, [], true)
58
+ end
59
+
60
+ def [](key)
61
+ key = key.name if key.respond_to?(:name)
62
+ lookup[key].reverse
63
+ end
64
+
65
+ def []=(key, value)
66
+ @specs << value
67
+ @lookup = nil
68
+ @sorted = nil
69
+ value
70
+ end
71
+
72
+ def sort!
73
+ self
74
+ end
75
+
76
+ def to_a
77
+ sorted.dup
78
+ end
79
+
80
+ def to_hash
81
+ lookup.dup
82
+ end
83
+
84
+ def materialize(deps, missing_specs = nil)
85
+ materialized = self.for(deps, [], false, true).to_a
86
+ deps = materialized.map(&:name).uniq
87
+ materialized.map! do |s|
88
+ next s unless s.is_a?(LazySpecification)
89
+ s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
90
+ spec = s.__materialize__
91
+ if missing_specs
92
+ missing_specs << s unless spec
93
+ else
94
+ raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
95
+ end
96
+ spec if spec
97
+ end
98
+ SpecSet.new(materialized.compact)
99
+ end
100
+
101
+ def merge(set)
102
+ arr = sorted.dup
103
+ set.each do |s|
104
+ next if arr.any? {|s2| s2.name == s.name && s2.version == s.version && s2.platform == s.platform }
105
+ arr << s
106
+ end
107
+ SpecSet.new(arr)
108
+ end
109
+
110
+ private
111
+
112
+ def sorted
113
+ rake = @specs.find {|s| s.name == "rake" }
114
+ begin
115
+ @sorted ||= ([rake] + tsort).compact.uniq
116
+ rescue TSort::Cyclic => error
117
+ cgems = extract_circular_gems(error)
118
+ raise CyclicDependencyError, "Your bundle requires gems that depend" \
119
+ " depend on each other, creating an infinite loop. Please remove" \
120
+ " either gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again."
121
+ end
122
+ end
123
+
124
+ def extract_circular_gems(error)
125
+ if Bundler.current_ruby.mri? && Bundler.current_ruby.on_19?
126
+ error.message.scan(/(\w+) \([^)]/).flatten
127
+ else
128
+ error.message.scan(/@name="(.*?)"/).flatten
129
+ end
130
+ end
131
+
132
+ def lookup
133
+ @lookup ||= begin
134
+ lookup = Hash.new {|h, k| h[k] = [] }
135
+ specs = @specs.sort_by do |s|
136
+ s.platform.to_s == "ruby" ? "\0" : s.platform.to_s
137
+ end
138
+ specs.reverse_each do |s|
139
+ lookup[s.name] << s
140
+ end
141
+ lookup
142
+ end
143
+ end
144
+
145
+ def tsort_each_node
146
+ @specs.each {|s| yield s }
147
+ end
148
+
149
+ def tsort_each_child(s)
150
+ s.dependencies.sort_by(&:name).each do |d|
151
+ next if d.type == :development
152
+ lookup[d.name].each {|s2| yield s2 }
153
+ end
154
+ end
155
+ end
156
+ end
@@ -0,0 +1 @@
1
+ # Ignore all files in this directory
@@ -0,0 +1,25 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
3
+ MBIGA1UEChMLQWR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fwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA
13
+ ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l
14
+ uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn
15
+ Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS
16
+ tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF
17
+ PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
18
+ hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
19
+ 5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
20
+ -----END CERTIFICATE-----
@@ -0,0 +1,64 @@
1
+ require "fileutils"
2
+ require "net/https"
3
+ require "openssl"
4
+
5
+ module Bundler
6
+ module SSLCerts
7
+ class CertificateManager
8
+ attr_reader :bundler_cert_path, :bundler_certs, :rubygems_certs
9
+
10
+ def self.update_from!(rubygems_path)
11
+ new(rubygems_path).update!
12
+ end
13
+
14
+ def initialize(rubygems_path = nil)
15
+ if rubygems_path
16
+ rubygems_cert_path = File.join(rubygems_path, "lib/rubygems/ssl_certs")
17
+ @rubygems_certs = certificates_in(rubygems_cert_path)
18
+ end
19
+
20
+ @bundler_cert_path = File.expand_path("..", __FILE__)
21
+ @bundler_certs = certificates_in(bundler_cert_path)
22
+ end
23
+
24
+ def up_to_date?
25
+ rubygems_certs.all? do |rc|
26
+ bundler_certs.find do |bc|
27
+ File.basename(bc) == File.basename(rc) && FileUtils.compare_file(bc, rc)
28
+ end
29
+ end
30
+ end
31
+
32
+ def update!
33
+ return if up_to_date?
34
+
35
+ FileUtils.rm bundler_certs
36
+ FileUtils.cp rubygems_certs, bundler_cert_path
37
+ end
38
+
39
+ def connect_to(host)
40
+ http = Net::HTTP.new(host, 443)
41
+ http.use_ssl = true
42
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
43
+ http.cert_store = store
44
+ http.head("/")
45
+ end
46
+
47
+ private
48
+
49
+ def certificates_in(path)
50
+ Dir[File.join(path, "*.pem")].sort
51
+ end
52
+
53
+ def store
54
+ @store ||= begin
55
+ store = OpenSSL::X509::Store.new
56
+ bundler_certs.each do |cert|
57
+ store.add_file cert
58
+ end
59
+ store
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end