rubygems-update 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (47) 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 +42 -1
  5. data/Manifest.txt +0 -2
  6. data/Rakefile +0 -1
  7. data/lib/rubygems.rb +7 -2
  8. data/lib/rubygems/commands/help_command.rb +9 -1
  9. data/lib/rubygems/commands/list_command.rb +4 -6
  10. data/lib/rubygems/commands/owner_command.rb +1 -1
  11. data/lib/rubygems/commands/pristine_command.rb +5 -4
  12. data/lib/rubygems/commands/push_command.rb +2 -1
  13. data/lib/rubygems/commands/search_command.rb +17 -3
  14. data/lib/rubygems/commands/setup_command.rb +35 -23
  15. data/lib/rubygems/commands/specification_command.rb +1 -1
  16. data/lib/rubygems/commands/update_command.rb +1 -1
  17. data/lib/rubygems/core_ext/kernel_require.rb +8 -0
  18. data/lib/rubygems/defaults.rb +3 -1
  19. data/lib/rubygems/dependency_installer.rb +0 -1
  20. data/lib/rubygems/dependency_resolver.rb +1 -1
  21. data/lib/rubygems/errors.rb +2 -2
  22. data/lib/rubygems/ext/builder.rb +8 -3
  23. data/lib/rubygems/ext/ext_conf_builder.rb +1 -0
  24. data/lib/rubygems/gemcutter_utilities.rb +14 -4
  25. data/lib/rubygems/installer.rb +9 -2
  26. data/lib/rubygems/package.rb +0 -1
  27. data/lib/rubygems/platform.rb +2 -0
  28. data/lib/rubygems/psych_tree.rb +4 -0
  29. data/lib/rubygems/specification.rb +24 -26
  30. data/lib/rubygems/test_case.rb +58 -0
  31. data/test/rubygems/test_gem.rb +4 -2
  32. data/test/rubygems/test_gem_commands_help_command.rb +5 -0
  33. data/test/rubygems/test_gem_commands_owner_command.rb +12 -0
  34. data/test/rubygems/test_gem_commands_push_command.rb +16 -0
  35. data/test/rubygems/test_gem_commands_setup_command.rb +52 -0
  36. data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
  37. data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
  38. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +8 -13
  39. data/test/rubygems/test_gem_gemcutter_utilities.rb +23 -0
  40. data/test/rubygems/test_gem_installer.rb +15 -0
  41. data/test/rubygems/test_gem_package.rb +3 -1
  42. data/test/rubygems/test_gem_spec_fetcher.rb +3 -1
  43. data/test/rubygems/test_gem_specification.rb +25 -1
  44. metadata +6 -23
  45. metadata.gz.sig +0 -0
  46. data/test/rubygems/insure_session.rb +0 -43
  47. data/test/rubygems/test_gem_commands_search_command.rb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3715c090bb9c46a51a84c8eca827fd3bd7ac44c8
4
- data.tar.gz: 80c3d4c9042d3c70b4f4581ccbbe6d13608f6b8c
3
+ metadata.gz: 23d91223aab36769e7bd55ec6a42800a4b8d9f40
4
+ data.tar.gz: b5190f2902a2fe929a7c27a0864a2f0d087e749f
5
5
  SHA512:
6
- metadata.gz: 56f3726b20096af80cc5772b838ff6ff4eb44fb0479d6855795730d163f07635a7a854bf2cc4ea9dee77cd6b83ced4c47af7e805496aff6c2fefe318b3cdc162
7
- data.tar.gz: 1960e19c702fcdea527e28e95c9f94b3eb790fa58eb9dcb57073516524e23e46db38e5310903f0f009ae50dd121157e48c5130b7f88cf40759d519244e29d4bf
6
+ metadata.gz: f96281ae469f202368eab4524a800b4d9f0dc389b6628afc5c0a3d70981dac6c069d0a4e058dddfe10a1c6e753ed3d69c69bb4ffc22f1575673b89eb393d4d28
7
+ data.tar.gz: cb3f3ff170c6d6b680f72cfe9b296f335f3dc5d5564ffeba7df037808fa4696892754c107fbaf94b8698b37253f2d7106f3378e34c018c9dd9647e6f185d32dc
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,6 +1,47 @@
1
1
  # coding: UTF-8
2
2
 
3
- === 2.0.3 / 2012-03-1
3
+ === 2.0.4 / 2013-07-09
4
+
5
+ Bug fixes:
6
+
7
+ * Fixed error caused by gem install not finding the right platform for your
8
+ platform. Bug #576 by John Anderson
9
+ * Fixed pushing gems with the default host. Bug #495 by Utkarsh Kukreti
10
+ * Improved unhelpful error message from `gem owner --remove`. Bug #488 by
11
+ Steve Klabnik
12
+ * Fixed typo in `gem spec` help. Pull request #563 by oooooooo
13
+ * Fixed creation of build_info with --install-dir. Bug #457 by Vít Ondruch.
14
+ * RubyGems converts non-string dependency names to strings now. Bug #505 by
15
+ Terence Lee
16
+ * Outdated prerelease versions are now listed in `gem outdated`.
17
+ * RubyGems now only calls fsync() on the specification when installing, not
18
+ every file from the gem. This improves the performance of gem installation
19
+ on some systems. Pull Request #556 by Grzesiek Kolodziejczyk
20
+ * Removed surprise search term anchoring in `gem search` to restore 1.8-like
21
+ search behavior while still defaulting to --remote. Pull request #562 by
22
+ Ben Bleything
23
+ * Fixed handling of DESTDIR when building extensions. Pull request #573 by
24
+ Akinori MUSHA
25
+ * Fixed documentation of `gem pristine` defaults (--all is not a default).
26
+ Pull request #577 by Shannon Skipper
27
+ * Fixed a windows extension-building test failure. Pull request #575 by
28
+ Hiroshi Shirosaki
29
+ * Fixed issue with `gem update` where it would attempt to use a Version
30
+ instead of a Requirement to find the latest gem. Fixes #570 by Nick Cox.
31
+ * RubyGems now ignores an empty but set RUBYGEMS_HOST environment variable.
32
+ Based on pull request #558 by Robin Dupret.
33
+ * Removed duplicate creation of gem subdirectories in
34
+ Gem::DependencyInstaller. Pull Request #456 by Vít Ondruch
35
+ * RubyGems now works with Ruby built with `--with-ruby-version=''`. Pull
36
+ Request #455 by Vít Ondruch
37
+ * Fixed race condition when two threads require the same gem. Ruby bug report
38
+ #8374 by Joel VanderWerf
39
+ * Cleaned up siteconf between extension build and extension install. Pull
40
+ request #587 by Dominic Cleal
41
+ * Fix deprecation warnings when converting gemspecs to yaml. Ruby commit
42
+ r41148 by Yui Naruse
43
+
44
+ === 2.0.3 / 2013-03-11
4
45
 
5
46
  * Bug fixes:
6
47
  * Reverted automatic upgrade to HTTPS as it breaks RubyGems APIs. Fixes
data/Manifest.txt CHANGED
@@ -142,7 +142,6 @@ test/rubygems/good_rake.rb
142
142
  test/rubygems/grandchild_cert.pem
143
143
  test/rubygems/grandchild_cert_32.pem
144
144
  test/rubygems/grandchild_key.pem
145
- test/rubygems/insure_session.rb
146
145
  test/rubygems/invalid_issuer_cert.pem
147
146
  test/rubygems/invalid_issuer_cert_32.pem
148
147
  test/rubygems/invalid_key.pem
@@ -189,7 +188,6 @@ test/rubygems/test_gem_commands_owner_command.rb
189
188
  test/rubygems/test_gem_commands_pristine_command.rb
190
189
  test/rubygems/test_gem_commands_push_command.rb
191
190
  test/rubygems/test_gem_commands_query_command.rb
192
- test/rubygems/test_gem_commands_search_command.rb
193
191
  test/rubygems/test_gem_commands_server_command.rb
194
192
  test/rubygems/test_gem_commands_setup_command.rb
195
193
  test/rubygems/test_gem_commands_sources_command.rb
data/Rakefile CHANGED
@@ -50,7 +50,6 @@ hoe = Hoe.spec 'rubygems-update' do
50
50
 
51
51
  extra_dev_deps << ['builder', '~> 2.1']
52
52
  extra_dev_deps << ['hoe-seattlerb', '~> 1.2']
53
- extra_dev_deps << ['session', '~> 2.4']
54
53
  extra_dev_deps << ['rdoc', '~> 3.0']
55
54
  extra_dev_deps << ['ZenTest', '~> 4.5']
56
55
  extra_dev_deps << ['rake', '~> 0.9.3']
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = '2.0.3'
11
+ VERSION = '2.0.4'
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -173,7 +173,12 @@ module Gem
173
173
  # require will try to activate the more specific version.
174
174
 
175
175
  spec = Gem::Specification.find_inactive_by_path path
176
- return false unless spec
176
+
177
+ unless spec
178
+ spec = Gem::Specification.find_by_path path
179
+ return true if spec && spec.activated?
180
+ return false
181
+ end
177
182
 
178
183
  begin
179
184
  spec.activate
@@ -113,7 +113,15 @@ platform.
113
113
  format = "#{' ' * margin_width}%-#{desc_width}s%s"
114
114
 
115
115
  command_manager.command_names.each do |cmd_name|
116
- summary = command_manager[cmd_name].summary
116
+ command = command_manager[cmd_name]
117
+
118
+ summary =
119
+ if command then
120
+ command.summary
121
+ else
122
+ "[No command found for #{cmd_name}, bug?]"
123
+ end
124
+
117
125
  summary = wrap(summary, summary_width).split "\n"
118
126
  out << sprintf(format, cmd_name, summary.shift)
119
127
  until summary.empty? do
@@ -7,9 +7,8 @@ require 'rubygems/commands/query_command'
7
7
 
8
8
  class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
9
9
 
10
- def initialize(name = 'list',
11
- summary = 'Display gems whose name starts with STRING')
12
- super name, summary
10
+ def initialize
11
+ super 'list', 'Display gems whose name starts with STRING'
13
12
 
14
13
  remove_option('--name-matches')
15
14
  end
@@ -27,9 +26,8 @@ class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
27
26
  end
28
27
 
29
28
  def execute
30
- name = get_one_optional_argument || ''
31
- options[:name] = /^#{name}/i
32
-
29
+ string = get_one_optional_argument || ''
30
+ options[:name] = /^#{string}/i
33
31
  super
34
32
  end
35
33
 
@@ -73,7 +73,7 @@ class Gem::Commands::OwnerCommand < Gem::Command
73
73
  request.add_field "Authorization", api_key
74
74
  end
75
75
 
76
- with_response response
76
+ with_response response, "Removing #{owner}"
77
77
  rescue
78
78
  # ignore
79
79
  end
@@ -10,7 +10,8 @@ class Gem::Commands::PristineCommand < Gem::Command
10
10
  def initialize
11
11
  super 'pristine',
12
12
  'Restores installed gems to pristine condition from files located in the gem cache',
13
- :version => Gem::Requirement.default, :extensions => true,
13
+ :version => Gem::Requirement.default,
14
+ :extensions => true,
14
15
  :all => false
15
16
 
16
17
  add_option('--all',
@@ -37,7 +38,7 @@ class Gem::Commands::PristineCommand < Gem::Command
37
38
  end
38
39
 
39
40
  def defaults_str # :nodoc:
40
- "--all --extensions"
41
+ '--extensions'
41
42
  end
42
43
 
43
44
  def description # :nodoc:
@@ -52,8 +53,8 @@ for the gem are regenerated.
52
53
  If the cached gem cannot be found, you will need to use `gem install` to
53
54
  revert the gem.
54
55
 
55
- If --no-extensions is provided pristine will not attempt to restore gems with
56
- extensions.
56
+ If --no-extensions is provided pristine will not attempt to restore gems
57
+ with extensions.
57
58
  EOF
58
59
  end
59
60
 
@@ -20,7 +20,8 @@ class Gem::Commands::PushCommand < Gem::Command
20
20
  end
21
21
 
22
22
  def initialize
23
- super 'push', description
23
+ super 'push', description, :host => self.host
24
+
24
25
  add_proxy_option
25
26
  add_key_option
26
27
 
@@ -1,17 +1,31 @@
1
1
  require 'rubygems/command'
2
- require 'rubygems/commands/list_command'
2
+ require 'rubygems/commands/query_command'
3
3
 
4
- class Gem::Commands::SearchCommand < Gem::Commands::ListCommand
4
+ class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand
5
5
 
6
6
  def initialize
7
7
  super 'search', 'Display all gems whose name contains STRING'
8
8
 
9
- @defaults[:domain] = :remote
9
+ remove_option '--name-matches'
10
+ end
11
+
12
+ def arguments # :nodoc:
13
+ "STRING fragment of gem name to search for"
10
14
  end
11
15
 
12
16
  def defaults_str # :nodoc:
13
17
  "--remote --no-details"
14
18
  end
15
19
 
20
+ def usage # :nodoc:
21
+ "#{program_name} [STRING]"
22
+ end
23
+
24
+ def execute
25
+ string = get_one_optional_argument
26
+ options[:name] = /#{string}/i
27
+ super
28
+ end
29
+
16
30
  end
17
31
 
@@ -159,29 +159,7 @@ By default, this RubyGems will install gem as:
159
159
 
160
160
  options[:previous_version] = Gem::Version.new(options[:previous_version])
161
161
 
162
- release_notes = File.join Dir.pwd, 'History.txt'
163
-
164
- release_notes = if File.exist? release_notes then
165
- history = File.read release_notes
166
- history = history.sub(/^# coding:.*?^=/m, '')
167
-
168
- text = history.split(HISTORY_HEADER)
169
- text.shift # correct an off-by-one generated by split
170
- version_lines = history.scan(HISTORY_HEADER)
171
- versions = history.scan(VERSION_MATCHER).flatten.map { |x| Gem::Version.new(x) }
172
-
173
- history_string = ""
174
-
175
- until versions.length == 0 or versions.shift < options[:previous_version]
176
- history_string += version_lines.shift + text.shift
177
- end
178
-
179
- history_string
180
- else
181
- "Oh-no! Unable to find release notes!"
182
- end
183
-
184
- say release_notes
162
+ show_release_notes
185
163
 
186
164
  say
187
165
  say "-" * 78
@@ -458,6 +436,40 @@ abort "#{deprecation_message}"
458
436
  end
459
437
  end
460
438
 
439
+ def show_release_notes
440
+ release_notes = File.join Dir.pwd, 'History.txt'
441
+
442
+ release_notes =
443
+ if File.exist? release_notes then
444
+ history = File.read release_notes
445
+
446
+ history.force_encoding Encoding::UTF_8 if
447
+ Object.const_defined? :Encoding
448
+
449
+ history = history.sub(/^# coding:.*?^=/m, '')
450
+
451
+ text = history.split(HISTORY_HEADER)
452
+ text.shift # correct an off-by-one generated by split
453
+ version_lines = history.scan(HISTORY_HEADER)
454
+ versions = history.scan(VERSION_MATCHER).flatten.map do |x|
455
+ Gem::Version.new(x)
456
+ end
457
+
458
+ history_string = ""
459
+
460
+ until versions.length == 0 or
461
+ versions.shift < options[:previous_version] do
462
+ history_string += version_lines.shift + text.shift
463
+ end
464
+
465
+ history_string
466
+ else
467
+ "Oh-no! Unable to find release notes!"
468
+ end
469
+
470
+ say release_notes
471
+ end
472
+
461
473
  def uninstall_old_gemcutter
462
474
  require 'rubygems/uninstaller'
463
475
 
@@ -28,7 +28,7 @@ class Gem::Commands::SpecificationCommand < Gem::Command
28
28
  options[:format] = :ruby
29
29
  end
30
30
 
31
- add_option('--yaml', 'Output RUBY format') do |value, options|
31
+ add_option('--yaml', 'Output YAML format') do |value, options|
32
32
  options[:format] = :yaml
33
33
  end
34
34
 
@@ -94,7 +94,7 @@ class Gem::Commands::UpdateCommand < Gem::Command
94
94
 
95
95
  say "Updating #{name}"
96
96
  begin
97
- @installer.install name, version
97
+ @installer.install name, Gem::Requirement.new(version)
98
98
  success = true
99
99
  rescue Gem::InstallError => e
100
100
  alert_error "Error installing #{name}:\n\t#{e.message}"
@@ -4,6 +4,8 @@
4
4
  # See LICENSE.txt for permissions.
5
5
  #++
6
6
 
7
+ require 'monitor'
8
+
7
9
  module Kernel
8
10
 
9
11
  if defined?(gem_original_require) then
@@ -31,7 +33,11 @@ module Kernel
31
33
  # The normal <tt>require</tt> functionality of returning false if
32
34
  # that file has already been loaded is preserved.
33
35
 
36
+ ACTIVATION_MONITOR = Monitor.new
37
+
34
38
  def require path
39
+ ACTIVATION_MONITOR.enter
40
+
35
41
  spec = Gem.find_unresolved_default_spec(path)
36
42
  if spec
37
43
  Gem.remove_unresolved_default_spec(spec)
@@ -111,6 +117,8 @@ module Kernel
111
117
  end
112
118
 
113
119
  raise load_error
120
+ ensure
121
+ ACTIVATION_MONITOR.exit
114
122
  end
115
123
 
116
124
  private :require
@@ -54,7 +54,9 @@ module Gem
54
54
  # Path for gems in the user's home directory
55
55
 
56
56
  def self.user_dir
57
- File.join Gem.user_home, '.gem', ruby_engine, ConfigMap[:ruby_version]
57
+ parts = [Gem.user_home, '.gem', ruby_engine]
58
+ parts << ConfigMap[:ruby_version] unless ConfigMap[:ruby_version].empty?
59
+ File.join parts
58
60
  end
59
61
 
60
62
  ##
@@ -63,7 +63,6 @@ class Gem::DependencyInstaller
63
63
  # HACK shouldn't change the global settings, needed for -i behavior
64
64
  # maybe move to the install command? See also github #442
65
65
  Gem::Specification.dirs = @install_dir
66
- Gem.ensure_gem_subdirectories @install_dir
67
66
  end
68
67
 
69
68
  options = DEFAULT_OPTIONS.merge options
@@ -349,7 +349,7 @@ module Gem
349
349
  when Dependency
350
350
  @dependency == other
351
351
  when DependencyRequest
352
- @dependency == other.dep && @requester == other.requester
352
+ @dependency == other.dependency && @requester == other.requester
353
353
  else
354
354
  false
355
355
  end
@@ -62,10 +62,10 @@ module Gem
62
62
  ##
63
63
  # A wordy description of the error.
64
64
  def wordy
65
- "Found %s (%), but was for platform%s %s" %
65
+ "Found %s (%s), but was for platform%s %s" %
66
66
  [@name,
67
67
  @version,
68
- @platforms.size == 1 ? 's' : '',
68
+ @platforms.size == 1 ? '' : 's',
69
69
  @platforms.join(' ,')]
70
70
  end
71
71
  end
@@ -23,9 +23,14 @@ class Gem::Ext::Builder
23
23
  make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
24
24
  end
25
25
 
26
- ['', ' install'].each do |target|
27
- cmd = "#{make_program}#{target}"
28
- run(cmd, results, "make#{target}")
26
+ ['', 'install'].each do |target|
27
+ # Pass DESTDIR via command line to override what's in MAKEFLAGS
28
+ cmd = [
29
+ make_program,
30
+ '"DESTDIR=%s"' % ENV['DESTDIR'],
31
+ target
32
+ ].join(' ').rstrip
33
+ run(cmd, results, "make #{target}".rstrip)
29
34
  end
30
35
  end
31
36
 
@@ -37,6 +37,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
37
37
  run cmd, results
38
38
 
39
39
  ENV["DESTDIR"] = nil
40
+ siteconf.unlink
40
41
 
41
42
  make dest_path, results
42
43
 
@@ -38,7 +38,7 @@ module Gem::GemcutterUtilities
38
38
 
39
39
  say "Enter your #{pretty_host} credentials."
40
40
  say "Don't have an account yet? " +
41
- "Create one at https://#{sign_in_host}/sign_up"
41
+ "Create one at #{sign_in_host}/sign_up"
42
42
 
43
43
  email = ask " Email: "
44
44
  password = ask_for_password "Password: "
@@ -60,7 +60,14 @@ module Gem::GemcutterUtilities
60
60
  configured_host = Gem.host unless
61
61
  Gem.configuration.disable_default_gem_server
62
62
 
63
- @host ||= ENV['RUBYGEMS_HOST'] || configured_host
63
+ @host ||=
64
+ begin
65
+ env_rubygems_host = ENV['RUBYGEMS_HOST']
66
+ env_rubygems_host = nil if
67
+ env_rubygems_host and env_rubygems_host.empty?
68
+
69
+ env_rubygems_host|| configured_host
70
+ end
64
71
  end
65
72
 
66
73
  def rubygems_api_request(method, path, host = nil, &block)
@@ -79,7 +86,7 @@ module Gem::GemcutterUtilities
79
86
  Gem::RemoteFetcher.fetcher.request(uri, request_method, &block)
80
87
  end
81
88
 
82
- def with_response(resp)
89
+ def with_response resp, error_prefix = nil
83
90
  case resp
84
91
  when Net::HTTPSuccess then
85
92
  if block_given? then
@@ -88,7 +95,10 @@ module Gem::GemcutterUtilities
88
95
  say resp.body
89
96
  end
90
97
  else
91
- say resp.body
98
+ message = resp.body
99
+ message = "#{error_prefix}: #{message}" if error_prefix
100
+
101
+ say message
92
102
  terminate_interaction 1 # TODO: question this
93
103
  end
94
104
  end