Sha256: 563d5e687ab22b48b8a00e3d7fd9d18925aa7e3c90f0884806a6ecc4e0f61e9c

Contents?: true

Size: 1002 Bytes

Versions: 1

Compression:

Stored size: 1002 Bytes

Contents

  module FasterRubyGems
    def self.install_over_rubygems!
      raise 'only needed on 1.8 -- for 1.9 you have to \n $ export RUBYOPT=$RUBYOPT -rfaster_rubygems' if RUBY_VERSION >= '1.9.0'
      require 'fileutils'
      old = rubygems_path
      FileUtils.cp old, old + ".bak.rb"
      File.open(old, 'w') do |f|
        f.write "require 'faster_rubygems'"
      end
      'success--it will load by default in place of normal rubygems'
    end
    
    def self.rubygems_path
      Gem::Dependency
      raise unless $LOADED_FEATURES.include? "rubygems.rb"
      # now go and look for it
      $:.detect{|path| File.exist?(path + '/rubygems.rb') || File.exist?(path + '/rubygems.bak.rb')} + "/rubygems.rb"
    end
    
    def self.uninstall_over_rubygems!
      raise 'only needed on 1.8' if RUBY_VERSION >= '1.9.0'
      require 'fileutils'
      old = rubygems_path + ".bak.rb"
      FileUtils.cp old, rubygems_path
      File.delete old
      'success!'
    end
  end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
faster_rubygems-0.5.1 lib/faster_rubygems/install.rb