faster_gem_script 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/ext/mkrf_conf.rb +3 -1
- data/lib/faster_gem_scripts.rb +4 -5
- data/lib/rubygems_plugin.rb +3 -4
- data/lib/template +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
gemspec.homepage = "http://github.com/rdp/faster_gem_scripts"
|
7
7
|
gemspec.authors = ["Roger Pack"]
|
8
8
|
gemspec.add_dependency('sane', '>= 0.17.0')
|
9
|
-
gemspec.add_dependency('
|
9
|
+
gemspec.add_dependency('faster_require')
|
10
10
|
gemspec.add_development_dependency('rspec')
|
11
11
|
# don't need faster_rubygems here, as we auto install it
|
12
12
|
gemspec.extensions = 'ext/mkrf_conf.rb'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/ext/mkrf_conf.rb
CHANGED
@@ -10,8 +10,10 @@ require 'rubygems'
|
|
10
10
|
if RUBY_VERSION < "1.9" # need the helper
|
11
11
|
inst.install "faster_rubygems"
|
12
12
|
end
|
13
|
-
|
13
|
+
rescue => e
|
14
|
+
puts 'failed' + e + ' ' + e.backtrace.join(' ')
|
14
15
|
exit(1)
|
16
|
+
|
15
17
|
end
|
16
18
|
|
17
19
|
f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
|
data/lib/faster_gem_scripts.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
require 'sane'
|
2
1
|
|
3
2
|
class FasterGemScripts
|
4
3
|
def self.overwrite full_path
|
5
|
-
contents_should_be = File.read
|
4
|
+
contents_should_be = File.read File.dirname(__FILE__) + '/template'
|
6
5
|
if File.file?(full_path)
|
7
6
|
puts 'faster_gem_scripts: optimizing ' + full_path + '...'
|
8
|
-
File.
|
7
|
+
File.open(full_path, 'wb') do |f| f.write(contents_should_be); end
|
9
8
|
bin_loc = full_path + '_bin_location'
|
10
9
|
File.delete(bin_loc) if File.exist?(bin_loc)
|
11
10
|
else
|
@@ -15,9 +14,9 @@ class FasterGemScripts
|
|
15
14
|
|
16
15
|
def self.clear_caches!
|
17
16
|
# I only know about one type...
|
18
|
-
bin_dir =
|
17
|
+
bin_dir = Gem.ruby.split('/')[0..-2].join('/') # strip off ruby.exe
|
19
18
|
Dir[bin_dir = '/*_bin_location'].each{|file|
|
20
|
-
puts '
|
19
|
+
puts 'faster_gem_scripts clearing cached file ' + file
|
21
20
|
File.delete file
|
22
21
|
}
|
23
22
|
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
Gem.post_install { |gem_installer_instance|
|
2
|
-
require 'sane'
|
3
2
|
require 'faster_gem_scripts'
|
4
|
-
all = gem_installer_instance.spec.files.select{|file| file
|
5
|
-
bin_dir =
|
3
|
+
all = gem_installer_instance.spec.files.select{|file| file =~ /^bin/ }
|
4
|
+
bin_dir = Gem.ruby.split('/')[0..-3].join('/')
|
6
5
|
if all.length > 0
|
7
6
|
FasterGemScripts.clear_caches!
|
8
7
|
all.each{|script_name|
|
@@ -15,5 +14,5 @@ Gem.post_install { |gem_installer_instance|
|
|
15
14
|
Gem.post_uninstall {
|
16
15
|
require 'faster_gem_scripts'
|
17
16
|
require 'sane'
|
18
|
-
FasterGemScripts.clear_caches! if (gem_installer_instance.spec.files.select{|file| file
|
17
|
+
FasterGemScripts.clear_caches! if (gem_installer_instance.spec.files.select{|file| file =~ /^bin/ }.length > 0)
|
19
18
|
}
|
data/lib/template
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faster_gem_script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Pack
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
version: 0.17.0
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
26
|
+
name: faster_require
|
27
27
|
type: :runtime
|
28
28
|
version_requirement:
|
29
29
|
version_requirements: !ruby/object:Gem::Requirement
|