2007-01-22 14:43:50 +01:00
|
|
|
require 'rbconfig'
|
|
|
|
require 'find'
|
|
|
|
require 'ftools'
|
|
|
|
|
|
|
|
include Config
|
|
|
|
|
|
|
|
# this was adapted from rdoc's install.rb by ways of Log4r
|
|
|
|
|
|
|
|
$sitedir = CONFIG["sitelibdir"]
|
|
|
|
unless $sitedir
|
|
|
|
version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
|
|
|
|
$libdir = File.join(CONFIG["libdir"], "ruby", version)
|
|
|
|
$sitedir = $:.find {|x| x =~ /site_ruby/ }
|
|
|
|
if !$sitedir
|
|
|
|
$sitedir = File.join($libdir, "site_ruby")
|
|
|
|
elsif $sitedir !~ Regexp.quote(version)
|
|
|
|
$sitedir = File.join($sitedir, version)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-12-21 08:48:59 +01:00
|
|
|
# the actual gruntwork
|
2007-01-22 14:43:50 +01:00
|
|
|
Dir.chdir("lib")
|
|
|
|
|
|
|
|
Find.find("active_record", "active_record.rb") { |f|
|
|
|
|
if f[-3..-1] == ".rb"
|
|
|
|
File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
|
|
|
|
else
|
|
|
|
File::makedirs(File.join($sitedir, *f.split(/\//)))
|
|
|
|
end
|
|
|
|
}
|