faster_rubygems 0.5.5 → 0.6.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.
- data/README +13 -1
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/lib/faster_rubygems/install_helper.rb +6 -4
- data/lib/faster_rubygems/install_with_faster_require_too.rb +2 -0
- data/lib/faster_rubygems.rb +19 -13
- data/lib/faster_rubygems_with_faster_require_too.rb +2 -0
- data/lib/my_gem_prelude.rb +1 -0
- data/spec/spec.faster_rubygems.rb +8 -2
- data/spec/test.spec.rb +9 -0
- metadata +9 -6
data/README
CHANGED
@@ -56,7 +56,19 @@ ruby examples/require_fast_start.rb 0.04s user 0.02s system 46% cpu 0.121 total
|
|
56
56
|
|
57
57
|
Note also that a few non conforming gems require the use of require 'rubygems' no matter what (they're pretty rare, though--you probably won't run into them, and I'm not aware of any).
|
58
58
|
|
59
|
-
|
59
|
+
|
60
|
+
== Experimental ==
|
61
|
+
|
62
|
+
If you want to be more aggressive you can try loading it with its cousin, faster_require:
|
63
|
+
|
64
|
+
$ gem install faster_require
|
65
|
+
|
66
|
+
Now use it by default:
|
67
|
+
|
68
|
+
1.9: $ export RUBYOPTS=-rfaster_rubygems_with_faster_require_too
|
69
|
+
1.8: >> require 'faster_rubygems/install_with_faster_require_too' # installs faster_rubygems, as above, but also loads faster_require along with it.
|
70
|
+
|
71
|
+
== Related projects ==
|
60
72
|
|
61
73
|
http://github.com/fabien/minigems/tree/master
|
62
74
|
1.9's gem_prelude.rb
|
data/Rakefile
CHANGED
@@ -12,13 +12,13 @@ installed! 1.9 use -> require 'faster_rubygems'
|
|
12
12
|
1.8: use require 'faster_rubygems' or install as the default thus:
|
13
13
|
|
14
14
|
>> require 'rubygems'
|
15
|
-
>> require 'faster_rubygems/install'
|
16
|
-
|
17
|
-
|
15
|
+
>> require 'faster_rubygems/install'
|
16
|
+
|
18
17
|
"
|
19
18
|
s.add_development_dependency 'test-unit', '=1.2.3'
|
20
19
|
s.add_development_dependency 'test-unit', '=2.0.6'
|
21
20
|
s.add_development_dependency 'after', '=0.7.0'
|
22
21
|
s.add_development_dependency 'sane'
|
22
|
+
# s.add_dependency 'faster_require'
|
23
23
|
|
24
24
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.4
|
@@ -1,14 +1,16 @@
|
|
1
1
|
|
2
2
|
module FasterRubyGems
|
3
|
-
def self.install_over_rubygems!
|
4
|
-
raise 'only needed on 1.8 -- for 1.9 you have to
|
3
|
+
def self.install_over_rubygems! aggressive = false
|
4
|
+
raise 'only needed on 1.8 -- for 1.9 you have to do
|
5
|
+
$ export RUBYOPT=$RUBYOPT -rfaster_rubygems' if RUBY_VERSION >= '1.9.0'
|
5
6
|
require 'fileutils'
|
6
7
|
old = rubygems_path
|
7
8
|
new = old + ".bak.rb"
|
8
|
-
raise 'cannot install twice--please uninstall first' if File.exist?(new)
|
9
|
+
raise 'cannot install twice--please run uninstall first' if File.exist?(new)
|
9
10
|
FileUtils.cp old, new
|
10
11
|
File.open(old, 'w') do |f|
|
11
|
-
f.write "require 'faster_rubygems'"
|
12
|
+
f.write "require 'faster_rubygems'\n"
|
13
|
+
f.write "require 'faster_require'" if aggressive
|
12
14
|
end
|
13
15
|
puts 'success--it will load by default in place of normal rubygems'
|
14
16
|
end
|
data/lib/faster_rubygems.rb
CHANGED
@@ -1,15 +1,21 @@
|
|
1
1
|
# :stopdoc:
|
2
|
+
|
3
|
+
# don't load it if normal rubygems is already defined
|
4
|
+
if !defined?(Gem::Dependency)
|
2
5
|
|
3
|
-
if RUBY_VERSION < '1.9.0'
|
4
|
-
raise 'rubygems was already loaded?' if defined?(Gem) && !defined?(Gem::FasterRubygems)
|
5
|
-
|
6
|
-
# define it so gem_prelude will execute...
|
7
|
-
module Gem;
|
8
|
-
module FasterRubygems; end
|
9
|
-
end
|
10
|
-
|
11
|
-
require File.dirname(__FILE__) + "/my_gem_prelude.rb"
|
12
|
-
end
|
13
|
-
|
14
|
-
# both 1.8 and 1.9 now want this one though...
|
15
|
-
require File.dirname(__FILE__) + "/prelude_bin_path"
|
6
|
+
if RUBY_VERSION < '1.9.0'
|
16
7
|
|
8
|
+
# define it so gem_prelude will execute...
|
9
|
+
module Gem;
|
10
|
+
end
|
17
11
|
|
12
|
+
require File.expand_path(File.dirname(__FILE__)) + "/my_gem_prelude.rb"
|
13
|
+
end
|
14
|
+
|
15
|
+
# both 1.8 and 1.9 want this one always though...
|
16
|
+
require File.expand_path(File.dirname(__FILE__)) + "/prelude_bin_path"
|
17
|
+
|
18
|
+
else
|
19
|
+
if $VERBOSE || $DEBUG
|
20
|
+
puts 'warning: faster_rubygems unable to load because normal rubygems already loaded (expected in certain instances, like when running the gem command)'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
data/lib/my_gem_prelude.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
# to test in 1.8.x, make sure to use ruby specname.rb
|
2
2
|
require File.dirname(__FILE__) + "/../lib/faster_rubygems"
|
3
3
|
require 'sane'
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'rspec' # rspec 2
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'spec/autorun'
|
8
|
+
rescue LoadError
|
9
|
+
# ok
|
10
|
+
end
|
11
|
+
require 'fileutils'
|
6
12
|
|
7
13
|
describe Gem do
|
8
14
|
|
data/spec/test.spec.rb
ADDED
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: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 4
|
10
|
+
version: 0.6.4
|
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-06-
|
18
|
+
date: 2010-06-22 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -99,7 +99,9 @@ files:
|
|
99
99
|
- lib/faster_rubygems.rb
|
100
100
|
- lib/faster_rubygems/install.rb
|
101
101
|
- lib/faster_rubygems/install_helper.rb
|
102
|
+
- lib/faster_rubygems/install_with_faster_require_too.rb
|
102
103
|
- lib/faster_rubygems/uninstall.rb
|
104
|
+
- lib/faster_rubygems_with_faster_require_too.rb
|
103
105
|
- lib/frubygems.rb
|
104
106
|
- lib/my_defaults.rb
|
105
107
|
- lib/my_gem_prelude.rb
|
@@ -108,6 +110,7 @@ files:
|
|
108
110
|
- spec/files/test_gem_const.rb
|
109
111
|
- spec/files/test_gem_func.rb
|
110
112
|
- spec/spec.faster_rubygems.rb
|
113
|
+
- spec/test.spec.rb
|
111
114
|
has_rdoc: true
|
112
115
|
homepage:
|
113
116
|
licenses: []
|
@@ -121,7 +124,6 @@ post_install_message: |+
|
|
121
124
|
|
122
125
|
>> require 'rubygems'
|
123
126
|
>> require 'faster_rubygems/install'
|
124
|
-
>> FasterRubyGems.install_over_rubygems!
|
125
127
|
|
126
128
|
rdoc_options:
|
127
129
|
- --charset=UTF-8
|
@@ -157,5 +159,6 @@ test_files:
|
|
157
159
|
- spec/files/test_gem_const.rb
|
158
160
|
- spec/files/test_gem_func.rb
|
159
161
|
- spec/spec.faster_rubygems.rb
|
162
|
+
- spec/test.spec.rb
|
160
163
|
- examples/require_fast_start.rb
|
161
164
|
- examples/require_rubygems_normal.rb
|