faster_rubygems 0.11.1 → 0.12.0
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.
- data/Rakefile +4 -5
- data/VERSION +1 -1
- data/bin/faster_rubygems +2 -0
- data/lib/faster_rubygems/my_gem_prelude.rb +13 -8
- data/lib/faster_rubygems/prelude_bin_path.rb +2 -2
- data/lib/faster_rubygems/prelude_cached_load.rb +45 -45
- data/lib/faster_rubygems/prelude_create_cache.rb +1 -1
- data/lib/rubygems_plugin.rb +5 -1
- metadata +13 -13
data/Rakefile
CHANGED
@@ -11,11 +11,10 @@ faster_rubygems installed into your site_ruby directory.
|
|
11
11
|
|
12
12
|
If you're on 1.9 please set your RUBYOPT env. variable thus, to use it:
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
or (windows)
|
17
|
-
|
18
|
-
C:\>set RUBYOPT=--disable-gems -rfaster_rubygems
|
14
|
+
1.9 only:
|
15
|
+
$ export RUBYOPT=--disable-gems -rfaster_rubygems
|
16
|
+
or (windows)
|
17
|
+
C:\>set RUBYOPT=--disable-gems -rfaster_rubygems
|
19
18
|
|
20
19
|
"
|
21
20
|
s.add_development_dependency 'test-unit', '=1.2.3'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.12.0
|
data/bin/faster_rubygems
ADDED
@@ -161,8 +161,7 @@ if defined?(Gem) then
|
|
161
161
|
end
|
162
162
|
|
163
163
|
$".delete path_to_full_rubygems_library
|
164
|
-
path =
|
165
|
-
if $".any? {|path| path =~ Regexp.new('/rubygems.rb$')}
|
164
|
+
if path = $".detect {|path2| path2 =~ Regexp.new('/rubygems.rb$')}
|
166
165
|
raise LoadError, "another rubygems is already loaded from #{path}"
|
167
166
|
end
|
168
167
|
require 'rubygems'
|
@@ -292,15 +291,17 @@ if defined?(Gem) then
|
|
292
291
|
|
293
292
|
if !current_version or (current_version <=> new_version) < 0 then
|
294
293
|
GemVersions[gem_name] = new_version
|
295
|
-
GemPaths[gem_name] = File.join(gems_directory, gem_directory_name)
|
294
|
+
GemPaths[gem_name] = File.join(gems_directory, gem_directory_name) # TODO lazy load these, too...why not?
|
296
295
|
end
|
297
296
|
end
|
298
297
|
end
|
299
298
|
end
|
299
|
+
# TODO don't require iterating over all these, since you can extrapolate them from the cache files...
|
300
300
|
|
301
301
|
return unless load_them_into_the_require_path
|
302
302
|
|
303
|
-
|
303
|
+
|
304
|
+
# load all lib dirs into $:...
|
304
305
|
require_paths = []
|
305
306
|
|
306
307
|
GemPaths.each_value do |path|
|
@@ -358,7 +359,11 @@ if defined?(Gem) then
|
|
358
359
|
}
|
359
360
|
|
360
361
|
# we will use a clear cache as an indication of "non success" loading caches
|
361
|
-
|
362
|
+
if AllCaches.index(nil)
|
363
|
+
AllCaches.clear
|
364
|
+
else
|
365
|
+
# success
|
366
|
+
end
|
362
367
|
|
363
368
|
end
|
364
369
|
|
@@ -369,10 +374,10 @@ if defined?(Gem) then
|
|
369
374
|
|
370
375
|
begin
|
371
376
|
if !Gem::QuickLoader::AllCaches.empty?
|
372
|
-
puts 'faster_rubygems using caches'
|
377
|
+
puts 'faster_rubygems using caches ' + Gem::QuickLoader::AllCaches.map{|fn, contents| fn + "/.faster_rubygems_cache"}.join(' ') if $VERBOSE
|
373
378
|
Gem.calculate_all_highest_version_gems false
|
374
|
-
# use cached
|
375
|
-
require File.expand_path(File.dirname(__FILE__)) + "/prelude_cached_load"
|
379
|
+
# use cached loader instead of loading lib paths into the load path here (what prelude does by default)
|
380
|
+
require File.expand_path(File.dirname(__FILE__)) + "/prelude_cached_load.rb"
|
376
381
|
else
|
377
382
|
puts 'faster_rubygems not using caches!' if $VERBOSE
|
378
383
|
Gem.calculate_all_highest_version_gems true
|
@@ -44,13 +44,13 @@ module Gem
|
|
44
44
|
bin_path(gem_name, exec_name, *version_requirements)
|
45
45
|
end
|
46
46
|
|
47
|
-
# 1.9.1's gem_prelude doesn't have this for some reason...
|
47
|
+
# 1.9.1's gem_prelude doesn't seem to have this for some reason...
|
48
48
|
def integers_for(gem_version)
|
49
49
|
numbers = gem_version.split(".").collect {|n| n.to_i}
|
50
50
|
numbers.pop while numbers.last == 0
|
51
51
|
numbers << 0 if numbers.empty?
|
52
52
|
numbers
|
53
|
-
end
|
53
|
+
end unless Gem.respond_to?(:integers_for)
|
54
54
|
|
55
55
|
end
|
56
56
|
|
@@ -1,46 +1,46 @@
|
|
1
|
-
module Gem
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def push_all_gems_that_might_match_and_reload_files lib, error
|
19
|
-
sub_lib = lib.gsub("\\", '/').split('/')[-1].split('.')[0]
|
20
|
-
success = false
|
21
|
-
raise if AllCaches.empty? # should never be empty...
|
22
|
-
AllCaches.each{|path, gem_list|
|
23
|
-
for gem_name, long_file_list in gem_list
|
24
|
-
if long_file_list[sub_lib.downcase]
|
25
|
-
puts 'activating' + gem_name + ' ' + sub_lib.to_s if $DEBUG
|
26
|
-
if gem(gem_name)
|
27
|
-
puts 'gem activated ' + gem_name + ' ' + sub_lib if $VERBOSE || $DEBUG
|
28
|
-
success = true
|
29
|
-
end
|
30
|
-
puts 'done activeating' + gem_name + ' ' + sub_lib if $DEBUG
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
}
|
35
|
-
success
|
1
|
+
module Gem
|
2
|
+
module QuickLoader
|
3
|
+
module PreludeRequire
|
4
|
+
def require_prelude lib
|
5
|
+
begin
|
6
|
+
require_pre_prelude lib
|
7
|
+
rescue ::LoadError => e
|
8
|
+
if Gem.push_all_gems_that_might_match_and_reload_files(lib, e)
|
9
|
+
require_pre_prelude lib
|
10
|
+
else
|
11
|
+
# re-raise
|
12
|
+
raise e
|
13
|
+
end
|
14
|
+
end
|
36
15
|
end
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
16
|
+
end
|
17
|
+
|
18
|
+
def push_all_gems_that_might_match_and_reload_files lib, error
|
19
|
+
sub_lib = lib.gsub("\\", '/').split('/')[-1].split('.')[0]
|
20
|
+
success = false
|
21
|
+
raise if AllCaches.empty? # should never be empty...
|
22
|
+
AllCaches.each{|path, gem_list|
|
23
|
+
for gem_name, long_file_list in gem_list
|
24
|
+
if long_file_list[sub_lib.downcase]
|
25
|
+
puts 'activating' + gem_name + ' ' + sub_lib.to_s if $DEBUG
|
26
|
+
if gem(gem_name)
|
27
|
+
puts 'gem activated ' + gem_name + ' ' + sub_lib if $VERBOSE || $DEBUG
|
28
|
+
success = true
|
29
|
+
end
|
30
|
+
puts 'done activeating' + gem_name + ' ' + sub_lib if $DEBUG
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
}
|
35
|
+
success
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
module Kernel
|
42
|
+
include Gem::QuickLoader::PreludeRequire
|
43
|
+
alias :require_pre_prelude :require
|
44
|
+
alias :require :require_prelude
|
45
|
+
end
|
46
|
+
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/prelude_bin_path" # Gem.integers_for, for 1.9
|
|
3
3
|
module Gem
|
4
4
|
module QuickLoader
|
5
5
|
def create_cache gems_paths
|
6
|
-
puts 'faster_rubygems: creating
|
6
|
+
puts 'faster_rubygems: creating caches'
|
7
7
|
gems_paths.each do |path|
|
8
8
|
gem_versions = {}
|
9
9
|
gem_paths = {}
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -9,6 +9,10 @@ Gem.post_uninstall {
|
|
9
9
|
Gem.pre_uninstall { |gem_installer_instance, gem_spec|
|
10
10
|
|
11
11
|
if gem_installer_instance.spec.name == 'faster_rubygems' && RUBY_VERSION[0..2] == '1.8'
|
12
|
-
|
12
|
+
begin
|
13
|
+
require "faster_rubygems/unoverride" # just in case
|
14
|
+
rescue Errno::ENOENT
|
15
|
+
puts 'warning: unable to unoverride faster_rubygems--might be expected if you had several versions installed'
|
16
|
+
end
|
13
17
|
end
|
14
18
|
}
|
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:
|
4
|
+
hash: 47
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 12
|
9
|
+
- 0
|
10
|
+
version: 0.12.0
|
11
11
|
platform: ruby
|
12
12
|
authors: []
|
13
13
|
|
@@ -15,8 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
19
|
-
default_executable:
|
18
|
+
date: 2010-07-01 00:00:00 -06:00
|
19
|
+
default_executable: faster_rubygems
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: test-unit
|
@@ -98,8 +98,8 @@ dependencies:
|
|
98
98
|
version_requirements: *id005
|
99
99
|
description:
|
100
100
|
email:
|
101
|
-
executables:
|
102
|
-
|
101
|
+
executables:
|
102
|
+
- faster_rubygems
|
103
103
|
extensions:
|
104
104
|
- ext/mkrf_conf.rb
|
105
105
|
extra_rdoc_files:
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- Rakefile
|
110
110
|
- VERSION
|
111
111
|
- benchmarks.txt
|
112
|
+
- bin/faster_rubygems
|
112
113
|
- ext/mkrf_conf.rb
|
113
114
|
- internalize.rb
|
114
115
|
- lib/faster_rubygems.rb
|
@@ -141,11 +142,10 @@ post_install_message: |+
|
|
141
142
|
|
142
143
|
If you're on 1.9 please set your RUBYOPT env. variable thus, to use it:
|
143
144
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
C:>set RUBYOPT=--disable-gems -rfaster_rubygems
|
145
|
+
1.9 only:
|
146
|
+
$ export RUBYOPT=--disable-gems -rfaster_rubygems
|
147
|
+
or (windows)
|
148
|
+
C:>set RUBYOPT=--disable-gems -rfaster_rubygems
|
149
149
|
|
150
150
|
rdoc_options:
|
151
151
|
- --charset=UTF-8
|