Sha256: 09b0eb0b4df3c3c8d00f024f8e04f4f8903490246028baf40c17523163343eca

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

require 'sane'

class FasterGemScripts
  def self.overwrite full_path
   contents_should_be = File.read __dir__ + '/template'
   if File.file?(full_path)
     puts 'faster_gem_scripts: optimizing ' + full_path + '...'
     File.write(full_path, contents_should_be)
     bin_loc = full_path + '_bin_location'
     File.delete(bin_loc) if File.exist?(bin_loc)
   else
    puts "unable to find the binary:" + full_path + " you may want to find it and overwrite it yourself using C:\>faster_gem_script file_name (no .bat)"
   end
  end
  
  def self.clear_caches!
    # I only know about one type...
   bin_dir = OS.ruby_bin.split('/')[0..-2].join('/') # strip off ruby.exe
   Dir[bin_dir = '/*_bin_location'].each{|file|
     puts 'deleting'
     File.delete file   
   }
    
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
faster_gem_script-0.1.5 lib/faster_gem_scripts.rb
faster_gem_script-0.1.4 lib/faster_gem_scripts.rb