rubygems-update 3.3.26 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/CONTRIBUTING.md +24 -1
  4. data/Manifest.txt +30 -27
  5. data/POLICIES.md +10 -8
  6. data/README.md +2 -2
  7. data/bin/gem +1 -4
  8. data/bin/update_rubygems +1 -1
  9. data/bundler/CHANGELOG.md +59 -0
  10. data/bundler/README.md +2 -2
  11. data/bundler/bundler.gemspec +2 -2
  12. data/bundler/exe/bundle +1 -4
  13. data/bundler/lib/bundler/build_metadata.rb +2 -2
  14. data/bundler/lib/bundler/cli/add.rb +1 -1
  15. data/bundler/lib/bundler/cli/check.rb +1 -1
  16. data/bundler/lib/bundler/cli/common.rb +1 -0
  17. data/bundler/lib/bundler/cli/console.rb +2 -2
  18. data/bundler/lib/bundler/cli/doctor.rb +4 -6
  19. data/bundler/lib/bundler/cli/gem.rb +62 -40
  20. data/bundler/lib/bundler/cli/install.rb +2 -3
  21. data/bundler/lib/bundler/cli/lock.rb +8 -5
  22. data/bundler/lib/bundler/cli/outdated.rb +1 -3
  23. data/bundler/lib/bundler/cli/viz.rb +1 -1
  24. data/bundler/lib/bundler/cli.rb +43 -2
  25. data/bundler/lib/bundler/compact_index_client/cache.rb +1 -1
  26. data/bundler/lib/bundler/compact_index_client/updater.rb +40 -39
  27. data/bundler/lib/bundler/constants.rb +1 -1
  28. data/bundler/lib/bundler/definition.rb +61 -31
  29. data/bundler/lib/bundler/dependency.rb +12 -11
  30. data/bundler/lib/bundler/digest.rb +1 -1
  31. data/bundler/lib/bundler/dsl.rb +1 -1
  32. data/bundler/lib/bundler/env.rb +1 -1
  33. data/bundler/lib/bundler/environment_preserver.rb +1 -0
  34. data/bundler/lib/bundler/errors.rb +1 -11
  35. data/bundler/lib/bundler/fetcher/compact_index.rb +9 -11
  36. data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
  37. data/bundler/lib/bundler/fetcher/downloader.rb +2 -5
  38. data/bundler/lib/bundler/fetcher.rb +2 -6
  39. data/bundler/lib/bundler/force_platform.rb +18 -0
  40. data/bundler/lib/bundler/friendly_errors.rb +0 -3
  41. data/bundler/lib/bundler/gem_version_promoter.rb +52 -86
  42. data/bundler/lib/bundler/graph.rb +3 -3
  43. data/bundler/lib/bundler/index.rb +5 -13
  44. data/bundler/lib/bundler/injector.rb +1 -1
  45. data/bundler/lib/bundler/inline.rb +2 -2
  46. data/bundler/lib/bundler/installer/parallel_installer.rb +0 -31
  47. data/bundler/lib/bundler/installer.rb +6 -16
  48. data/bundler/lib/bundler/lazy_specification.rb +5 -1
  49. data/bundler/lib/bundler/lockfile_parser.rb +5 -5
  50. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  55. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  56. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-gem.1 +27 -37
  60. data/bundler/lib/bundler/man/bundle-gem.1.ronn +5 -5
  61. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-install.1 +1 -30
  66. data/bundler/lib/bundler/man/bundle-install.1.ronn +0 -29
  67. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  68. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  69. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  71. data/bundler/lib/bundler/man/bundle-platform.1 +2 -2
  72. data/bundler/lib/bundler/man/bundle-platform.1.ronn +1 -1
  73. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  74. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  75. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  76. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  77. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  78. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  79. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  80. data/bundler/lib/bundler/man/bundle.1 +1 -1
  81. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  82. data/bundler/lib/bundler/mirror.rb +5 -7
  83. data/bundler/lib/bundler/plugin/index.rb +4 -4
  84. data/bundler/lib/bundler/plugin/installer/rubygems.rb +0 -4
  85. data/bundler/lib/bundler/resolver/base.rb +7 -11
  86. data/bundler/lib/bundler/resolver/candidate.rb +92 -0
  87. data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
  88. data/bundler/lib/bundler/resolver/package.rb +63 -0
  89. data/bundler/lib/bundler/resolver/root.rb +25 -0
  90. data/bundler/lib/bundler/resolver/spec_group.rb +26 -36
  91. data/bundler/lib/bundler/resolver.rb +294 -277
  92. data/bundler/lib/bundler/rubygems_ext.rb +11 -6
  93. data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -2
  94. data/bundler/lib/bundler/rubygems_integration.rb +1 -9
  95. data/bundler/lib/bundler/runtime.rb +1 -5
  96. data/bundler/lib/bundler/settings.rb +0 -6
  97. data/bundler/lib/bundler/shared_helpers.rb +1 -0
  98. data/bundler/lib/bundler/source/git/git_proxy.rb +193 -67
  99. data/bundler/lib/bundler/source/git.rb +15 -17
  100. data/bundler/lib/bundler/source/metadata.rb +0 -1
  101. data/bundler/lib/bundler/source/path/installer.rb +1 -22
  102. data/bundler/lib/bundler/source/path.rb +5 -5
  103. data/bundler/lib/bundler/source/rubygems.rb +13 -67
  104. data/bundler/lib/bundler/source_list.rb +8 -2
  105. data/bundler/lib/bundler/spec_set.rb +7 -9
  106. data/bundler/lib/bundler/templates/Executable +1 -1
  107. data/bundler/lib/bundler/templates/Executable.bundler +4 -9
  108. data/bundler/lib/bundler/templates/Executable.standalone +2 -0
  109. data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  110. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +3 -0
  111. data/bundler/lib/bundler/templates/newgem/README.md.tt +6 -4
  112. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +2 -1
  113. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  114. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  115. data/bundler/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +0 -0
  116. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  117. data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  118. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +10 -0
  119. data/bundler/lib/bundler/templates/newgem/gitignore.tt +3 -0
  120. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +8 -0
  121. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  122. data/bundler/lib/bundler/ui/shell.rb +35 -12
  123. data/bundler/lib/bundler/ui/silent.rb +21 -5
  124. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
  125. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
  126. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +3 -1
  127. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
  128. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  129. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
  130. data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  131. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  132. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  133. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  134. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +151 -0
  135. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  136. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  137. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  138. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  139. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +53 -0
  140. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  141. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  142. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +124 -0
  143. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
  144. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -0
  145. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  146. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  147. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +1 -1
  148. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +64 -16
  149. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
  150. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -1
  151. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +27 -7
  152. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +40 -2
  153. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +2 -1
  154. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  155. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
  156. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -2
  157. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +13 -7
  158. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +10 -5
  159. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  160. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +1 -2
  161. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +2 -1
  162. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +3 -2
  163. data/bundler/lib/bundler/vendored_persistent.rb +1 -33
  164. data/bundler/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
  165. data/bundler/lib/bundler/version.rb +5 -1
  166. data/bundler/lib/bundler/worker.rb +5 -7
  167. data/bundler/lib/bundler.rb +20 -64
  168. data/lib/rubygems/command_manager.rb +2 -2
  169. data/lib/rubygems/commands/fetch_command.rb +1 -1
  170. data/lib/rubygems/commands/install_command.rb +7 -3
  171. data/lib/rubygems/commands/rdoc_command.rb +3 -2
  172. data/lib/rubygems/commands/setup_command.rb +2 -2
  173. data/lib/rubygems/commands/unpack_command.rb +1 -1
  174. data/lib/rubygems/commands/update_command.rb +1 -7
  175. data/lib/rubygems/config_file.rb +33 -0
  176. data/lib/rubygems/core_ext/kernel_warn.rb +1 -2
  177. data/lib/rubygems/defaults.rb +15 -1
  178. data/lib/rubygems/dependency.rb +4 -1
  179. data/lib/rubygems/dependency_installer.rb +24 -24
  180. data/lib/rubygems/exceptions.rb +1 -3
  181. data/lib/rubygems/ext/builder.rb +3 -3
  182. data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +9 -5
  183. data/lib/rubygems/ext/cargo_builder.rb +15 -20
  184. data/lib/rubygems/ext/ext_conf_builder.rb +2 -0
  185. data/lib/rubygems/indexer.rb +1 -1
  186. data/lib/rubygems/installer.rb +5 -5
  187. data/lib/rubygems/optparse/lib/optparse.rb +20 -15
  188. data/lib/rubygems/package/tar_header.rb +11 -11
  189. data/lib/rubygems/platform.rb +0 -2
  190. data/lib/rubygems/request_set/gem_dependency_api.rb +104 -104
  191. data/lib/rubygems/requirement.rb +7 -7
  192. data/lib/rubygems/resolver/installer_set.rb +1 -1
  193. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +1 -1
  194. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +32 -26
  195. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  196. data/lib/rubygems/security/policies.rb +40 -40
  197. data/lib/rubygems/security/trust_dir.rb +1 -1
  198. data/lib/rubygems/security.rb +3 -16
  199. data/lib/rubygems/source.rb +2 -2
  200. data/lib/rubygems/specification.rb +37 -49
  201. data/lib/rubygems/specification_policy.rb +14 -0
  202. data/lib/rubygems/stub_specification.rb +2 -2
  203. data/lib/rubygems/text.rb +1 -1
  204. data/lib/rubygems/tsort/lib/tsort.rb +308 -310
  205. data/lib/rubygems/update_suggestion.rb +69 -0
  206. data/lib/rubygems/util.rb +1 -5
  207. data/lib/rubygems/validator.rb +1 -1
  208. data/lib/rubygems.rb +8 -3
  209. data/rubygems-update.gemspec +2 -2
  210. data/test/rubygems/helper.rb +7 -3
  211. data/test/rubygems/test_bundled_ca.rb +1 -1
  212. data/test/rubygems/test_exit.rb +6 -0
  213. data/test/rubygems/test_gem.rb +4 -9
  214. data/test/rubygems/test_gem_bundler_version_finder.rb +2 -1
  215. data/test/rubygems/test_gem_command_manager.rb +1 -1
  216. data/test/rubygems/test_gem_commands_install_command.rb +19 -0
  217. data/test/rubygems/test_gem_commands_setup_command.rb +1 -8
  218. data/test/rubygems/test_gem_commands_update_command.rb +6 -6
  219. data/test/rubygems/test_gem_config_file.rb +1 -1
  220. data/test/rubygems/test_gem_dependency.rb +2 -0
  221. data/test/rubygems/test_gem_ext_builder.rb +3 -3
  222. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +22 -32
  223. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  224. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +22 -32
  225. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  226. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +12 -0
  227. data/test/rubygems/test_gem_ext_cargo_builder.rb +22 -27
  228. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +16 -16
  229. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -10
  230. data/test/rubygems/test_gem_indexer.rb +39 -20
  231. data/test/rubygems/test_gem_installer.rb +68 -2
  232. data/test/rubygems/test_gem_package_tar_header.rb +13 -13
  233. data/test/rubygems/test_gem_platform.rb +59 -60
  234. data/test/rubygems/test_gem_remote_fetcher.rb +4 -4
  235. data/test/rubygems/test_gem_request_set.rb +2 -2
  236. data/test/rubygems/test_gem_requirement.rb +1 -1
  237. data/test/rubygems/test_gem_resolver_api_set.rb +12 -12
  238. data/test/rubygems/test_gem_resolver_api_specification.rb +19 -19
  239. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
  240. data/test/rubygems/test_gem_security_policy.rb +10 -10
  241. data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
  242. data/test/rubygems/test_gem_specification.rb +50 -37
  243. data/test/rubygems/test_gem_uninstaller.rb +1 -1
  244. data/test/rubygems/test_gem_update_suggestion.rb +208 -0
  245. data/test/rubygems/test_kernel.rb +10 -8
  246. data/test/rubygems/test_require.rb +70 -55
  247. metadata +34 -31
  248. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -6
  249. data/bundler/lib/bundler/vendor/molinillo/LICENSE +0 -9
  250. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  251. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
  252. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  253. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  254. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  255. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  256. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  257. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  258. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  259. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  260. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
  261. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
  262. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -149
  263. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  264. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
  265. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
  266. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
  267. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
  268. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
  269. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
  270. data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
  271. data/bundler/lib/bundler/vendored_molinillo.rb +0 -4
  272. data/bundler/lib/bundler/version_ranges.rb +0 -122
@@ -37,7 +37,8 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
37
37
  def build_env
38
38
  build_env = rb_config_env
39
39
  build_env["RUBY_STATIC"] = "true" if ruby_static? && ENV.key?("RUBY_STATIC")
40
- build_env["RUSTFLAGS"] = "#{ENV["RUSTFLAGS"]} --cfg=rb_sys_gem".strip
40
+ cfg = "--cfg=rb_sys_gem --cfg=rubygems --cfg=rubygems_#{Gem::VERSION.tr(".", "_")}"
41
+ build_env["RUSTFLAGS"] = [ENV["RUSTFLAGS"], cfg].compact.join(" ")
41
42
  build_env
42
43
  end
43
44
 
@@ -47,12 +48,13 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
47
48
 
48
49
  cmd = []
49
50
  cmd += [cargo, "rustc"]
51
+ cmd += ["--crate-type", "cdylib"]
50
52
  cmd += ["--target", ENV["CARGO_BUILD_TARGET"]] if ENV["CARGO_BUILD_TARGET"]
51
53
  cmd += ["--target-dir", dest_path]
52
54
  cmd += ["--manifest-path", manifest]
53
55
  cmd += ["--lib"]
54
56
  cmd += ["--profile", profile.to_s]
55
- cmd += ["--locked"] if profile == :release
57
+ cmd += ["--locked"]
56
58
  cmd += Gem::Command.build_args
57
59
  cmd += args
58
60
  cmd += ["--"]
@@ -75,7 +77,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
75
77
  *rustc_dynamic_linker_flags(dest_dir),
76
78
  *rustc_lib_flags(dest_dir),
77
79
  *platform_specific_rustc_args(dest_dir),
78
- *debug_flags,
79
80
  ]
80
81
  end
81
82
 
@@ -104,14 +105,23 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
104
105
  # We want to use the same linker that Ruby uses, so that the linker flags from
105
106
  # mkmf work properly.
106
107
  def linker_args
107
- # Have to handle CC="cl /nologo" on mswin
108
108
  cc_flag = Shellwords.split(makefile_config("CC"))
109
109
  linker = cc_flag.shift
110
110
  link_args = cc_flag.flat_map {|a| ["-C", "link-arg=#{a}"] }
111
111
 
112
+ return mswin_link_args if linker == "cl"
113
+
112
114
  ["-C", "linker=#{linker}", *link_args]
113
115
  end
114
116
 
117
+ def mswin_link_args
118
+ args = []
119
+ args += ["-l", makefile_config("LIBRUBYARG_SHARED").chomp(".lib")]
120
+ args += split_flags("LIBS").flat_map {|lib| ["-l", lib.chomp(".lib")] }
121
+ args += split_flags("LOCAL_LIBS").flat_map {|lib| ["-l", lib.chomp(".lib")] }
122
+ args
123
+ end
124
+
115
125
  def libruby_args(dest_dir)
116
126
  libs = makefile_config(ruby_static? ? "LIBRUBYARG_STATIC" : "LIBRUBYARG_SHARED")
117
127
  raw_libs = Shellwords.split(libs)
@@ -149,7 +159,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
149
159
  prefix = so_ext == "dll" ? "" : "lib"
150
160
  path_parts = [dest_path]
151
161
  path_parts << ENV["CARGO_BUILD_TARGET"] if ENV["CARGO_BUILD_TARGET"]
152
- path_parts += [profile_target_directory, "#{prefix}#{cargo_crate_name}.#{so_ext}"]
162
+ path_parts += ["release", "#{prefix}#{cargo_crate_name}.#{so_ext}"]
153
163
  File.join(*path_parts)
154
164
  end
155
165
 
@@ -254,13 +264,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
254
264
  RbConfig.expand(val.dup)
255
265
  end
256
266
 
257
- # Good balance between binary size and debugability
258
- def debug_flags
259
- return [] if profile == :dev
260
-
261
- ["-C", "debuginfo=1"]
262
- end
263
-
264
267
  # Copied from ExtConfBuilder
265
268
  def finalize_directory(dest_path, lib_dir, extension_dir)
266
269
  require "fileutils"
@@ -299,14 +302,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
299
302
  path
300
303
  end
301
304
 
302
- def profile_target_directory
303
- case profile
304
- when :release then "release"
305
- when :dev then "debug"
306
- else raise "unknown target directory for profile: #{profile}"
307
- end
308
- end
309
-
310
305
  # Error raised when no cdylib artifact was created
311
306
  class DylibNotFoundError < StandardError
312
307
  def initialize(dir)
@@ -55,6 +55,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
55
55
  destent = ent.class.new(dest_path, ent.rel)
56
56
  destent.exist? || FileUtils.mv(ent.path, destent.path)
57
57
  end
58
+
59
+ make dest_path, results, extension_dir, tmp_dest_relative, ["clean"]
58
60
  ensure
59
61
  ENV["DESTDIR"] = destdir
60
62
  end
@@ -397,7 +397,7 @@ class Gem::Indexer
397
397
  dst_name = File.join @dest_directory, file # REFACTOR: duped above
398
398
 
399
399
  FileUtils.mv src_name, dst_name, :verbose => verbose,
400
- :force => true
400
+ :force => true
401
401
 
402
402
  File.utime newest_mtime, newest_mtime, dst_name
403
403
  end
@@ -234,8 +234,8 @@ class Gem::Installer
234
234
  io.gets # blankline
235
235
 
236
236
  # TODO detect a specially formatted comment instead of trying
237
- # to run a regexp against Ruby code.
238
- next unless io.gets =~ /This file was generated by RubyGems/
237
+ # to find a string inside Ruby code.
238
+ next unless io.gets.to_s.include?("This file was generated by RubyGems")
239
239
 
240
240
  ruby_executable = true
241
241
  existing = io.read.slice(%r{
@@ -649,9 +649,9 @@ class Gem::Installer
649
649
 
650
650
  def process_options # :nodoc:
651
651
  @options = {
652
- :bin_dir => nil,
653
- :env_shebang => false,
654
- :force => false,
652
+ :bin_dir => nil,
653
+ :env_shebang => false,
654
+ :force => false,
655
655
  :only_install_dir => false,
656
656
  :post_install_message => true,
657
657
  }.merge options
@@ -425,7 +425,7 @@
425
425
  # If you have any questions, file a ticket at http://bugs.ruby-lang.org.
426
426
  #
427
427
  class Gem::OptionParser
428
- Gem::OptionParser::Version = "0.2.0"
428
+ Gem::OptionParser::Version = "0.3.0"
429
429
 
430
430
  # :stopdoc:
431
431
  NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
@@ -765,15 +765,15 @@ class Gem::OptionParser
765
765
  end
766
766
 
767
767
  #
768
- # Switch that takes an argument, which does not begin with '-'.
768
+ # Switch that takes an argument, which does not begin with '-' or is '-'.
769
769
  #
770
770
  class PlacedArgument < self
771
771
 
772
772
  #
773
- # Returns nil if argument is not present or begins with '-'.
773
+ # Returns nil if argument is not present or begins with '-' and is not '-'.
774
774
  #
775
775
  def parse(arg, argv, &error)
776
- if !(val = arg) and (argv.empty? or /\A-/ =~ (val = argv[0]))
776
+ if !(val = arg) and (argv.empty? or /\A-./ =~ (val = argv[0]))
777
777
  return nil, block, nil
778
778
  end
779
779
  opt = (val = parse_arg(val, &error))[1]
@@ -1148,6 +1148,7 @@ XXX
1148
1148
  @summary_indent = indent
1149
1149
  @default_argv = ARGV
1150
1150
  @require_exact = false
1151
+ @raise_unknown = true
1151
1152
  add_officious
1152
1153
  yield self if block_given?
1153
1154
  end
@@ -1225,6 +1226,9 @@ XXX
1225
1226
  # abbreviated long option as short option).
1226
1227
  attr_accessor :require_exact
1227
1228
 
1229
+ # Whether to raise at unknown option.
1230
+ attr_accessor :raise_unknown
1231
+
1228
1232
  #
1229
1233
  # Heading banner preceding summary.
1230
1234
  #
@@ -1502,7 +1506,7 @@ XXX
1502
1506
  style = notwice(default_style.guess(arg = o), style, 'style')
1503
1507
  default_pattern, conv = search(:atype, Object) unless default_pattern
1504
1508
  else
1505
- desc.push(o)
1509
+ desc.push(o) if o && !o.empty?
1506
1510
  end
1507
1511
  end
1508
1512
 
@@ -1639,9 +1643,11 @@ XXX
1639
1643
  begin
1640
1644
  sw, = complete(:long, opt, true)
1641
1645
  if require_exact && !sw.long.include?(arg)
1646
+ throw :terminate, arg unless raise_unknown
1642
1647
  raise InvalidOption, arg
1643
1648
  end
1644
1649
  rescue ParseError
1650
+ throw :terminate, arg unless raise_unknown
1645
1651
  raise $!.set_option(arg, true)
1646
1652
  end
1647
1653
  begin
@@ -1673,6 +1679,7 @@ XXX
1673
1679
  end
1674
1680
  end
1675
1681
  rescue ParseError
1682
+ throw :terminate, arg unless raise_unknown
1676
1683
  raise $!.set_option(arg, true)
1677
1684
  end
1678
1685
  begin
@@ -1862,12 +1869,7 @@ XXX
1862
1869
  end
1863
1870
  all_candidates.select! {|cand| cand.is_a?(String) }
1864
1871
  checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
1865
- suggestions = all_candidates & checker.correct(opt)
1866
- if DidYouMean.respond_to?(:formatter)
1867
- DidYouMean.formatter.message_for(suggestions)
1868
- else
1869
- "\nDid you mean? #{suggestions.join("\n ")}"
1870
- end
1872
+ DidYouMean.formatter.message_for(all_candidates & checker.correct(opt))
1871
1873
  end
1872
1874
 
1873
1875
  def candidate(word)
@@ -1908,10 +1910,13 @@ XXX
1908
1910
  # directory ~/.options, then the basename with '.options' suffix
1909
1911
  # under XDG and Haiku standard places.
1910
1912
  #
1911
- def load(filename = nil)
1913
+ # The optional +into+ keyword argument works exactly like that accepted in
1914
+ # method #parse.
1915
+ #
1916
+ def load(filename = nil, into: nil)
1912
1917
  unless filename
1913
1918
  basename = File.basename($0, '.*')
1914
- return true if load(File.expand_path(basename, '~/.options')) rescue nil
1919
+ return true if load(File.expand_path(basename, '~/.options'), into: into) rescue nil
1915
1920
  basename << ".options"
1916
1921
  return [
1917
1922
  # XDG
@@ -1923,11 +1928,11 @@ XXX
1923
1928
  '~/config/settings',
1924
1929
  ].any? {|dir|
1925
1930
  next if !dir or dir.empty?
1926
- load(File.expand_path(basename, dir)) rescue nil
1931
+ load(File.expand_path(basename, dir), into: into) rescue nil
1927
1932
  }
1928
1933
  end
1929
1934
  begin
1930
- parse(*IO.readlines(filename).each {|s| s.chomp!})
1935
+ parse(*File.readlines(filename, chomp: true), into: into)
1931
1936
  true
1932
1937
  rescue Errno::ENOENT, Errno::ENOTDIR
1933
1938
  false
@@ -103,22 +103,22 @@ class Gem::Package::TarHeader
103
103
 
104
104
  fields = header.unpack UNPACK_FORMAT
105
105
 
106
- new :name => fields.shift,
107
- :mode => strict_oct(fields.shift),
108
- :uid => oct_or_256based(fields.shift),
109
- :gid => oct_or_256based(fields.shift),
110
- :size => strict_oct(fields.shift),
111
- :mtime => strict_oct(fields.shift),
106
+ new :name => fields.shift,
107
+ :mode => strict_oct(fields.shift),
108
+ :uid => oct_or_256based(fields.shift),
109
+ :gid => oct_or_256based(fields.shift),
110
+ :size => strict_oct(fields.shift),
111
+ :mtime => strict_oct(fields.shift),
112
112
  :checksum => strict_oct(fields.shift),
113
113
  :typeflag => fields.shift,
114
114
  :linkname => fields.shift,
115
- :magic => fields.shift,
116
- :version => strict_oct(fields.shift),
117
- :uname => fields.shift,
118
- :gname => fields.shift,
115
+ :magic => fields.shift,
116
+ :version => strict_oct(fields.shift),
117
+ :uname => fields.shift,
118
+ :gname => fields.shift,
119
119
  :devmajor => strict_oct(fields.shift),
120
120
  :devminor => strict_oct(fields.shift),
121
- :prefix => fields.shift,
121
+ :prefix => fields.shift,
122
122
 
123
123
  :empty => empty
124
124
  end
@@ -97,7 +97,6 @@ class Gem::Platform
97
97
  when /darwin(\d+)?/ then [ "darwin", $1 ]
98
98
  when /^macruby$/ then [ "macruby", nil ]
99
99
  when /freebsd(\d+)?/ then [ "freebsd", $1 ]
100
- when /hpux(\d+)?/ then [ "hpux", $1 ]
101
100
  when /^java$/, /^jruby$/ then [ "java", nil ]
102
101
  when /^java([\d.]*)/ then [ "java", $1 ]
103
102
  when /^dalvik(\d+)?$/ then [ "dalvik", $1 ]
@@ -112,7 +111,6 @@ class Gem::Platform
112
111
  [os, version]
113
112
  when /netbsdelf/ then [ "netbsdelf", nil ]
114
113
  when /openbsd(\d+\.\d+)?/ then [ "openbsd", $1 ]
115
- when /bitrig(\d+\.\d+)?/ then [ "bitrig", $1 ]
116
114
  when /solaris(\d+\.\d+)?/ then [ "solaris", $1 ]
117
115
  # test
118
116
  when /^(\w+_platform)(\d+)?/ then [ $1, $2 ]
@@ -32,22 +32,22 @@
32
32
 
33
33
  class Gem::RequestSet::GemDependencyAPI
34
34
  ENGINE_MAP = { # :nodoc:
35
- :jruby => %w[jruby],
36
- :jruby_18 => %w[jruby],
37
- :jruby_19 => %w[jruby],
38
- :maglev => %w[maglev],
39
- :mri => %w[ruby],
40
- :mri_18 => %w[ruby],
41
- :mri_19 => %w[ruby],
42
- :mri_20 => %w[ruby],
43
- :mri_21 => %w[ruby],
44
- :rbx => %w[rbx],
45
- :truffleruby => %w[truffleruby],
46
- :ruby => %w[ruby rbx maglev truffleruby],
47
- :ruby_18 => %w[ruby rbx maglev truffleruby],
48
- :ruby_19 => %w[ruby rbx maglev truffleruby],
49
- :ruby_20 => %w[ruby rbx maglev truffleruby],
50
- :ruby_21 => %w[ruby rbx maglev truffleruby],
35
+ :jruby => %w[jruby],
36
+ :jruby_18 => %w[jruby],
37
+ :jruby_19 => %w[jruby],
38
+ :maglev => %w[maglev],
39
+ :mri => %w[ruby],
40
+ :mri_18 => %w[ruby],
41
+ :mri_19 => %w[ruby],
42
+ :mri_20 => %w[ruby],
43
+ :mri_21 => %w[ruby],
44
+ :rbx => %w[rbx],
45
+ :truffleruby => %w[truffleruby],
46
+ :ruby => %w[ruby rbx maglev truffleruby],
47
+ :ruby_18 => %w[ruby rbx maglev truffleruby],
48
+ :ruby_19 => %w[ruby rbx maglev truffleruby],
49
+ :ruby_20 => %w[ruby rbx maglev truffleruby],
50
+ :ruby_21 => %w[ruby rbx maglev truffleruby],
51
51
  }.freeze
52
52
 
53
53
  mswin = Gem::Platform.new "x86-mswin32"
@@ -56,37 +56,37 @@ class Gem::RequestSet::GemDependencyAPI
56
56
  x64_mingw = Gem::Platform.new "x64-mingw32"
57
57
 
58
58
  PLATFORM_MAP = { # :nodoc:
59
- :jruby => Gem::Platform::RUBY,
60
- :jruby_18 => Gem::Platform::RUBY,
61
- :jruby_19 => Gem::Platform::RUBY,
62
- :maglev => Gem::Platform::RUBY,
63
- :mingw => x86_mingw,
64
- :mingw_18 => x86_mingw,
65
- :mingw_19 => x86_mingw,
66
- :mingw_20 => x86_mingw,
67
- :mingw_21 => x86_mingw,
68
- :mri => Gem::Platform::RUBY,
69
- :mri_18 => Gem::Platform::RUBY,
70
- :mri_19 => Gem::Platform::RUBY,
71
- :mri_20 => Gem::Platform::RUBY,
72
- :mri_21 => Gem::Platform::RUBY,
73
- :mswin => mswin,
74
- :mswin_18 => mswin,
75
- :mswin_19 => mswin,
76
- :mswin_20 => mswin,
77
- :mswin_21 => mswin,
78
- :mswin64 => mswin64,
79
- :mswin64_19 => mswin64,
80
- :mswin64_20 => mswin64,
81
- :mswin64_21 => mswin64,
82
- :rbx => Gem::Platform::RUBY,
83
- :ruby => Gem::Platform::RUBY,
84
- :ruby_18 => Gem::Platform::RUBY,
85
- :ruby_19 => Gem::Platform::RUBY,
86
- :ruby_20 => Gem::Platform::RUBY,
87
- :ruby_21 => Gem::Platform::RUBY,
88
- :truffleruby => Gem::Platform::RUBY,
89
- :x64_mingw => x64_mingw,
59
+ :jruby => Gem::Platform::RUBY,
60
+ :jruby_18 => Gem::Platform::RUBY,
61
+ :jruby_19 => Gem::Platform::RUBY,
62
+ :maglev => Gem::Platform::RUBY,
63
+ :mingw => x86_mingw,
64
+ :mingw_18 => x86_mingw,
65
+ :mingw_19 => x86_mingw,
66
+ :mingw_20 => x86_mingw,
67
+ :mingw_21 => x86_mingw,
68
+ :mri => Gem::Platform::RUBY,
69
+ :mri_18 => Gem::Platform::RUBY,
70
+ :mri_19 => Gem::Platform::RUBY,
71
+ :mri_20 => Gem::Platform::RUBY,
72
+ :mri_21 => Gem::Platform::RUBY,
73
+ :mswin => mswin,
74
+ :mswin_18 => mswin,
75
+ :mswin_19 => mswin,
76
+ :mswin_20 => mswin,
77
+ :mswin_21 => mswin,
78
+ :mswin64 => mswin64,
79
+ :mswin64_19 => mswin64,
80
+ :mswin64_20 => mswin64,
81
+ :mswin64_21 => mswin64,
82
+ :rbx => Gem::Platform::RUBY,
83
+ :ruby => Gem::Platform::RUBY,
84
+ :ruby_18 => Gem::Platform::RUBY,
85
+ :ruby_19 => Gem::Platform::RUBY,
86
+ :ruby_20 => Gem::Platform::RUBY,
87
+ :ruby_21 => Gem::Platform::RUBY,
88
+ :truffleruby => Gem::Platform::RUBY,
89
+ :x64_mingw => x64_mingw,
90
90
  :x64_mingw_20 => x64_mingw,
91
91
  :x64_mingw_21 => x64_mingw,
92
92
  }.freeze
@@ -98,68 +98,68 @@ class Gem::RequestSet::GemDependencyAPI
98
98
  tilde_gt_2_1_0 = Gem::Requirement.new "~> 2.1.0"
99
99
 
100
100
  VERSION_MAP = { # :nodoc:
101
- :jruby => gt_eq_0,
102
- :jruby_18 => tilde_gt_1_8_0,
103
- :jruby_19 => tilde_gt_1_9_0,
104
- :maglev => gt_eq_0,
105
- :mingw => gt_eq_0,
106
- :mingw_18 => tilde_gt_1_8_0,
107
- :mingw_19 => tilde_gt_1_9_0,
108
- :mingw_20 => tilde_gt_2_0_0,
109
- :mingw_21 => tilde_gt_2_1_0,
110
- :mri => gt_eq_0,
111
- :mri_18 => tilde_gt_1_8_0,
112
- :mri_19 => tilde_gt_1_9_0,
113
- :mri_20 => tilde_gt_2_0_0,
114
- :mri_21 => tilde_gt_2_1_0,
115
- :mswin => gt_eq_0,
116
- :mswin_18 => tilde_gt_1_8_0,
117
- :mswin_19 => tilde_gt_1_9_0,
118
- :mswin_20 => tilde_gt_2_0_0,
119
- :mswin_21 => tilde_gt_2_1_0,
120
- :mswin64 => gt_eq_0,
121
- :mswin64_19 => tilde_gt_1_9_0,
122
- :mswin64_20 => tilde_gt_2_0_0,
123
- :mswin64_21 => tilde_gt_2_1_0,
124
- :rbx => gt_eq_0,
125
- :ruby => gt_eq_0,
126
- :ruby_18 => tilde_gt_1_8_0,
127
- :ruby_19 => tilde_gt_1_9_0,
128
- :ruby_20 => tilde_gt_2_0_0,
129
- :ruby_21 => tilde_gt_2_1_0,
130
- :truffleruby => gt_eq_0,
131
- :x64_mingw => gt_eq_0,
101
+ :jruby => gt_eq_0,
102
+ :jruby_18 => tilde_gt_1_8_0,
103
+ :jruby_19 => tilde_gt_1_9_0,
104
+ :maglev => gt_eq_0,
105
+ :mingw => gt_eq_0,
106
+ :mingw_18 => tilde_gt_1_8_0,
107
+ :mingw_19 => tilde_gt_1_9_0,
108
+ :mingw_20 => tilde_gt_2_0_0,
109
+ :mingw_21 => tilde_gt_2_1_0,
110
+ :mri => gt_eq_0,
111
+ :mri_18 => tilde_gt_1_8_0,
112
+ :mri_19 => tilde_gt_1_9_0,
113
+ :mri_20 => tilde_gt_2_0_0,
114
+ :mri_21 => tilde_gt_2_1_0,
115
+ :mswin => gt_eq_0,
116
+ :mswin_18 => tilde_gt_1_8_0,
117
+ :mswin_19 => tilde_gt_1_9_0,
118
+ :mswin_20 => tilde_gt_2_0_0,
119
+ :mswin_21 => tilde_gt_2_1_0,
120
+ :mswin64 => gt_eq_0,
121
+ :mswin64_19 => tilde_gt_1_9_0,
122
+ :mswin64_20 => tilde_gt_2_0_0,
123
+ :mswin64_21 => tilde_gt_2_1_0,
124
+ :rbx => gt_eq_0,
125
+ :ruby => gt_eq_0,
126
+ :ruby_18 => tilde_gt_1_8_0,
127
+ :ruby_19 => tilde_gt_1_9_0,
128
+ :ruby_20 => tilde_gt_2_0_0,
129
+ :ruby_21 => tilde_gt_2_1_0,
130
+ :truffleruby => gt_eq_0,
131
+ :x64_mingw => gt_eq_0,
132
132
  :x64_mingw_20 => tilde_gt_2_0_0,
133
133
  :x64_mingw_21 => tilde_gt_2_1_0,
134
134
  }.freeze
135
135
 
136
136
  WINDOWS = { # :nodoc:
137
- :mingw => :only,
138
- :mingw_18 => :only,
139
- :mingw_19 => :only,
140
- :mingw_20 => :only,
141
- :mingw_21 => :only,
142
- :mri => :never,
143
- :mri_18 => :never,
144
- :mri_19 => :never,
145
- :mri_20 => :never,
146
- :mri_21 => :never,
147
- :mswin => :only,
148
- :mswin_18 => :only,
149
- :mswin_19 => :only,
150
- :mswin_20 => :only,
151
- :mswin_21 => :only,
152
- :mswin64 => :only,
153
- :mswin64_19 => :only,
154
- :mswin64_20 => :only,
155
- :mswin64_21 => :only,
156
- :rbx => :never,
157
- :ruby => :never,
158
- :ruby_18 => :never,
159
- :ruby_19 => :never,
160
- :ruby_20 => :never,
161
- :ruby_21 => :never,
162
- :x64_mingw => :only,
137
+ :mingw => :only,
138
+ :mingw_18 => :only,
139
+ :mingw_19 => :only,
140
+ :mingw_20 => :only,
141
+ :mingw_21 => :only,
142
+ :mri => :never,
143
+ :mri_18 => :never,
144
+ :mri_19 => :never,
145
+ :mri_20 => :never,
146
+ :mri_21 => :never,
147
+ :mswin => :only,
148
+ :mswin_18 => :only,
149
+ :mswin_19 => :only,
150
+ :mswin_20 => :only,
151
+ :mswin_21 => :only,
152
+ :mswin64 => :only,
153
+ :mswin64_19 => :only,
154
+ :mswin64_20 => :only,
155
+ :mswin64_21 => :only,
156
+ :rbx => :never,
157
+ :ruby => :never,
158
+ :ruby_18 => :never,
159
+ :ruby_19 => :never,
160
+ :ruby_20 => :never,
161
+ :ruby_21 => :never,
162
+ :x64_mingw => :only,
163
163
  :x64_mingw_20 => :only,
164
164
  :x64_mingw_21 => :only,
165
165
  }.freeze
@@ -10,13 +10,13 @@ require_relative "version"
10
10
 
11
11
  class Gem::Requirement
12
12
  OPS = { #:nodoc:
13
- "=" => lambda {|v, r| v == r },
14
- "!=" => lambda {|v, r| v != r },
15
- ">" => lambda {|v, r| v > r },
16
- "<" => lambda {|v, r| v < r },
17
- ">=" => lambda {|v, r| v >= r },
18
- "<=" => lambda {|v, r| v <= r },
19
- "~>" => lambda {|v, r| v >= r && v.release < r.bump },
13
+ "=" => lambda {|v, r| v == r },
14
+ "!=" => lambda {|v, r| v != r },
15
+ ">" => lambda {|v, r| v > r },
16
+ "<" => lambda {|v, r| v < r },
17
+ ">=" => lambda {|v, r| v >= r },
18
+ "<=" => lambda {|v, r| v <= r },
19
+ "~>" => lambda {|v, r| v >= r && v.release < r.bump },
20
20
  }.freeze
21
21
 
22
22
  SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc:
@@ -66,7 +66,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
66
66
 
67
67
  found = found.select do |s|
68
68
  Gem::Source::SpecificFile === s.source ||
69
- Gem::Platform.match(s.platform)
69
+ Gem::Platform.match_spec?(s)
70
70
  end
71
71
 
72
72
  found = found.sort_by do |s|
@@ -32,7 +32,7 @@ module Gem::Resolver::Molinillo
32
32
  # all belong to the same graph.
33
33
  # @return [Array<Vertex>] The sorted vertices.
34
34
  def self.tsort(vertices)
35
- TSort.tsort(
35
+ Gem::TSort.tsort(
36
36
  lambda { |b| vertices.each(&b) },
37
37
  lambda { |v, &b| (v.successors & vertices).each(&b) }
38
38
  )
@@ -107,36 +107,42 @@ module Gem::Resolver::Molinillo
107
107
  end
108
108
  end
109
109
 
110
- conflicts.sort.reduce(''.dup) do |o, (name, conflict)|
111
- o << "\n" << incompatible_version_message_for_conflict.call(name, conflict) << "\n"
112
- if conflict.locked_requirement
113
- o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
114
- o << %( #{printable_requirement.call(conflict.locked_requirement)}\n)
115
- o << %(\n)
116
- end
117
- o << %( In #{name_for_explicit_dependency_source}:\n)
118
- trees = reduce_trees.call(conflict.requirement_trees)
119
-
120
- o << trees.map do |tree|
121
- t = ''.dup
122
- depth = 2
123
- tree.each do |req|
124
- t << ' ' * depth << printable_requirement.call(req)
125
- unless tree.last == req
126
- if spec = conflict.activated_by_name[name_for(req)]
127
- t << %( was resolved to #{version_for_spec.call(spec)}, which)
110
+ full_message_for_conflict = opts.delete(:full_message_for_conflict) do
111
+ proc do |name, conflict|
112
+ o = "\n".dup << incompatible_version_message_for_conflict.call(name, conflict) << "\n"
113
+ if conflict.locked_requirement
114
+ o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
115
+ o << %( #{printable_requirement.call(conflict.locked_requirement)}\n)
116
+ o << %(\n)
117
+ end
118
+ o << %( In #{name_for_explicit_dependency_source}:\n)
119
+ trees = reduce_trees.call(conflict.requirement_trees)
120
+
121
+ o << trees.map do |tree|
122
+ t = ''.dup
123
+ depth = 2
124
+ tree.each do |req|
125
+ t << ' ' * depth << printable_requirement.call(req)
126
+ unless tree.last == req
127
+ if spec = conflict.activated_by_name[name_for(req)]
128
+ t << %( was resolved to #{version_for_spec.call(spec)}, which)
129
+ end
130
+ t << %( depends on)
128
131
  end
129
- t << %( depends on)
132
+ t << %(\n)
133
+ depth += 1
130
134
  end
131
- t << %(\n)
132
- depth += 1
133
- end
134
- t
135
- end.join("\n")
135
+ t
136
+ end.join("\n")
136
137
 
137
- additional_message_for_conflict.call(o, name, conflict)
138
+ additional_message_for_conflict.call(o, name, conflict)
138
139
 
139
- o
140
+ o
141
+ end
142
+ end
143
+
144
+ conflicts.sort.reduce(''.dup) do |o, (name, conflict)|
145
+ o << full_message_for_conflict.call(name, conflict)
140
146
  end.strip
141
147
  end
142
148
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Gem::Resolver::Molinillo
4
4
  # The version of Gem::Resolver::Molinillo.
5
- VERSION = '0.7.0'.freeze
5
+ VERSION = '0.8.0'.freeze
6
6
  end