rubygems-update 1.8.1 → 1.8.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.

data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,17 @@
1
- === 1.8.1 / 2011-05-05
1
+ === 1.8.2 / 2011-05-11
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Moved #outdated from OutdatedCommand to Specification (for Isolate).
6
+ * Print out a warning about missing executables.
7
+
8
+ * 3 bug fixes:
9
+
10
+ * Added missing requires to fix various upgrade issues.
11
+ * `gem pristine` respects multiple gem repositories.
12
+ * setup.rb now execs with --disable-gems when possible
13
+
14
+ === 1.8.1 / 2011-05-05
2
15
 
3
16
  * 1 minor enhancement:
4
17
 
@@ -120,7 +120,7 @@ require "rubygems/deprecate"
120
120
  # -The RubyGems Team
121
121
 
122
122
  module Gem
123
- VERSION = '1.8.1'
123
+ VERSION = '1.8.2'
124
124
 
125
125
  ##
126
126
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -16,7 +16,7 @@ class Gem::Commands::OutdatedCommand < Gem::Command
16
16
  end
17
17
 
18
18
  def execute
19
- outdated.sort.each do |name|
19
+ Gem::Specification.outdated.sort.each do |name|
20
20
  local = Gem::Specification.find_all_by_name(name).max
21
21
  dep = Gem::Dependency.new local.name, ">= #{local.version}"
22
22
  remotes = Gem::SpecFetcher.fetcher.fetch dep
@@ -27,21 +27,4 @@ class Gem::Commands::OutdatedCommand < Gem::Command
27
27
  say "#{local.name} (#{local.version} < #{remote.version})"
28
28
  end
29
29
  end
30
-
31
- def outdated
32
- outdateds = []
33
-
34
- fetcher = Gem::SpecFetcher.fetcher
35
-
36
- Gem::Specification.latest_specs.each do |local|
37
- dependency = Gem::Dependency.new local.name, ">= #{local.version}"
38
- remotes = fetcher.find_matching dependency
39
- remotes = remotes.map { |(_, version, _), _| version }
40
- latest = remotes.sort.last
41
-
42
- outdateds << local.name if latest and local.version < latest
43
- end
44
-
45
- outdateds
46
- end
47
30
  end
@@ -94,12 +94,13 @@ extensions.
94
94
  end
95
95
 
96
96
  # TODO use installer options
97
- installer = Gem::Installer.new gem, :wrappers => true, :force => true
97
+ installer = Gem::Installer.new(gem,
98
+ :wrappers => true,
99
+ :force => true,
100
+ :install_dir => spec.base_dir)
98
101
  installer.install
99
102
 
100
103
  say "Restored #{spec.full_name}"
101
104
  end
102
105
  end
103
-
104
106
  end
105
-
@@ -240,7 +240,7 @@ class Gem::Dependency
240
240
  # TODO: check Gem.activated_spec[self.name] in case matches falls outside
241
241
 
242
242
  if matches.empty? then
243
- specs = Gem::Specification.map(&:full_name).join ", "
243
+ specs = Gem::Specification.all_names.join ", "
244
244
  error = Gem::LoadError.new "Could not find #{name} (#{requirement}) amongst [#{specs}]"
245
245
  error.name = self.name
246
246
  error.requirement = self.requirement
@@ -1,3 +1,6 @@
1
+ require "rubygems"
2
+ require "rubygems/deprecate"
3
+
1
4
  ##
2
5
  # GemPathSearcher has the capability to find loadable files inside
3
6
  # gems. It generates data up front to speed up searches later.
@@ -4,6 +4,7 @@
4
4
  # See LICENSE.txt for permissions.
5
5
  #++
6
6
 
7
+ require "rubygems"
7
8
  require 'rubygems/command_manager'
8
9
  require 'rubygems/config_file'
9
10
  require 'rubygems/doc_manager'
@@ -283,11 +283,15 @@ class Gem::Installer
283
283
  spec.executables.each do |filename|
284
284
  filename.untaint
285
285
  bin_path = File.expand_path File.join(gem_dir, spec.bindir, filename)
286
- if File.exist? bin_path
287
- mode = File.stat(bin_path).mode | 0111
288
- FileUtils.chmod mode, bin_path
286
+
287
+ unless File.exist? bin_path
288
+ warn "Hey?!?! Where did #{bin_path} go??"
289
+ next
289
290
  end
290
291
 
292
+ mode = File.stat(bin_path).mode | 0111
293
+ FileUtils.chmod mode, bin_path
294
+
291
295
  if @wrappers then
292
296
  generate_bin_script filename, bindir
293
297
  else
@@ -569,6 +569,28 @@ class Gem::Specification
569
569
  result.gsub(/ !!null \n/, " \n")
570
570
  end
571
571
 
572
+ ##
573
+ # Return a list of all outdated specifications. This method is HEAVY
574
+ # as it must go fetch specifications from the server.
575
+
576
+ def self.outdated
577
+ outdateds = []
578
+
579
+ # TODO: maybe we should switch to rubygems' version service?
580
+ fetcher = Gem::SpecFetcher.fetcher
581
+
582
+ latest_specs.each do |local|
583
+ dependency = Gem::Dependency.new local.name, ">= #{local.version}"
584
+ remotes = fetcher.find_matching dependency
585
+ remotes = remotes.map { |(_, version, _), _| version }
586
+ latest = remotes.sort.last
587
+
588
+ outdateds << local.name if latest and local.version < latest
589
+ end
590
+
591
+ outdateds
592
+ end
593
+
572
594
  ##
573
595
  # Removes +spec+ from the known specs.
574
596
 
data/setup.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  #++
7
7
 
8
8
  # Make sure rubygems isn't already loaded.
9
- if ENV['RUBYOPT'] and defined? Gem then
9
+ if ENV['RUBYOPT'] or defined? Gem then
10
10
  ENV.delete 'RUBYOPT'
11
11
 
12
12
  require 'rbconfig'
@@ -15,7 +15,10 @@ if ENV['RUBYOPT'] and defined? Gem then
15
15
  ruby = File.join config::CONFIG['bindir'], config::CONFIG['ruby_install_name']
16
16
  ruby << config::CONFIG['EXEEXT']
17
17
 
18
- exec(ruby, 'setup.rb', *ARGV)
18
+ cmd = [ruby, 'setup.rb', *ARGV].compact
19
+ cmd[1,0] = "--disable-gems" if RUBY_VERSION > "1.9"
20
+
21
+ exec(*cmd)
19
22
  end
20
23
 
21
24
  Dir.chdir File.dirname(__FILE__)
@@ -111,6 +111,36 @@ class TestGemCommandsPristineCommand < Gem::TestCase
111
111
  assert_empty out, out.inspect
112
112
  end
113
113
 
114
+ def test_execute_many_multi_repo
115
+ a = quick_spec 'a'
116
+ install_gem a
117
+
118
+ Gem.clear_paths
119
+ gemhome2 = File.join @tempdir, 'gemhome2'
120
+ Gem.paths = { "GEM_PATH" => [gemhome2, @gemhome], "GEM_HOME" => gemhome2 }
121
+
122
+ b = quick_spec 'b'
123
+ install_gem b
124
+
125
+ @cmd.options[:args] = %w[a b]
126
+
127
+ use_ui @ui do
128
+ @cmd.execute
129
+ end
130
+
131
+ out = @ui.output.split "\n"
132
+
133
+ assert_equal "Restoring gems to pristine condition...", out.shift
134
+ assert_equal "Restored #{a.full_name}", out.shift
135
+ assert_equal "Restored #{b.full_name}", out.shift
136
+ assert_empty out, out.inspect
137
+
138
+ assert_path_exists File.join(@gemhome, "gems", 'a-2')
139
+ refute_path_exists File.join(gemhome2, "gems", 'a-2')
140
+ assert_path_exists File.join(gemhome2, "gems", 'b-2')
141
+ refute_path_exists File.join(@gemhome, "gems", 'b-2')
142
+ end
143
+
114
144
  def test_execute_missing_cache_gem
115
145
  a_2 = quick_spec 'a', 2
116
146
  a_3 = quick_spec 'a', 3
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 1
10
- version: 1.8.1
9
+ - 2
10
+ version: 1.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jim Weirich
@@ -38,7 +38,7 @@ cert_chain:
38
38
  x52qPcexcYZR7w==
39
39
  -----END CERTIFICATE-----
40
40
 
41
- date: 2011-05-06 00:00:00 Z
41
+ date: 2011-05-12 00:00:00 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: minitest
@@ -406,7 +406,7 @@ post_install_message:
406
406
  rdoc_options:
407
407
  - --main
408
408
  - README.rdoc
409
- - --title=RubyGems 1.8.1 Documentation
409
+ - --title=RubyGems 1.8.2 Documentation
410
410
  require_paths:
411
411
  - hide_lib_for_update
412
412
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -432,7 +432,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
432
432
  requirements: []
433
433
 
434
434
  rubyforge_project: rubygems
435
- rubygems_version: 1.8.0
435
+ rubygems_version: 1.8.1
436
436
  signing_key:
437
437
  specification_version: 3
438
438
  summary: RubyGems is a package management framework for Ruby
metadata.gz.sig CHANGED
Binary file