faster_gem_script 0.2.1 → 0.3.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/VERSION +1 -1
- data/bin/faster_gem_script +3 -3
- data/bin/yo_bin_location +0 -0
- data/lib/faster_gem_scripts.rb +3 -1
- data/lib/{rubygems_plugin.rb → rubygems_plugin.rb.disabled} +0 -0
- data/lib/template +1 -1
- data/spec/spec.faster_gem_scripts.rb +11 -6
- metadata +20 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/bin/faster_gem_script
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'faster_gem_scripts'
|
3
|
-
if ARGV.length ==
|
4
|
-
|
3
|
+
if ARGV.length == 1
|
4
|
+
FasterGemScripts.overwrite ARGV[0]
|
5
5
|
else
|
6
|
-
|
6
|
+
puts 'syntax: script_name_to_optimize (clears caches either way)'
|
7
7
|
end
|
8
8
|
|
9
9
|
FasterGemScripts.clear_caches!
|
data/bin/yo_bin_location
ADDED
File without changes
|
data/lib/faster_gem_scripts.rb
CHANGED
@@ -15,7 +15,9 @@ class FasterGemScripts
|
|
15
15
|
def self.clear_caches!
|
16
16
|
# I only know about one type...
|
17
17
|
bin_dir = Gem.ruby.split('/')[0..-2].join('/') # strip off ruby.exe
|
18
|
-
|
18
|
+
require 'ruby-debug'
|
19
|
+
# debugger
|
20
|
+
Dir[bin_dir + '/*_bin_location'].each{|file|
|
19
21
|
puts 'faster_gem_scripts clearing cached file ' + file
|
20
22
|
File.delete file
|
21
23
|
}
|
File without changes
|
data/lib/template
CHANGED
@@ -15,7 +15,7 @@ end
|
|
15
15
|
cached = File.dirname(__FILE__) + "/#{gem_name}_bin_location"
|
16
16
|
|
17
17
|
# if we haven't cached its location yet...
|
18
|
-
|
18
|
+
if !File.exist?(cached) || File.size(cached) == 0
|
19
19
|
File.open(cached, 'w') do |f|
|
20
20
|
# then setup the cache
|
21
21
|
puts 'faster_gem_script cacheing bin location (1st time only) ' + __FILE__
|
@@ -1,10 +1,9 @@
|
|
1
|
-
require '
|
1
|
+
require 'rubygems'
|
2
2
|
require 'sane'
|
3
3
|
require_relative '../lib/faster_gem_scripts'
|
4
4
|
require 'spec/autorun'
|
5
|
-
require 'fileutils'
|
6
5
|
|
7
|
-
describe "
|
6
|
+
describe "rewriter" do
|
8
7
|
|
9
8
|
def setup
|
10
9
|
File.delete 'abc' if File.exist?('abc')
|
@@ -18,15 +17,21 @@ describe "faster rubygems" do
|
|
18
17
|
assert new_contents.contain?("faster_rubygems")
|
19
18
|
end
|
20
19
|
|
21
|
-
it "should nuke the
|
20
|
+
it "should nuke the cache on write" do
|
22
21
|
require 'fileutils'
|
23
22
|
FileUtils.touch 'abc_bin_location'
|
24
23
|
setup
|
25
24
|
assert !File.exist?('abc_bin_location')
|
26
25
|
end
|
27
26
|
|
28
|
-
it "should
|
29
|
-
|
27
|
+
it "should clear olds on request" do
|
28
|
+
old_file = File.dirname(OS.ruby_bin) + '/yo_bin_location'
|
29
|
+
FileUtils.touch old_file
|
30
|
+
ARGV << 'yoyo'
|
31
|
+
load __dir__ + '/../bin/faster_gem_script'
|
32
|
+
assert !File.exist?(old_file)
|
33
|
+
end
|
30
34
|
|
35
|
+
it 'should overwrite zero length files'
|
31
36
|
|
32
37
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faster_gem_script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Roger Pack
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
-
default_executable:
|
18
|
+
date: 2010-06-07 00:00:00 -06:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: sane
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 91
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
- 17
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: faster_require
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
version: "0"
|
@@ -47,9 +52,11 @@ dependencies:
|
|
47
52
|
name: rspec
|
48
53
|
prerelease: false
|
49
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
50
56
|
requirements:
|
51
57
|
- - ">="
|
52
58
|
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
53
60
|
segments:
|
54
61
|
- 0
|
55
62
|
version: "0"
|
@@ -59,6 +66,7 @@ description:
|
|
59
66
|
email: rogerdpack@gmail.com
|
60
67
|
executables:
|
61
68
|
- faster_gem_script
|
69
|
+
- yo_bin_location
|
62
70
|
extensions:
|
63
71
|
- ext/mkrf_conf.rb
|
64
72
|
extra_rdoc_files:
|
@@ -70,9 +78,10 @@ files:
|
|
70
78
|
- bin/faster_gem_script
|
71
79
|
- ext/mkrf_conf.rb
|
72
80
|
- lib/faster_gem_scripts.rb
|
73
|
-
- lib/rubygems_plugin.rb
|
81
|
+
- lib/rubygems_plugin.rb.disabled
|
74
82
|
- lib/template
|
75
83
|
- spec/spec.faster_gem_scripts.rb
|
84
|
+
- bin/yo_bin_location
|
76
85
|
has_rdoc: true
|
77
86
|
homepage: http://github.com/rdp/faster_gem_scripts
|
78
87
|
licenses: []
|
@@ -83,23 +92,27 @@ rdoc_options:
|
|
83
92
|
require_paths:
|
84
93
|
- lib
|
85
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
86
96
|
requirements:
|
87
97
|
- - ">="
|
88
98
|
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
89
100
|
segments:
|
90
101
|
- 0
|
91
102
|
version: "0"
|
92
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
93
105
|
requirements:
|
94
106
|
- - ">="
|
95
107
|
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
96
109
|
segments:
|
97
110
|
- 0
|
98
111
|
version: "0"
|
99
112
|
requirements: []
|
100
113
|
|
101
114
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.3.
|
115
|
+
rubygems_version: 1.3.7
|
103
116
|
signing_key:
|
104
117
|
specification_version: 3
|
105
118
|
summary: A utility to make ruby "command line scripts" run much faster by using gem prelude instead of full rubygems
|