faster_gem_script 0.1.5 → 0.1.6

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 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('fast_require')
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.5
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
- rescue
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
@@ -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 __dir__ + '/template'
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.write(full_path, contents_should_be)
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 = OS.ruby_bin.split('/')[0..-2].join('/') # strip off ruby.exe
17
+ bin_dir = Gem.ruby.split('/')[0..-2].join('/') # strip off ruby.exe
19
18
  Dir[bin_dir = '/*_bin_location'].each{|file|
20
- puts 'deleting'
19
+ puts 'faster_gem_scripts clearing cached file ' + file
21
20
  File.delete file
22
21
  }
23
22
 
@@ -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.start_with? "bin" }
5
- bin_dir = OS.ruby_bin.split('/')[0..-3].join('/')
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.start_with? "bin" }.length > 0)
17
+ FasterGemScripts.clear_caches! if (gem_installer_instance.spec.files.select{|file| file =~ /^bin/ }.length > 0)
19
18
  }
data/lib/template CHANGED
@@ -25,5 +25,5 @@ unless File.exist? cached
25
25
  end
26
26
 
27
27
  require 'faster_rubygems' if RUBY_VERSION < '1.9' # gem prelude equivalent
28
- require 'fast_require' # happiness
28
+ require 'faster_require' # happiness
29
29
  load File.read(cached)
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.5
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: fast_require
26
+ name: faster_require
27
27
  type: :runtime
28
28
  version_requirement:
29
29
  version_requirements: !ruby/object:Gem::Requirement