#!/usr/bin/env ruby require 'getopts' require 'rbconfig' require 'ftools' DEFAULT_RB_DIST = Config::CONFIG['sitedir'] Usage = <<")##########" Usage: ruby INSTALL.rb [Options] install Options: -n Displays the commands that would have been executed, but do not accually executed them. --rb specifies .rb file distination (default: #{DEFAULT_RB_DIST}) )########## RB = %w(benchmark.rb) getopts("n", "rb:#{DEFAULT_RB_DIST}") rb_dist = $OPT_rb notreal = $OPT_n cmd, = ARGV case cmd when "install" RB.each{|file| print "File.install(#{file}, #{rb_dist}, 0644, true)\n" File::install(file, rb_dist, 0644, true) unless notreal } else print Usage end