rubygems-update 2.1.0.rc.1 → 2.1.0.rc.2

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 (63) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/History.txt +11 -3
  5. data/Manifest.txt +1 -0
  6. data/Rakefile +22 -18
  7. data/lib/rubygems.rb +8 -10
  8. data/lib/rubygems/basic_specification.rb +112 -108
  9. data/lib/rubygems/commands/build_command.rb +19 -0
  10. data/lib/rubygems/commands/check_command.rb +7 -0
  11. data/lib/rubygems/commands/cleanup_command.rb +5 -5
  12. data/lib/rubygems/commands/contents_command.rb +8 -0
  13. data/lib/rubygems/commands/dependency_command.rb +11 -0
  14. data/lib/rubygems/commands/environment_command.rb +3 -0
  15. data/lib/rubygems/commands/fetch_command.rb +10 -0
  16. data/lib/rubygems/commands/list_command.rb +12 -1
  17. data/lib/rubygems/commands/mirror_command.rb +6 -0
  18. data/lib/rubygems/commands/outdated_command.rb +9 -0
  19. data/lib/rubygems/commands/owner_command.rb +9 -2
  20. data/lib/rubygems/commands/pristine_command.rb +12 -11
  21. data/lib/rubygems/commands/push_command.rb +8 -2
  22. data/lib/rubygems/commands/query_command.rb +9 -0
  23. data/lib/rubygems/commands/rdoc_command.rb +6 -2
  24. data/lib/rubygems/commands/search_command.rb +14 -1
  25. data/lib/rubygems/commands/sources_command.rb +47 -0
  26. data/lib/rubygems/commands/specification_command.rb +16 -0
  27. data/lib/rubygems/commands/stale_command.rb +10 -0
  28. data/lib/rubygems/commands/uninstall_command.rb +19 -6
  29. data/lib/rubygems/commands/unpack_command.rb +18 -0
  30. data/lib/rubygems/commands/update_command.rb +9 -0
  31. data/lib/rubygems/commands/which_command.rb +11 -0
  32. data/lib/rubygems/commands/yank_command.rb +16 -2
  33. data/lib/rubygems/core_ext/kernel_require.rb +4 -4
  34. data/lib/rubygems/defaults.rb +7 -0
  35. data/lib/rubygems/dependency_installer.rb +1 -4
  36. data/lib/rubygems/ext/builder.rb +118 -0
  37. data/lib/rubygems/installer.rb +7 -60
  38. data/lib/rubygems/package_task.rb +5 -2
  39. data/lib/rubygems/remote_fetcher.rb +1 -1
  40. data/lib/rubygems/security/policy.rb +5 -0
  41. data/lib/rubygems/security/signer.rb +19 -1
  42. data/lib/rubygems/source.rb +7 -3
  43. data/lib/rubygems/source/local.rb +5 -4
  44. data/lib/rubygems/source/specific_file.rb +28 -0
  45. data/lib/rubygems/specification.rb +55 -44
  46. data/lib/rubygems/stub_specification.rb +93 -92
  47. data/lib/rubygems/test_case.rb +10 -9
  48. data/test/rubygems/test_gem.rb +27 -0
  49. data/test/rubygems/test_gem_commands_install_command.rb +1 -0
  50. data/test/rubygems/test_gem_commands_uninstall_command.rb +17 -8
  51. data/test/rubygems/test_gem_ext_builder.rb +97 -2
  52. data/test/rubygems/test_gem_installer.rb +0 -89
  53. data/test/rubygems/test_gem_package.rb +6 -8
  54. data/test/rubygems/test_gem_package_task.rb +23 -2
  55. data/test/rubygems/test_gem_security_policy.rb +11 -0
  56. data/test/rubygems/test_gem_security_signer.rb +6 -0
  57. data/test/rubygems/test_gem_source.rb +23 -0
  58. data/test/rubygems/test_gem_source_installed.rb +28 -0
  59. data/test/rubygems/test_gem_source_local.rb +29 -6
  60. data/test/rubygems/test_gem_source_specific_file.rb +38 -0
  61. data/test/rubygems/test_gem_specification.rb +10 -2
  62. metadata +7 -5
  63. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9e359df25a77bb8a4f3dd815bb9e0eb8818b51b
4
- data.tar.gz: 28c30aed29afd6a35066c34cbcd5e14e7a8caea3
3
+ metadata.gz: 7da132d518c17a925f7ab5d00e1017bd8cce49d4
4
+ data.tar.gz: ee8eb91dc1ea06f0784dc4924a2563d109ce0138
5
5
  SHA512:
6
- metadata.gz: 25d3b5b2271e8f99690a3dd3fe3162de304c57fd735974f82f471bafab1a8e8981679223c862b7a18e79f8fd66f94584a7aff00f72020ba8799422a67c975766
7
- data.tar.gz: a17143f3404896f47f4edab1684eb5ff03e51c1419e24a1b6354122fa679f1928f169e4dafb9a40adac057ebb83b6eab12f0fc209614ae1d49f3ee42acd72f50
6
+ metadata.gz: 66a6e4769192f4c73ea72e465228dfee2e3145c0bcb836398a093deb621bf7be0650ca6ca9ac4d1146887997b179aac891a007017dea8749276ae8bafc5b19b8
7
+ data.tar.gz: ae9cc7d9106c3d141b2ea1100d279f1f94b05cdd4e817dc8e22795415df9b67a8a504b0d410232b9c4ad8bc0928e3cbed8afdc41cbf0e6c76e9479ea27a1ff0c
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # coding: UTF-8
2
2
 
3
- === 2.1.0.rc.1
3
+ === 2.1.0.rc.2
4
4
 
5
5
  Major enhancements:
6
6
 
@@ -83,8 +83,16 @@ Minor enhancements:
83
83
  Bug fixes:
84
84
 
85
85
  * rubygems_plugin.rb files are now only loaded from the latest installed gem.
86
- * Altered use of cryptography in the test suite to work on JRuby, but some
87
- tests still fail on JRuby. Bug #606 by Hemant Kumar.
86
+
87
+ === 2.0.7 / 2013-08-15
88
+
89
+ * Extensions may now be built in parallel (therefore gems may be installed in
90
+ parallel). Bug #607 by Hemant Kumar.
91
+ * Changed broken link to RubyGems Bookshelf to point to RubyGems guides. Ruby
92
+ pull request #369 by 謝致邦.
93
+ * Fixed various test failures due to platform differences or poor tests.
94
+ Patches by Yui Naruse and Koichi Sasada.
95
+ * Fixed documentation for Kernel#require.
88
96
 
89
97
  === 2.0.6 / 2013-07-24
90
98
 
data/Manifest.txt CHANGED
@@ -266,6 +266,7 @@ test/rubygems/test_gem_security_trust_dir.rb
266
266
  test/rubygems/test_gem_server.rb
267
267
  test/rubygems/test_gem_silent_ui.rb
268
268
  test/rubygems/test_gem_source.rb
269
+ test/rubygems/test_gem_source_installed.rb
269
270
  test/rubygems/test_gem_source_list.rb
270
271
  test/rubygems/test_gem_source_local.rb
271
272
  test/rubygems/test_gem_source_specific_file.rb
data/Rakefile CHANGED
@@ -25,7 +25,6 @@ Hoe.plugin :git
25
25
  Hoe.plugin :travis
26
26
 
27
27
  hoe = Hoe.spec 'rubygems-update' do
28
- self.rubyforge_name = 'rubygems'
29
28
  self.author = ['Jim Weirich', 'Chad Fowler', 'Eric Hodel']
30
29
  self.email = %w[rubygems-developers@rubyforge.org]
31
30
  self.readme_file = 'README.rdoc'
@@ -60,31 +59,36 @@ hoe = Hoe.spec 'rubygems-update' do
60
59
  self.extra_rdoc_files = Dir["*.rdoc"]
61
60
 
62
61
  spec_extras['rdoc_options'] = proc do |rdoc_options|
63
- rdoc_options << "--title=RubyGems #{self.version} Documentation"
62
+ rdoc_options << "--title=RubyGems Update Documentation"
64
63
  end
65
64
 
66
65
  self.rsync_args += " --no-p -O"
67
66
 
68
- # FIX: this exists because update --system installs the gem and
69
- # doesn't uninstall it. It should uninstall or better, not install
70
- # in the first place.
71
- spec_extras['require_paths'] = %w[hide_lib_for_update] unless
72
- ENV['RAKE_SUCKS']
67
+ spec_extras['require_paths'] = %w[hide_lib_for_update]
73
68
  end
74
69
 
75
70
  hoe.test_prelude = 'gem "minitest", "~> 4.0"'
76
71
 
77
- task :docs => :rake_sucks
78
- task :rake_sucks do
79
- # This exists ENTIRELY because the rake design convention of
80
- # RDocTask.new is broken. Because most of the work is being done
81
- # inside initialize(?!?) BEFORE tasks are even running, too much
82
- # stuff is set in stone, and we can't deal with the require_paths
83
- # issue above.
84
- unless ENV['RAKE_SUCKS'] then
85
- ENV['RAKE_SUCKS'] = "1"
86
- rm_rf "doc"
87
- sh "rake docs"
72
+ Rake::Task['docs'].clear
73
+ Rake::Task['clobber_docs'].clear
74
+
75
+ begin
76
+ require 'rdoc/task'
77
+
78
+ RDoc::Task.new :rdoc => 'docs', :clobber_rdoc => 'clobber_docs' do |doc|
79
+ doc.main = hoe.readme_file
80
+ doc.title = "RubyGems #{hoe.version} API Documentation"
81
+
82
+ rdoc_files = Rake::FileList.new %w[lib History.txt LICENSE.txt MIT.txt]
83
+ rdoc_files.add hoe.extra_rdoc_files
84
+
85
+ doc.rdoc_files = rdoc_files
86
+
87
+ doc.rdoc_dir = 'doc'
88
+ end
89
+ rescue LoadError, RuntimeError # rake 10.1 on rdoc from ruby 1.9.2 and earlier
90
+ task 'docs' do
91
+ abort 'You must install rdoc to build documentation, try `rake newb` again'
88
92
  end
89
93
  end
90
94
 
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = '2.1.0.rc.1'
11
+ VERSION = '2.1.0.rc.2'
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -36,9 +36,9 @@ require 'rubygems/errors'
36
36
  #
37
37
  # Further RubyGems documentation can be found at:
38
38
  #
39
+ # * {RubyGems Guides}[http://guides.rubygems.org]
39
40
  # * {RubyGems API}[http://rubygems.rubyforge.org/rdoc] (also available from
40
41
  # <tt>gem server</tt>)
41
- # * {RubyGems Bookshelf}[http://rubygem.org]
42
42
  #
43
43
  # == RubyGems Plugins
44
44
  #
@@ -1048,16 +1048,14 @@ module Gem
1048
1048
  #
1049
1049
 
1050
1050
  def register_default_spec(spec)
1051
- new_format, prefix_pattern = nil
1051
+ new_format = Gem.default_gems_use_full_paths? || spec.require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
1052
1052
 
1053
- spec.files.each do |file|
1054
- if new_format == nil
1055
- new_format = spec.require_paths.any? {|path| file.start_with? path}
1056
-
1057
- prefix_group = spec.require_paths.map {|f| f + "/"}.join("|")
1058
- prefix_pattern = /^(#{prefix_group})/
1059
- end
1053
+ if new_format
1054
+ prefix_group = spec.require_paths.map {|f| f + "/"}.join("|")
1055
+ prefix_pattern = /^(#{prefix_group})/
1056
+ end
1060
1057
 
1058
+ spec.files.each do |file|
1061
1059
  if new_format
1062
1060
  file = file.sub(prefix_pattern, "")
1063
1061
  next unless $~
@@ -1,139 +1,143 @@
1
- module Gem
2
- # BasicSpecification is an abstract class which implements some common code used by
3
- # both Specification and StubSpecification.
4
- class BasicSpecification
5
- def self.default_specifications_dir
6
- File.join(Gem.default_dir, "specifications", "default")
7
- end
1
+ ##
2
+ # BasicSpecification is an abstract class which implements some common code
3
+ # used by both Specification and StubSpecification.
8
4
 
9
- ##
10
- # Name of the gem
5
+ class Gem::BasicSpecification
11
6
 
12
- def name
13
- raise NotImplementedError
14
- end
7
+ ##
8
+ # The path this gemspec was loaded from. This attribute is not persisted.
15
9
 
16
- ##
17
- # Version of the gem
10
+ attr_reader :loaded_from
18
11
 
19
- def version
20
- raise NotImplementedError
21
- end
12
+ def self.default_specifications_dir
13
+ File.join(Gem.default_dir, "specifications", "default")
14
+ end
22
15
 
23
- ##
24
- # Platform of the gem
16
+ ##
17
+ # True when the gem has been activated
25
18
 
26
- def platform
27
- raise NotImplementedError
28
- end
19
+ def activated?
20
+ raise NotImplementedError
21
+ end
29
22
 
30
- ##
31
- # Require paths of the gem
23
+ ##
24
+ # Returns the full path to the base gem directory.
25
+ #
26
+ # eg: /usr/local/lib/ruby/gems/1.8
27
+
28
+ def base_dir
29
+ return Gem.dir unless loaded_from
30
+ @base_dir ||= if default_gem? then
31
+ File.dirname File.dirname File.dirname loaded_from
32
+ else
33
+ File.dirname File.dirname loaded_from
34
+ end
35
+ end
32
36
 
33
- def require_paths
34
- raise NotImplementedError
35
- end
37
+ ##
38
+ # Return true if this spec can require +file+.
36
39
 
37
- ##
38
- # True when the gem has been activated
40
+ def contains_requirable_file? file
41
+ root = full_gem_path
42
+ suffixes = Gem.suffixes
39
43
 
40
- def activated?
41
- raise NotImplementedError
44
+ require_paths.any? do |lib|
45
+ base = "#{root}/#{lib}/#{file}"
46
+ suffixes.any? { |suf| File.file? "#{base}#{suf}" }
42
47
  end
48
+ end
43
49
 
44
- ##
45
- # Return a Gem::Specification from this gem
50
+ def default_gem?
51
+ loaded_from &&
52
+ File.dirname(loaded_from) == self.class.default_specifications_dir
53
+ end
46
54
 
47
- def to_spec
48
- raise NotImplementedError
49
- end
55
+ def find_full_gem_path # :nodoc:
56
+ # TODO: also, shouldn't it default to full_name if it hasn't been written?
57
+ path = File.expand_path File.join(gems_dir, full_name)
58
+ path.untaint
59
+ path if File.directory? path
60
+ end
61
+
62
+ private :find_full_gem_path
50
63
 
51
- ##
52
- # The filename of the gem specification
53
- attr_reader :filename
64
+ ##
65
+ # The full path to the gem (install path + full name).
54
66
 
55
- ##
56
- # Set the filename of the Specification was loaded from. +path+ is converted
57
- # to a String.
67
+ def full_gem_path
68
+ # TODO: This is a heavily used method by gems, so we'll need
69
+ # to aleast just alias it to #gem_dir rather than remove it.
70
+ @full_gem_path ||= find_full_gem_path
71
+ end
58
72
 
59
- def filename= path
60
- @filename = path && path.to_s
73
+ ##
74
+ # Returns the full name (name-version) of this Gem. Platform information
75
+ # is included (name-version-platform) if it is specified and not the
76
+ # default Ruby platform.
61
77
 
62
- @full_gem_path = nil
63
- @gems_dir = nil
64
- @base_dir = nil
78
+ def full_name
79
+ if platform == Gem::Platform::RUBY or platform.nil? then
80
+ "#{name}-#{version}".untaint
81
+ else
82
+ "#{name}-#{version}-#{platform}".untaint
65
83
  end
84
+ end
66
85
 
67
- ##
68
- # Return true if this spec can require +file+.
86
+ ##
87
+ # Returns the full path to the gems directory containing this spec's
88
+ # gem directory. eg: /usr/local/lib/ruby/1.8/gems
69
89
 
70
- def contains_requirable_file? file
71
- root = full_gem_path
72
- suffixes = Gem.suffixes
90
+ def gems_dir
91
+ # TODO: this logic seems terribly broken, but tests fail if just base_dir
92
+ @gems_dir ||= File.join(loaded_from && base_dir || Gem.dir, "gems")
93
+ end
73
94
 
74
- require_paths.any? do |lib|
75
- base = "#{root}/#{lib}/#{file}"
76
- suffixes.any? { |suf| File.file? "#{base}#{suf}" }
77
- end
78
- end
95
+ ##
96
+ # Set the path the Specification was loaded from. +path+ is converted to a
97
+ # String.
79
98
 
80
- ##
81
- # The full path to the gem (install path + full name).
99
+ def loaded_from= path
100
+ @loaded_from = path && path.to_s
82
101
 
83
- def full_gem_path
84
- # TODO: This is a heavily used method by gems, so we'll need
85
- # to aleast just alias it to #gem_dir rather than remove it.
86
- @full_gem_path ||= find_full_gem_path
87
- end
102
+ @full_gem_path = nil
103
+ @gems_dir = nil
104
+ @base_dir = nil
105
+ end
88
106
 
89
- # :nodoc:
90
- def find_full_gem_path
91
- # TODO: also, shouldn't it default to full_name if it hasn't been written?
92
- path = File.expand_path File.join(gems_dir, full_name)
93
- path.untaint
94
- path if File.directory? path
95
- end
96
- private :find_full_gem_path
107
+ ##
108
+ # Name of the gem
97
109
 
98
- ##
99
- # Returns the full path to the gems directory containing this spec's
100
- # gem directory. eg: /usr/local/lib/ruby/1.8/gems
110
+ def name
111
+ raise NotImplementedError
112
+ end
101
113
 
102
- def gems_dir
103
- # TODO: this logic seems terribly broken, but tests fail if just base_dir
104
- @gems_dir ||= File.join(filename && base_dir || Gem.dir, "gems")
105
- end
114
+ ##
115
+ # Platform of the gem
106
116
 
107
- ##
108
- # Returns the full path to the base gem directory.
109
- #
110
- # eg: /usr/local/lib/ruby/gems/1.8
111
-
112
- def base_dir
113
- return Gem.dir unless filename
114
- @base_dir ||= if default_gem? then
115
- File.dirname File.dirname File.dirname filename
116
- else
117
- File.dirname File.dirname filename
118
- end
119
- end
117
+ def platform
118
+ raise NotImplementedError
119
+ end
120
120
 
121
- def default_gem?
122
- filename &&
123
- File.dirname(filename) == self.class.default_specifications_dir
124
- end
121
+ ##
122
+ # Require paths of the gem
125
123
 
126
- ##
127
- # Returns the full name (name-version) of this Gem. Platform information
128
- # is included (name-version-platform) if it is specified and not the
129
- # default Ruby platform.
130
-
131
- def full_name
132
- if platform == Gem::Platform::RUBY or platform.nil? then
133
- "#{name}-#{version}".untaint
134
- else
135
- "#{name}-#{version}-#{platform}".untaint
136
- end
137
- end
124
+ def require_paths
125
+ raise NotImplementedError
138
126
  end
127
+
128
+ ##
129
+ # Return a Gem::Specification from this gem
130
+
131
+ def to_spec
132
+ raise NotImplementedError
133
+ end
134
+
135
+ ##
136
+ # Version of the gem
137
+
138
+ def version
139
+ raise NotImplementedError
140
+ end
141
+
139
142
  end
143
+
@@ -15,6 +15,25 @@ class Gem::Commands::BuildCommand < Gem::Command
15
15
  "GEMSPEC_FILE gemspec file name to build a gem for"
16
16
  end
17
17
 
18
+ def description # :nodoc:
19
+ <<-EOF
20
+ The build command allows you to create a gem from a ruby gemspec.
21
+
22
+ The best way to build a gem is to use a Rakefile and the Gem::PackageTask
23
+ which ships with RubyGems.
24
+
25
+ The gemspec can either be created by hand or extracted from an existing gem
26
+ with gem spec:
27
+
28
+ $ gem unpack my_gem-1.0.gem
29
+ Unpacked gem: '.../my_gem-1.0'
30
+ $ gem spec my_gem-1.0.gem --ruby > my_gem-1.0/my_gem-1.0.gemspec
31
+ $ cd my_gem-1.0
32
+ [edit gem contents]
33
+ $ gem build my_gem-1.0.gemspec
34
+ EOF
35
+ end
36
+
18
37
  def usage # :nodoc:
19
38
  "#{program_name} GEMSPEC_FILE"
20
39
  end
@@ -79,6 +79,13 @@ class Gem::Commands::CheckCommand < Gem::Command
79
79
  '--gems --alien'
80
80
  end
81
81
 
82
+ def description # :nodoc:
83
+ <<-EOF
84
+ The check command can list and repair problems with installed gems and
85
+ specifications and will clean up gems that have been partially uninstalled.
86
+ EOF
87
+ end
88
+
82
89
  def usage # :nodoc:
83
90
  "#{program_name} [OPTIONS] [GEMNAME ...]"
84
91
  end