Sha256: 09a1f629db9b5703aa0bd3fe395abf3d7fc490c7427a79f38137bb1103b3e234

Contents?: true

Size: 803 Bytes

Versions: 3

Compression:

Stored size: 803 Bytes

Contents

gem_name = File.basename(__FILE__)

if ARGV.first =~ /^_(.*)_$/
  # special version of the gem--we'll need full rubygems for this...
  require 'rubygems'
  if Gem::Version.correct? $1 then
    version = $1
    ARGV.shift
    gem gem_name, version
    load Gem.bin_path(gem_name, gem_name, version)
    exit
  end
end

cached = File.dirname(__FILE__) + "/#{gem_name}_bin_location"

# if we haven't cached its location yet...
unless File.exist? cached
 File.open(cached, 'w') do |f|
   # then setup the cache
   puts 'faster_gem_script cacheing bin location (1st time only) ' + __FILE__
   require 'rubygems'
   f.write Gem.bin_path(gem_name, gem_name, ">= 0")
 end
end

require 'faster_rubygems' if RUBY_VERSION < '1.9' # gem prelude equivalent
require 'faster_require' # happiness
load File.read(cached)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
faster_gem_script-0.2.1 lib/template
faster_gem_script-0.2.0 lib/template
faster_gem_script-0.1.6 lib/template