rubygems-update 2.1.11 → 2.2.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.autotest +37 -12
  5. data/History.txt +99 -2
  6. data/MIT.txt +1 -0
  7. data/Manifest.txt +59 -19
  8. data/Rakefile +4 -6
  9. data/lib/gauntlet_rubygems.rb +1 -1
  10. data/lib/rubygems.rb +102 -80
  11. data/lib/rubygems/available_set.rb +2 -2
  12. data/lib/rubygems/basic_specification.rb +97 -8
  13. data/lib/rubygems/commands/install_command.rb +58 -15
  14. data/lib/rubygems/commands/list_command.rb +1 -7
  15. data/lib/rubygems/commands/outdated_command.rb +1 -1
  16. data/lib/rubygems/commands/pristine_command.rb +14 -1
  17. data/lib/rubygems/commands/push_command.rb +9 -4
  18. data/lib/rubygems/commands/query_command.rb +33 -17
  19. data/lib/rubygems/commands/search_command.rb +0 -6
  20. data/lib/rubygems/commands/specification_command.rb +1 -1
  21. data/lib/rubygems/commands/unpack_command.rb +1 -1
  22. data/lib/rubygems/commands/update_command.rb +4 -1
  23. data/lib/rubygems/commands/which_command.rb +5 -8
  24. data/lib/rubygems/compatibility.rb +3 -0
  25. data/lib/rubygems/core_ext/kernel_gem.rb +6 -0
  26. data/lib/rubygems/defaults.rb +19 -0
  27. data/lib/rubygems/dependency_installer.rb +28 -9
  28. data/lib/rubygems/doctor.rb +17 -11
  29. data/lib/rubygems/errors.rb +16 -3
  30. data/lib/rubygems/exceptions.rb +52 -5
  31. data/lib/rubygems/ext.rb +1 -2
  32. data/lib/rubygems/ext/build_error.rb +6 -0
  33. data/lib/rubygems/ext/builder.rb +50 -17
  34. data/lib/rubygems/ext/cmake_builder.rb +1 -1
  35. data/lib/rubygems/ext/configure_builder.rb +1 -3
  36. data/lib/rubygems/ext/ext_conf_builder.rb +9 -3
  37. data/lib/rubygems/ext/rake_builder.rb +2 -5
  38. data/lib/rubygems/gemcutter_utilities.rb +8 -1
  39. data/lib/rubygems/installer.rb +14 -4
  40. data/lib/rubygems/installer_test_case.rb +0 -5
  41. data/lib/rubygems/package.rb +11 -2
  42. data/lib/rubygems/psych_additions.rb +1 -1
  43. data/lib/rubygems/rdoc.rb +1 -1
  44. data/lib/rubygems/remote_fetcher.rb +3 -3
  45. data/lib/rubygems/request.rb +16 -8
  46. data/lib/rubygems/request_set.rb +133 -42
  47. data/lib/rubygems/request_set/gem_dependency_api.rb +493 -11
  48. data/lib/rubygems/request_set/lockfile.rb +579 -0
  49. data/lib/rubygems/requirement.rb +58 -30
  50. data/lib/rubygems/resolver.rb +471 -0
  51. data/lib/rubygems/resolver/activation_request.rb +165 -0
  52. data/lib/rubygems/resolver/api_set.rb +110 -0
  53. data/lib/rubygems/resolver/api_specification.rb +79 -0
  54. data/lib/rubygems/resolver/best_set.rb +31 -0
  55. data/lib/rubygems/resolver/composed_set.rb +39 -0
  56. data/lib/rubygems/resolver/conflict.rb +122 -0
  57. data/lib/rubygems/{dependency_resolver → resolver}/current_set.rb +1 -4
  58. data/lib/rubygems/{dependency_resolver → resolver}/dependency_request.rb +37 -7
  59. data/lib/rubygems/resolver/git_set.rb +119 -0
  60. data/lib/rubygems/resolver/git_specification.rb +35 -0
  61. data/lib/rubygems/resolver/index_set.rb +74 -0
  62. data/lib/rubygems/resolver/index_specification.rb +69 -0
  63. data/lib/rubygems/resolver/installed_specification.rb +40 -0
  64. data/lib/rubygems/{dependency_resolver → resolver}/installer_set.rb +18 -17
  65. data/lib/rubygems/resolver/local_specification.rb +16 -0
  66. data/lib/rubygems/resolver/lock_set.rb +78 -0
  67. data/lib/rubygems/resolver/lock_specification.rb +58 -0
  68. data/lib/rubygems/resolver/requirement_list.rb +81 -0
  69. data/lib/rubygems/resolver/set.rb +27 -0
  70. data/lib/rubygems/resolver/spec_specification.rb +58 -0
  71. data/lib/rubygems/resolver/specification.rb +89 -0
  72. data/lib/rubygems/resolver/stats.rb +44 -0
  73. data/lib/rubygems/resolver/vendor_set.rb +83 -0
  74. data/lib/rubygems/resolver/vendor_specification.rb +24 -0
  75. data/lib/rubygems/security/trust_dir.rb +16 -2
  76. data/lib/rubygems/source.rb +71 -18
  77. data/lib/rubygems/source/git.rb +218 -0
  78. data/lib/rubygems/source/installed.rb +8 -1
  79. data/lib/rubygems/source/local.rb +14 -8
  80. data/lib/rubygems/source/lock.rb +48 -0
  81. data/lib/rubygems/source/specific_file.rb +14 -3
  82. data/lib/rubygems/source/vendor.rb +27 -0
  83. data/lib/rubygems/source_list.rb +74 -12
  84. data/lib/rubygems/spec_fetcher.rb +36 -4
  85. data/lib/rubygems/specification.rb +214 -65
  86. data/lib/rubygems/stub_specification.rb +57 -1
  87. data/lib/rubygems/syck_hack.rb +3 -3
  88. data/lib/rubygems/test_case.rb +226 -59
  89. data/lib/rubygems/test_utilities.rb +198 -0
  90. data/lib/rubygems/uninstaller.rb +22 -10
  91. data/lib/rubygems/uri_formatter.rb +20 -0
  92. data/lib/rubygems/user_interaction.rb +193 -71
  93. data/lib/rubygems/util.rb +121 -0
  94. data/lib/rubygems/util/list.rb +4 -0
  95. data/lib/rubygems/util/stringio.rb +34 -0
  96. data/lib/rubygems/validator.rb +6 -2
  97. data/lib/rubygems/version.rb +4 -8
  98. data/test/rubygems/test_bundled_ca.rb +1 -1
  99. data/test/rubygems/test_gem.rb +137 -29
  100. data/test/rubygems/test_gem_available_set.rb +19 -0
  101. data/test/rubygems/test_gem_commands_build_command.rb +1 -1
  102. data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
  103. data/test/rubygems/test_gem_commands_cleanup_command.rb +13 -13
  104. data/test/rubygems/test_gem_commands_dependency_command.rb +24 -34
  105. data/test/rubygems/test_gem_commands_fetch_command.rb +43 -48
  106. data/test/rubygems/test_gem_commands_install_command.rb +244 -279
  107. data/test/rubygems/test_gem_commands_list_command.rb +3 -3
  108. data/test/rubygems/test_gem_commands_outdated_command.rb +7 -12
  109. data/test/rubygems/test_gem_commands_pristine_command.rb +73 -27
  110. data/test/rubygems/test_gem_commands_push_command.rb +76 -8
  111. data/test/rubygems/test_gem_commands_query_command.rb +239 -49
  112. data/test/rubygems/test_gem_commands_sources_command.rb +10 -43
  113. data/test/rubygems/test_gem_commands_specification_command.rb +24 -47
  114. data/test/rubygems/test_gem_commands_stale_command.rb +2 -2
  115. data/test/rubygems/test_gem_commands_uninstall_command.rb +3 -3
  116. data/test/rubygems/test_gem_commands_unpack_command.rb +16 -30
  117. data/test/rubygems/test_gem_commands_update_command.rb +149 -134
  118. data/test/rubygems/test_gem_commands_which_command.rb +4 -2
  119. data/test/rubygems/test_gem_dependency_installer.rb +68 -0
  120. data/test/rubygems/test_gem_dependency_list.rb +17 -17
  121. data/test/rubygems/test_gem_dependency_resolution_error.rb +28 -0
  122. data/test/rubygems/test_gem_doctor.rb +1 -1
  123. data/test/rubygems/test_gem_ext_builder.rb +178 -8
  124. data/test/rubygems/test_gem_ext_cmake_builder.rb +1 -7
  125. data/test/rubygems/test_gem_ext_configure_builder.rb +8 -10
  126. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +18 -21
  127. data/test/rubygems/test_gem_ext_rake_builder.rb +1 -3
  128. data/test/rubygems/test_gem_impossible_dependencies_error.rb +10 -6
  129. data/test/rubygems/test_gem_indexer.rb +6 -6
  130. data/test/rubygems/test_gem_installer.rb +29 -10
  131. data/test/rubygems/test_gem_local_remote_options.rb +1 -1
  132. data/test/rubygems/test_gem_package.rb +18 -0
  133. data/test/rubygems/test_gem_rdoc.rb +1 -1
  134. data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
  135. data/test/rubygems/test_gem_request.rb +37 -10
  136. data/test/rubygems/test_gem_request_set.rb +271 -9
  137. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +684 -0
  138. data/test/rubygems/test_gem_request_set_lockfile.rb +849 -0
  139. data/test/rubygems/test_gem_requirement.rb +21 -0
  140. data/test/rubygems/{test_gem_dependency_resolver.rb → test_gem_resolver.rb} +231 -70
  141. data/test/rubygems/test_gem_resolver_activation_request.rb +63 -0
  142. data/test/rubygems/test_gem_resolver_api_set.rb +167 -0
  143. data/test/rubygems/test_gem_resolver_api_specification.rb +104 -0
  144. data/test/rubygems/test_gem_resolver_best_set.rb +30 -0
  145. data/test/rubygems/test_gem_resolver_conflict.rb +75 -0
  146. data/test/rubygems/test_gem_resolver_dependency_request.rb +20 -0
  147. data/test/rubygems/test_gem_resolver_git_set.rb +148 -0
  148. data/test/rubygems/test_gem_resolver_git_specification.rb +100 -0
  149. data/test/rubygems/test_gem_resolver_index_set.rb +28 -0
  150. data/test/rubygems/test_gem_resolver_index_specification.rb +89 -0
  151. data/test/rubygems/test_gem_resolver_installed_specification.rb +49 -0
  152. data/test/rubygems/test_gem_resolver_installer_set.rb +22 -0
  153. data/test/rubygems/test_gem_resolver_local_specification.rb +45 -0
  154. data/test/rubygems/test_gem_resolver_lock_set.rb +57 -0
  155. data/test/rubygems/test_gem_resolver_lock_specification.rb +87 -0
  156. data/test/rubygems/test_gem_resolver_requirement_list.rb +20 -0
  157. data/test/rubygems/test_gem_resolver_specification.rb +32 -0
  158. data/test/rubygems/test_gem_resolver_vendor_set.rb +67 -0
  159. data/test/rubygems/test_gem_resolver_vendor_specification.rb +83 -0
  160. data/test/rubygems/test_gem_server.rb +4 -4
  161. data/test/rubygems/test_gem_source.rb +54 -64
  162. data/test/rubygems/test_gem_source_git.rb +231 -0
  163. data/test/rubygems/test_gem_source_list.rb +24 -0
  164. data/test/rubygems/test_gem_source_local.rb +1 -1
  165. data/test/rubygems/test_gem_source_lock.rb +114 -0
  166. data/test/rubygems/test_gem_source_vendor.rb +27 -0
  167. data/test/rubygems/test_gem_spec_fetcher.rb +116 -61
  168. data/test/rubygems/test_gem_specification.rb +526 -94
  169. data/test/rubygems/test_gem_stub_specification.rb +123 -10
  170. data/test/rubygems/test_gem_uninstaller.rb +28 -2
  171. data/test/rubygems/test_gem_util.rb +31 -0
  172. data/test/rubygems/test_gem_validator.rb +9 -0
  173. data/util/update_bundled_ca_certificates.rb +8 -1
  174. metadata +89 -29
  175. metadata.gz.sig +2 -4
  176. data/lib/rubygems/dependency_resolver.rb +0 -254
  177. data/lib/rubygems/dependency_resolver/activation_request.rb +0 -109
  178. data/lib/rubygems/dependency_resolver/api_set.rb +0 -65
  179. data/lib/rubygems/dependency_resolver/api_specification.rb +0 -39
  180. data/lib/rubygems/dependency_resolver/composed_set.rb +0 -18
  181. data/lib/rubygems/dependency_resolver/dependency_conflict.rb +0 -85
  182. data/lib/rubygems/dependency_resolver/index_set.rb +0 -64
  183. data/lib/rubygems/dependency_resolver/index_specification.rb +0 -60
  184. data/lib/rubygems/dependency_resolver/installed_specification.rb +0 -52
  185. data/test/rubygems/test_gem_dependency_resolver_api_specification.rb +0 -33
  186. data/test/rubygems/test_gem_dependency_resolver_dependency_conflict.rb +0 -36
  187. data/test/rubygems/test_gem_dependency_resolver_index_set.rb +0 -53
  188. data/test/rubygems/test_gem_dependency_resolver_index_specification.rb +0 -73
  189. data/test/rubygems/test_gem_dependency_resolver_installed_specification.rb +0 -19
  190. data/test/rubygems/test_gem_dependency_resolver_installer_set.rb +0 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82168c6212d521d26ab68880159ab12e862140e9
4
- data.tar.gz: f86bf4836cb35a7f9f88385ab703cb1d1ef53ce9
3
+ metadata.gz: 16286e9749232be3a36bc8fe9bacd580538c2604
4
+ data.tar.gz: 9d162a488ba83c7ee731f916701915e872dd2eb6
5
5
  SHA512:
6
- metadata.gz: 4da012899ccde3d603997351752f45c1174ee10cf193bbbe83b07c683f066fbcdb20755a4f25a74cfc4c01bc49a7cfaa01452ed2527b877a631c1be100472836
7
- data.tar.gz: 8862f9304744e0ea67c7c6ab1c160f82c5cfc1ff2c2a77392d75147f975fecb7f0f8401d884b3a6342b7f3c713b489b5e8dcbc84893687b4b06d044ce2085f15
6
+ metadata.gz: 327d139d886f5df53c61cfe5f718d0b12d7fc6442dfdc6d91b0580bcdc5f0460aee4a2b39a97a6814787cd7ba3a5f254ea3eee4eae95cb21b5d0849b7f74c7d8
7
+ data.tar.gz: 2e2267811edd5a657cba4103d020a8def8dc0fd137f5153466710d933dbf00588bbd86eb76796b39731c91de7c002d9e8712092bba6948ac39b11a1bb20d5ba4
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/.autotest CHANGED
@@ -5,11 +5,14 @@ Gem.refresh
5
5
  require 'autotest/restart'
6
6
  require 'autotest/isolate'
7
7
 
8
+ Autotest.add_hook :run_command do |_, cmd|
9
+ cmd.sub! ' -e ', ' -we '
10
+ end
11
+
8
12
  Autotest.add_hook :initialize do |at|
9
13
  at.testlib = ''
10
14
 
11
15
  at.add_exception %r%/\.git/%
12
- at.add_exception %r%/\.svn/%
13
16
  at.add_exception %r%\.rbc$%
14
17
  at.add_exception %r%test/rubygems/rubygems%
15
18
 
@@ -24,20 +27,42 @@ Autotest.add_hook :initialize do |at|
24
27
  "test/rubygems/test_gem_#{m[1].gsub '/', '_'}.rb"
25
28
  end
26
29
 
27
- at.add_mapping %r%^test/support/(.*).rb$% do |_, m|
28
- at.files_matching %r%^test/rubygems/test_(.*)\.rb$%
29
- end
30
-
31
30
  args = ARGV.reject { |a| a =~ /^-/ }
32
31
  at.find_directories = args unless args.empty?
33
- end
34
32
 
35
- class Autotest
36
- alias :old_path_to_classname :path_to_classname
37
- def path_to_classname s
38
- classname = old_path_to_classname(s.sub(/test.rubygems.test_/, ""))
39
- classname = classname.gsub('Rdoc', 'RDoc')
33
+ def at.handle_results results
34
+ results = results.gsub(/\e\[\d+m/, '') # strip ascii color
35
+ failed = results.scan(self.failed_results_re).map { |m, k|
36
+ m, k = $1, $2 if m =~ /(\w+)\((\w+)\)/ # minitest 4 output
37
+ [m, k]
38
+ }
39
+
40
+ completed = results[self.completed_re]
41
+
42
+ if completed then
43
+ completed = completed.scan(/(\d+) (\w+)/).map { |v, k| [k, v.to_i] }
44
+
45
+ self.latest_results = Hash[*completed.flatten]
46
+ self.files_to_test = consolidate_failures failed
47
+
48
+ color = failed.empty? ? :green : :red
49
+ hook color unless $TESTING
50
+ else
51
+ self.latest_results = nil
52
+ end
53
+
54
+ self.tainted = true unless self.files_to_test.empty?
55
+ end
56
+
57
+ def at.path_to_classname s
58
+ sep = File::SEPARATOR
59
+
60
+ f = s.sub(/^test#{sep}rubygems#{sep}/, '').sub(/\.rb$/, '').split sep
61
+
62
+ f = f.map { |path| path.split(/_|(\d+)/).map { |seg| seg.capitalize }.join }
40
63
 
41
- classname
64
+ f.join('::').
65
+ gsub('Rdoc', 'RDoc').
66
+ gsub('GemDependencyApi', 'GemDependencyAPI')
42
67
  end
43
68
  end
data/History.txt CHANGED
@@ -1,5 +1,94 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 2.2.0.rc.1 / 2013-12-20
4
+
5
+ Major enhancements:
6
+
7
+ * RubyGems can check for gem dependencies files (gem.deps.rb or Gemfile) when
8
+ rubygems executables are started and uses the found dependencies. This
9
+ means `rake` will work similar to `bundle exec rake`. To enable this set
10
+ the `RUBYGEMS_GEMDEPS` environment variable to the location of your
11
+ dependencies file.
12
+
13
+ See Gem::use_gemdeps for further details.
14
+
15
+ * A RubyGems directory may now be shared amongst multiple ruby versions. Upon
16
+ activation RubyGems will automatically compile missing extensions for the
17
+ current platform when the built objects are missing. Issue #596 by Michal
18
+ Papis
19
+
20
+ By default different platforms do not share gem install locations so this
21
+ must be configured by setting GEM_HOME to a common directory. Some gems use
22
+ fixed paths for requiring extensions and are not compatible with sharing gem
23
+ directories.
24
+
25
+ The default sharing location may be configured by RubyGems packagers through
26
+ Gem.default_ext_dir_for. Pull Request #744 by Vít Ondruch.
27
+
28
+ Minor enhancements:
29
+
30
+ * RubyGems checks the 'allowed_push_host' metadata value when pushing a gem to
31
+ prevent an accidental push to a public repository (such as rubygems.org).
32
+ If you have private gems you should set this value in your gem specification
33
+ metadata. Pull request #603 by Seamus Abshere.
34
+ * `gem list` now shows results for multiple arguments. Pull request #604 by
35
+ Zach Rabinovich.
36
+ * `gem pristine --extensions` will restore only gems with extensions. Issue
37
+ #619 by Postmodern.
38
+ * Gem::Specification#files is now sorted. Pull request #612 by Justin George.
39
+ * For `gem list` and friends, "LOCAL" and "REMOTE" headers are omitted if
40
+ only local or remote gem information is requested with --quiet. Pull
41
+ request #615 by Michal Papis.
42
+ * Added Gem::Specification#full_require_paths which is like require_paths, but
43
+ returns a fully-qualified results. Pull request #632 by Vít Ondruch.
44
+ * RubyGems now looks for the https_proxy environment variable for https://
45
+ sources. RubyGems will fall back to http_proxy if there is no https_proxy.
46
+ Issue #610 by mkristian.
47
+ * RubyGems now creates directories in .gem files. Issue #631 by marksolaris.
48
+ * RubyGems raises an exception when a specification includes its gem. Issue
49
+ #623 by notEthan.
50
+ * RubyGems now displays relevant release note information when updating
51
+ RubyGems. Issue #647 by Trevor Wennblom.
52
+ * Deprecated Gem::Installer::ExtensionBuildError in favor of
53
+ Gem::Ext::BuildError. The old constant is an alias for the new constant.
54
+ * When extensions are built the gem_make.out file is always written now, even
55
+ on success. This will help with debugging bad builds that report success.
56
+ * If a specification fails to validate RubyGems shows a link to the
57
+ specification reference guide. Issue #656 by Markus Heiler.
58
+ * When using `gem install -g`, RubyGems now detects the presence of an
59
+ Isolate, Gemfile or gem.deps.rb file.
60
+ * Added Gem::StubSpecification#stubbed? to help determine if a user should run
61
+ `gem pristine` to speed up gem loading. Pull request #694 and #701 by Jon
62
+ Leighton.
63
+ * RubyGems now warns when a gem has a pessimistic version dependency that may
64
+ be too strict.
65
+ * RubyGems now warns when a gem has an open-ended dependency.
66
+ * RubyGems now raises an exception when a dependency for a gem is defined
67
+ twice.
68
+ * Marked the license specification attribute as recommended. Pull request
69
+ #713 by Benjamin Fleischer.
70
+ * RubyGems uses io/console instead of `stty` when available. Pull request
71
+ #740 by Nobuyoshi Nakada
72
+ * Relaxed Gem.ruby tests for platforms that override where ruby lives. Pull
73
+ Request #755 by strzibny.
74
+
75
+ Bug fixes:
76
+
77
+ * RubyGems now returns an error status when any file given to `gem which`
78
+ cannot be found. Ruby bug #9004 by Eugene Vilensky.
79
+ * Fixed command escaping when building rake extensions. Pull request #721 by
80
+ Dmitry Ratnikov.
81
+ * Fixed uninstallation of gems when GEM_HOME is a relative directory. Issue
82
+ #708 by Ryan Davis.
83
+ * Default gems are now ignored by Gem::Validator#alien. Issue #717 by David
84
+ Bahar.
85
+ * Fixed typos in RubyGems. Pull requests #723, #725, #731 by Akira Matsuda,
86
+ pull request #736 by Leo Gallucci, pull request #746 by DV Suresh.
87
+ * RubyGems now holds exclusive locks on cached gem files to prevent incorrect
88
+ updates. Pull Request #737 by Smit Shah
89
+ * Improved speed of `gem install --ignore-dependencies`. Patch by Terence
90
+ Lee.
91
+
3
92
  === 2.1.11 / 2013-11-12
4
93
 
5
94
  Bug fixes:
@@ -249,8 +338,8 @@ Bug fixes:
249
338
 
250
339
  Bug fixes:
251
340
 
252
- * Proxy usernames and passwords are now escaped properly. Ruby Bug #8979 and
253
- patch by Masahiro Tomita, Issue #668 by Kouhei Sutou.
341
+ * Proxy usernames and passwords are now escaped properly. Ruby Bug #8979 by
342
+ Masahiro Tomita, Issue #668 by Kouhei Sutou.
254
343
 
255
344
  === 2.0.11 / 2013-10-08
256
345
 
@@ -764,6 +853,14 @@ $SAFE=1. There is no functional difference compared to Ruby 2.0.0.preview2
764
853
  * URI scheme matching is no longer case-sensitive. Fixes #322
765
854
  * ext/builder now checks $MAKE as well as $make (okkez)
766
855
 
856
+ === 1.8.29 / 2013-11-23
857
+
858
+ Bug fixes:
859
+
860
+ * Fixed installation when the LANG environment variable is empty.
861
+ * Added DigiCert High Assurance EV Root CA to the default SSL certificates for
862
+ cloudfront.
863
+
767
864
  === 1.8.28 / 2013-10-08
768
865
 
769
866
  Bug fixes:
data/MIT.txt CHANGED
@@ -1,4 +1,5 @@
1
1
  Copyright (c) Chad Fowler, Rich Kilmer, Jim Weirich and others.
2
+ Portions copyright (c) Engine Yard and Andre Arko
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
data/Manifest.txt CHANGED
@@ -57,23 +57,12 @@ lib/rubygems/defaults.rb
57
57
  lib/rubygems/dependency.rb
58
58
  lib/rubygems/dependency_installer.rb
59
59
  lib/rubygems/dependency_list.rb
60
- lib/rubygems/dependency_resolver.rb
61
- lib/rubygems/dependency_resolver/activation_request.rb
62
- lib/rubygems/dependency_resolver/api_set.rb
63
- lib/rubygems/dependency_resolver/api_specification.rb
64
- lib/rubygems/dependency_resolver/composed_set.rb
65
- lib/rubygems/dependency_resolver/current_set.rb
66
- lib/rubygems/dependency_resolver/dependency_conflict.rb
67
- lib/rubygems/dependency_resolver/dependency_request.rb
68
- lib/rubygems/dependency_resolver/index_set.rb
69
- lib/rubygems/dependency_resolver/index_specification.rb
70
- lib/rubygems/dependency_resolver/installed_specification.rb
71
- lib/rubygems/dependency_resolver/installer_set.rb
72
60
  lib/rubygems/deprecate.rb
73
61
  lib/rubygems/doctor.rb
74
62
  lib/rubygems/errors.rb
75
63
  lib/rubygems/exceptions.rb
76
64
  lib/rubygems/ext.rb
65
+ lib/rubygems/ext/build_error.rb
77
66
  lib/rubygems/ext/builder.rb
78
67
  lib/rubygems/ext/cmake_builder.rb
79
68
  lib/rubygems/ext/configure_builder.rb
@@ -108,7 +97,33 @@ lib/rubygems/remote_fetcher.rb
108
97
  lib/rubygems/request.rb
109
98
  lib/rubygems/request_set.rb
110
99
  lib/rubygems/request_set/gem_dependency_api.rb
100
+ lib/rubygems/request_set/lockfile.rb
111
101
  lib/rubygems/requirement.rb
102
+ lib/rubygems/resolver.rb
103
+ lib/rubygems/resolver/activation_request.rb
104
+ lib/rubygems/resolver/api_set.rb
105
+ lib/rubygems/resolver/api_specification.rb
106
+ lib/rubygems/resolver/best_set.rb
107
+ lib/rubygems/resolver/composed_set.rb
108
+ lib/rubygems/resolver/conflict.rb
109
+ lib/rubygems/resolver/current_set.rb
110
+ lib/rubygems/resolver/dependency_request.rb
111
+ lib/rubygems/resolver/git_set.rb
112
+ lib/rubygems/resolver/git_specification.rb
113
+ lib/rubygems/resolver/index_set.rb
114
+ lib/rubygems/resolver/index_specification.rb
115
+ lib/rubygems/resolver/installed_specification.rb
116
+ lib/rubygems/resolver/installer_set.rb
117
+ lib/rubygems/resolver/local_specification.rb
118
+ lib/rubygems/resolver/lock_set.rb
119
+ lib/rubygems/resolver/lock_specification.rb
120
+ lib/rubygems/resolver/requirement_list.rb
121
+ lib/rubygems/resolver/set.rb
122
+ lib/rubygems/resolver/spec_specification.rb
123
+ lib/rubygems/resolver/specification.rb
124
+ lib/rubygems/resolver/stats.rb
125
+ lib/rubygems/resolver/vendor_set.rb
126
+ lib/rubygems/resolver/vendor_specification.rb
112
127
  lib/rubygems/security.rb
113
128
  lib/rubygems/security/policies.rb
114
129
  lib/rubygems/security/policy.rb
@@ -116,9 +131,12 @@ lib/rubygems/security/signer.rb
116
131
  lib/rubygems/security/trust_dir.rb
117
132
  lib/rubygems/server.rb
118
133
  lib/rubygems/source.rb
134
+ lib/rubygems/source/git.rb
119
135
  lib/rubygems/source/installed.rb
120
136
  lib/rubygems/source/local.rb
137
+ lib/rubygems/source/lock.rb
121
138
  lib/rubygems/source/specific_file.rb
139
+ lib/rubygems/source/vendor.rb
122
140
  lib/rubygems/source_list.rb
123
141
  lib/rubygems/source_local.rb
124
142
  lib/rubygems/source_specific_file.rb
@@ -137,7 +155,9 @@ lib/rubygems/text.rb
137
155
  lib/rubygems/uninstaller.rb
138
156
  lib/rubygems/uri_formatter.rb
139
157
  lib/rubygems/user_interaction.rb
158
+ lib/rubygems/util.rb
140
159
  lib/rubygems/util/list.rb
160
+ lib/rubygems/util/stringio.rb
141
161
  lib/rubygems/validator.rb
142
162
  lib/rubygems/version.rb
143
163
  lib/rubygems/version_option.rb
@@ -232,13 +252,7 @@ test/rubygems/test_gem_config_file.rb
232
252
  test/rubygems/test_gem_dependency.rb
233
253
  test/rubygems/test_gem_dependency_installer.rb
234
254
  test/rubygems/test_gem_dependency_list.rb
235
- test/rubygems/test_gem_dependency_resolver.rb
236
- test/rubygems/test_gem_dependency_resolver_api_specification.rb
237
- test/rubygems/test_gem_dependency_resolver_dependency_conflict.rb
238
- test/rubygems/test_gem_dependency_resolver_index_set.rb
239
- test/rubygems/test_gem_dependency_resolver_index_specification.rb
240
- test/rubygems/test_gem_dependency_resolver_installed_specification.rb
241
- test/rubygems/test_gem_dependency_resolver_installer_set.rb
255
+ test/rubygems/test_gem_dependency_resolution_error.rb
242
256
  test/rubygems/test_gem_doctor.rb
243
257
  test/rubygems/test_gem_ext_builder.rb
244
258
  test/rubygems/test_gem_ext_cmake_builder.rb
@@ -266,7 +280,29 @@ test/rubygems/test_gem_rdoc.rb
266
280
  test/rubygems/test_gem_remote_fetcher.rb
267
281
  test/rubygems/test_gem_request.rb
268
282
  test/rubygems/test_gem_request_set.rb
283
+ test/rubygems/test_gem_request_set_gem_dependency_api.rb
284
+ test/rubygems/test_gem_request_set_lockfile.rb
269
285
  test/rubygems/test_gem_requirement.rb
286
+ test/rubygems/test_gem_resolver.rb
287
+ test/rubygems/test_gem_resolver_activation_request.rb
288
+ test/rubygems/test_gem_resolver_api_set.rb
289
+ test/rubygems/test_gem_resolver_api_specification.rb
290
+ test/rubygems/test_gem_resolver_best_set.rb
291
+ test/rubygems/test_gem_resolver_conflict.rb
292
+ test/rubygems/test_gem_resolver_dependency_request.rb
293
+ test/rubygems/test_gem_resolver_git_set.rb
294
+ test/rubygems/test_gem_resolver_git_specification.rb
295
+ test/rubygems/test_gem_resolver_index_set.rb
296
+ test/rubygems/test_gem_resolver_index_specification.rb
297
+ test/rubygems/test_gem_resolver_installed_specification.rb
298
+ test/rubygems/test_gem_resolver_installer_set.rb
299
+ test/rubygems/test_gem_resolver_local_specification.rb
300
+ test/rubygems/test_gem_resolver_lock_set.rb
301
+ test/rubygems/test_gem_resolver_lock_specification.rb
302
+ test/rubygems/test_gem_resolver_requirement_list.rb
303
+ test/rubygems/test_gem_resolver_specification.rb
304
+ test/rubygems/test_gem_resolver_vendor_set.rb
305
+ test/rubygems/test_gem_resolver_vendor_specification.rb
270
306
  test/rubygems/test_gem_security.rb
271
307
  test/rubygems/test_gem_security_policy.rb
272
308
  test/rubygems/test_gem_security_signer.rb
@@ -275,10 +311,13 @@ test/rubygems/test_gem_server.rb
275
311
  test/rubygems/test_gem_silent_ui.rb
276
312
  test/rubygems/test_gem_source.rb
277
313
  test/rubygems/test_gem_source_fetch_problem.rb
314
+ test/rubygems/test_gem_source_git.rb
278
315
  test/rubygems/test_gem_source_installed.rb
279
316
  test/rubygems/test_gem_source_list.rb
280
317
  test/rubygems/test_gem_source_local.rb
318
+ test/rubygems/test_gem_source_lock.rb
281
319
  test/rubygems/test_gem_source_specific_file.rb
320
+ test/rubygems/test_gem_source_vendor.rb
282
321
  test/rubygems/test_gem_spec_fetcher.rb
283
322
  test/rubygems/test_gem_specification.rb
284
323
  test/rubygems/test_gem_stream_ui.rb
@@ -286,6 +325,7 @@ test/rubygems/test_gem_stub_specification.rb
286
325
  test/rubygems/test_gem_text.rb
287
326
  test/rubygems/test_gem_uninstaller.rb
288
327
  test/rubygems/test_gem_uri_formatter.rb
328
+ test/rubygems/test_gem_util.rb
289
329
  test/rubygems/test_gem_validator.rb
290
330
  test/rubygems/test_gem_version.rb
291
331
  test/rubygems/test_gem_version_option.rb
data/Rakefile CHANGED
@@ -95,13 +95,11 @@ rescue LoadError, RuntimeError # rake 10.1 on rdoc from ruby 1.9.2 and earlier
95
95
  end
96
96
  end
97
97
 
98
- task :clean_env do
99
- ENV.delete "GEM_HOME"
100
- ENV.delete "GEM_PATH"
98
+ desc "Install gems needed to run the tests"
99
+ task :install_test_deps => :clean_env do
100
+ sh "gem install minitest -v '~> 4.0'"
101
101
  end
102
102
 
103
- task :test => :clean_env
104
-
105
103
  # --------------------------------------------------------------------
106
104
  # Creating a release
107
105
 
@@ -344,7 +342,7 @@ def diff_with dir
344
342
  sh "diff #{diff_options} lib/rubygems.rb #{dir}/lib/rubygems.rb; true"
345
343
  sh "diff #{diff_options} lib/rubygems #{dir}/lib/rubygems; true"
346
344
  sh "diff #{diff_options} lib/rbconfig #{dir}/lib/rbconfig; true"
347
- sh "diff #{diff_options} test #{dir}/test/rubygems; true"
345
+ sh "diff #{diff_options} test/rubygems #{dir}/test/rubygems; true"
348
346
  end
349
347
 
350
348
  rubinius_dir = ENV['RUBINIUS_PATH'] || '../git.rubini.us/code'
@@ -16,7 +16,7 @@ require 'gauntlet'
16
16
  # rvsh-0.4.5 : No such file or directory - bin/rvsh
17
17
  # xen-0.1.2.1 : authors must be Array of Strings
18
18
 
19
- class GemGauntlet < Gauntlet
19
+ class GemGauntlet < Gauntlet # :nodoc:
20
20
  def run(name)
21
21
  warn name
22
22
 
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = '2.1.11'
11
+ VERSION = '2.2.0.rc.1'
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -139,6 +139,7 @@ module Gem
139
139
  build_info
140
140
  cache
141
141
  doc
142
+ extensions
142
143
  gems
143
144
  specifications
144
145
  ]
@@ -158,6 +159,7 @@ module Gem
158
159
  @path_to_default_spec_map = {}
159
160
  @platforms = []
160
161
  @ruby = nil
162
+ @ruby_api_version = nil
161
163
  @sources = nil
162
164
 
163
165
  @post_build_hooks ||= []
@@ -176,8 +178,8 @@ module Gem
176
178
  def self.try_activate path
177
179
  # finds the _latest_ version... regardless of loaded specs and their deps
178
180
  # if another gem had a requirement that would mean we shouldn't
179
- # activate the latest version, then either it would alreaby be activated
180
- # or if it was ambigious (and thus unresolved) the code in our custom
181
+ # activate the latest version, then either it would already be activated
182
+ # or if it was ambiguous (and thus unresolved) the code in our custom
181
183
  # require will try to activate the more specific version.
182
184
 
183
185
  spec = Gem::Specification.find_inactive_by_path path
@@ -213,50 +215,6 @@ module Gem
213
215
  end
214
216
  end
215
217
 
216
- def self.detect_gemdeps
217
- if path = ENV['RUBYGEMS_GEMDEPS']
218
- path = path.dup.untaint
219
-
220
- if path == "-"
221
- here = Dir.pwd.untaint
222
- start = here
223
-
224
- begin
225
- while true
226
- path = GEM_DEP_FILES.find { |f| File.file?(f) }
227
-
228
- if path
229
- path = File.join here, path
230
- break
231
- end
232
-
233
- Dir.chdir ".."
234
-
235
- # If we're at a toplevel, stop.
236
- return if Dir.pwd == here
237
-
238
- here = Dir.pwd
239
- end
240
- ensure
241
- Dir.chdir start
242
- end
243
- end
244
-
245
- path.untaint
246
-
247
- return unless File.file? path
248
-
249
- rs = Gem::RequestSet.new
250
- rs.load_gemdeps path
251
-
252
- rs.resolve_current.map do |s|
253
- sp = s.full_spec
254
- sp.activate
255
- sp
256
- end
257
- end
258
- end
259
-
260
218
  ##
261
219
  # Find the full path to the executable for gem +name+. If the +exec_name+
262
220
  # is not given, the gem's default_executable is chosen, otherwise the
@@ -300,7 +258,6 @@ module Gem
300
258
  # The path where gem executables are to be installed.
301
259
 
302
260
  def self.bindir(install_dir=Gem.dir)
303
- # TODO: move to Gem::Dirs
304
261
  return File.join install_dir, 'bin' unless
305
262
  install_dir.to_s == Gem.default_dir.to_s
306
263
  Gem.default_bindir
@@ -360,16 +317,21 @@ module Gem
360
317
  Zlib::Deflate.deflate data
361
318
  end
362
319
 
363
- # DOC: needs doc'd or :nodoc'd
320
+ # Retrieve the PathSupport object that RubyGems uses to
321
+ # lookup files.
322
+
364
323
  def self.paths
365
324
  @paths ||= Gem::PathSupport.new
366
325
  end
367
326
 
368
- # DOC: needs doc'd or :nodoc'd
327
+ # Initialize the filesystem paths to use from +env+.
328
+ # +env+ is a hash-like object (typically ENV) that
329
+ # is queried for 'GEM_HOME', 'GEM_PATH', and 'GEM_SPEC_CACHE'
330
+
369
331
  def self.paths=(env)
370
332
  clear_paths
371
333
  @paths = Gem::PathSupport.new env
372
- Gem::Specification.dirs = @paths.path # FIX: home is at end
334
+ Gem::Specification.dirs = @paths.path
373
335
  end
374
336
 
375
337
  ##
@@ -378,12 +340,10 @@ module Gem
378
340
  # FIXME deprecate these once everything else has been done -ebh
379
341
 
380
342
  def self.dir
381
- # TODO: raise "no"
382
343
  paths.home
383
344
  end
384
345
 
385
346
  def self.path
386
- # TODO: raise "no"
387
347
  paths.path
388
348
  end
389
349
 
@@ -436,6 +396,18 @@ module Gem
436
396
  File.umask old_umask
437
397
  end
438
398
 
399
+ ##
400
+ # The extension API version of ruby. This includes the static vs non-static
401
+ # distinction as extensions cannot be shared between the two.
402
+
403
+ def self.extension_api_version # :nodoc:
404
+ if 'no' == RbConfig::CONFIG['ENABLE_SHARED'] then
405
+ "#{ruby_api_version}-static"
406
+ else
407
+ ruby_api_version
408
+ end
409
+ end
410
+
439
411
  ##
440
412
  # Returns a list of paths matching +glob+ that can be used by a gem to pick
441
413
  # up features from other gems. For example:
@@ -538,42 +510,30 @@ module Gem
538
510
 
539
511
  private_class_method :find_home
540
512
 
513
+ # FIXME deprecate these in 3.0
514
+
541
515
  ##
542
516
  # Zlib::GzipReader wrapper that unzips +data+.
543
517
 
544
518
  def self.gunzip(data)
545
- # TODO: move to utils
546
- require 'stringio'
547
- require 'zlib'
548
- data = StringIO.new data
549
-
550
- unzipped = Zlib::GzipReader.new(data).read
551
- unzipped.force_encoding Encoding::BINARY if Object.const_defined? :Encoding
552
- unzipped
519
+ require 'rubygems/util'
520
+ Gem::Util.gunzip data
553
521
  end
554
522
 
555
523
  ##
556
524
  # Zlib::GzipWriter wrapper that zips +data+.
557
525
 
558
526
  def self.gzip(data)
559
- # TODO: move to utils
560
- require 'stringio'
561
- require 'zlib'
562
- zipped = StringIO.new
563
- zipped.set_encoding Encoding::BINARY if Object.const_defined? :Encoding
564
-
565
- Zlib::GzipWriter.wrap zipped do |io| io.write data end
566
-
567
- zipped.string
527
+ require 'rubygems/util'
528
+ Gem::Util.gzip data
568
529
  end
569
530
 
570
531
  ##
571
532
  # A Zlib::Inflate#inflate wrapper
572
533
 
573
534
  def self.inflate(data)
574
- # TODO: move to utils
575
- require 'zlib'
576
- Zlib::Inflate.inflate data
535
+ require 'rubygems/util'
536
+ Gem::Util.inflate data
577
537
  end
578
538
 
579
539
  ##
@@ -679,7 +639,6 @@ module Gem
679
639
  file = $1
680
640
  lineno = $2.to_i
681
641
 
682
- # TODO: it is ALWAYS joined! STUPID!
683
642
  [file, lineno]
684
643
  end
685
644
 
@@ -805,7 +764,10 @@ module Gem
805
764
  # Safely read a file in binary mode on all platforms.
806
765
 
807
766
  def self.read_binary(path)
808
- File.open path, binary_mode do |f| f.read end
767
+ open path, 'rb+' do |f|
768
+ f.flock(File::LOCK_EX)
769
+ f.read
770
+ end
809
771
  end
810
772
 
811
773
  ##
@@ -822,6 +784,14 @@ module Gem
822
784
  @ruby
823
785
  end
824
786
 
787
+ ##
788
+ # Returns a String containing the API compatibility version of Ruby
789
+
790
+ def self.ruby_api_version
791
+ @ruby_api_version ||=
792
+ "#{ConfigMap[:MAJOR]}.#{ConfigMap[:MINOR]}.#{ConfigMap[:TEENY]}"
793
+ end
794
+
825
795
  ##
826
796
  # Returns the latest release-version specification for the gem +name+.
827
797
 
@@ -952,7 +922,6 @@ module Gem
952
922
  paths = nil if paths == [nil]
953
923
  paths = paths.first if Array === Array(paths).first
954
924
  self.paths = { "GEM_HOME" => home, "GEM_PATH" => paths }
955
- # TODO: self.paths = home, paths
956
925
  end
957
926
 
958
927
  ##
@@ -1025,6 +994,56 @@ module Gem
1025
994
  load_plugin_files files
1026
995
  end
1027
996
 
997
+ ##
998
+ # Looks for gem dependency files (gem.deps.rb, Gemfile, Isolate) from the
999
+ # current directory up and activates the gems in the first file found.
1000
+ #
1001
+ # You can run this automatically when rubygems starts. To enable, set
1002
+ # the <code>RUBYGEMS_GEMDEPS</code> environment variable to either the path
1003
+ # of your Gemfile or "-" to auto-discover in parent directories.
1004
+ #
1005
+ # NOTE: Enabling automatic discovery on multiuser systems can lead to
1006
+ # execution of arbitrary code when used from directories outside your
1007
+ # control.
1008
+
1009
+ def self.use_gemdeps
1010
+ return unless path = ENV['RUBYGEMS_GEMDEPS']
1011
+ path = path.dup
1012
+
1013
+ if path == "-" then
1014
+ require 'rubygems/util'
1015
+
1016
+ Gem::Util.traverse_parents Dir.pwd do |directory|
1017
+ dep_file = GEM_DEP_FILES.find { |f| File.file?(f) }
1018
+
1019
+ next unless dep_file
1020
+
1021
+ path = File.join directory, dep_file
1022
+ break
1023
+ end
1024
+ end
1025
+
1026
+ path.untaint
1027
+
1028
+ return unless File.file? path
1029
+
1030
+ rs = Gem::RequestSet.new
1031
+ rs.load_gemdeps path
1032
+
1033
+ rs.resolve_current.map do |s|
1034
+ sp = s.full_spec
1035
+ sp.activate
1036
+ sp
1037
+ end
1038
+ end
1039
+
1040
+ class << self
1041
+ ##
1042
+ # TODO remove with RubyGems 3.0
1043
+
1044
+ alias detect_gemdeps use_gemdeps # :nodoc:
1045
+ end
1046
+
1028
1047
  # FIX: Almost everywhere else we use the `def self.` way of defining class
1029
1048
  # methods, and then we switch over to `class << self` here. Pick one or the
1030
1049
  # other.
@@ -1087,7 +1106,7 @@ module Gem
1087
1106
  end
1088
1107
 
1089
1108
  ##
1090
- # Clear default gem related varibles. It is for test
1109
+ # Clear default gem related variables. It is for test
1091
1110
 
1092
1111
  def clear_default_specs
1093
1112
  @path_to_default_spec_map.clear
@@ -1147,16 +1166,18 @@ module Gem
1147
1166
  autoload :ConfigFile, 'rubygems/config_file'
1148
1167
  autoload :Dependency, 'rubygems/dependency'
1149
1168
  autoload :DependencyList, 'rubygems/dependency_list'
1150
- autoload :DependencyResolver, 'rubygems/dependency_resolver'
1169
+ autoload :DependencyResolver, 'rubygems/resolver'
1170
+ autoload :Installer, 'rubygems/installer'
1151
1171
  autoload :PathSupport, 'rubygems/path_support'
1152
1172
  autoload :Platform, 'rubygems/platform'
1153
1173
  autoload :RequestSet, 'rubygems/request_set'
1154
1174
  autoload :Requirement, 'rubygems/requirement'
1175
+ autoload :Resolver, 'rubygems/resolver'
1176
+ autoload :Source, 'rubygems/source'
1155
1177
  autoload :SourceList, 'rubygems/source_list'
1156
1178
  autoload :SpecFetcher, 'rubygems/spec_fetcher'
1157
1179
  autoload :Specification, 'rubygems/specification'
1158
1180
  autoload :Version, 'rubygems/version'
1159
- autoload :Source, 'rubygems/source'
1160
1181
 
1161
1182
  require "rubygems/specification"
1162
1183
  end
@@ -1192,4 +1213,5 @@ Gem::Specification.load_defaults
1192
1213
  require 'rubygems/core_ext/kernel_gem'
1193
1214
  require 'rubygems/core_ext/kernel_require'
1194
1215
 
1195
- Gem.detect_gemdeps
1216
+ Gem.use_gemdeps
1217
+