faster_rubygems 0.12.1 → 0.12.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.1
1
+ 0.12.2
data/bin/faster_rubygems CHANGED
@@ -1,2 +1,11 @@
1
- puts 'faster_rubygems: attempting to recreate all caches'
2
- require "faster_rubygems/create_cache_for_all"
1
+ first = ARGV[0]
2
+ if first == "--unoverride"
3
+ require "faster_rubygems/unoverride"
4
+ elsif first == "--override"
5
+ require "faster_rubygems/override"
6
+ elsif first == '--help' || first == '-h'
7
+ puts 'syntax: --override or --unoverride (both 1.8 only) or just nothing to recreate caches'
8
+ else
9
+ puts 'faster_rubygems: attempting to recreate all caches'
10
+ require "faster_rubygems/create_cache_for_all"
11
+ end
@@ -278,6 +278,7 @@ if defined?(Gem) then
278
278
  end
279
279
 
280
280
  def calculate_all_highest_version_gems load_them_into_the_require_path
281
+ start = Time.now if $VERBOSE
281
282
  Gem.path.each do |path|
282
283
  gems_directory = File.join(path, "gems")
283
284
 
@@ -296,6 +297,7 @@ if defined?(Gem) then
296
297
  end
297
298
  end
298
299
  end
300
+ puts "faster_rubygems: took " + (Time.now - start).to_s + "s to scan the dirs for versions" if $VERBOSE
299
301
  # TODO don't require iterating over all these, since you can extrapolate them from the cache files...
300
302
 
301
303
  return unless load_them_into_the_require_path
@@ -344,9 +346,10 @@ if defined?(Gem) then
344
346
  super unless Gem.respond_to?(method)
345
347
  Gem.send(method, *args, &block)
346
348
  end
347
-
349
+
350
+ start_load = Time.now if $VERBOSE
348
351
  # if the gem dir doesn't exist, don't count it against us
349
- AllCaches = Gem.path.select{|path| File.exist?(path)}.map{|path|
352
+ AllCaches = Gem.path.select{|path| File.exist?(path)}.map{|path|
350
353
  cache_name = path + '/.faster_rubygems_cache'
351
354
  if File.exist?(cache_name)
352
355
  File.open(cache_name, 'rb') do |f|
@@ -357,6 +360,7 @@ if defined?(Gem) then
357
360
  nil
358
361
  end
359
362
  }
363
+ puts "faster_rubygems: took " + (Time.now - start_load).to_s + "s to load the cache files" if $VERBOSE
360
364
 
361
365
  # we will use a clear cache as an indication of "non success" loading caches
362
366
  if AllCaches.index(nil)
@@ -2,24 +2,19 @@ Gem.post_install {
2
2
  # accomodate for when they install more than one at a time...
3
3
  # a straight require won't cut it...
4
4
  print 'because of new gem installation '
5
- success = require "faster_rubygems/create_cache_for_all"
6
- if !success
7
- Gem.create_cache_for_all!
8
- end
5
+ load "faster_rubygems/create_cache_for_all.rb"
9
6
  }
10
7
 
11
8
  Gem.post_uninstall {
12
9
  print 'because of gem uninstallation '
13
- success = require "faster_rubygems/create_cache_for_all"
14
- if !success
15
- Gem.create_cache_for_all!
16
- end
10
+ load "faster_rubygems/create_cache_for_all.rb"
17
11
  }
18
12
 
19
13
  Gem.pre_uninstall { |gem_installer_instance|
20
- puts 'removing faster_rubygems as the default for require rubygems...'
21
14
  if gem_installer_instance.spec.name == 'faster_rubygems' && RUBY_VERSION[0..2] == '1.8'
15
+ puts 'removing faster_rubygems as the default for require rubygems...'
22
16
  begin
17
+ # don't need load here since...doing it once is enough
23
18
  require "faster_rubygems/unoverride" # just in case
24
19
  rescue Errno::ENOENT
25
20
  puts 'warning: unable to unoverride faster_rubygems--might be expected if you had several versions installed'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faster_rubygems
3
3
  version: !ruby/object:Gem::Version
4
- hash: 45
4
+ hash: 43
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 12
9
- - 1
10
- version: 0.12.1
9
+ - 2
10
+ version: 0.12.2
11
11
  platform: ruby
12
12
  authors: []
13
13
 
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-01 00:00:00 -06:00
18
+ date: 2010-07-02 00:00:00 -06:00
19
19
  default_executable: faster_rubygems
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency