Class: Sane
Class Method Summary collapse
-
.install_local! ⇒ Object
helper for installing it locally on 1.8 if you want to be able to use it without rubygems except, then you’ll still need rubygems anyway…
Class Method Details
.install_local! ⇒ Object
helper for installing it locally on 1.8 if you want to be able to use it without rubygems except, then you’ll still need rubygems anyway… I hate 1.8
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sane.rb', line 17 def self.install_local! if RUBY_VERSION >= '1.9' raise 'you dont need to install local for 1.9!' end require 'fileutils' require 'rbconfig' Dir.chdir File.dirname(__FILE__) do for file in Dir['*'] do FileUtils.cp_r file, Config::CONFIG['sitelibdir'] # copy subdirs, too end installed_sane = Config::CONFIG['sitelibdir'] + '/' + 'sane.rb' old_contents = File.read installed_sane File.write installed_sane, "require 'faster_rubygems'\n" + old_contents puts 'hardened sane with this gem version (and faster rubygems) to ' + installed_sane end end |