2004-11-24 01:04:44 +00:00
|
|
|
require 'rbconfig'
|
|
|
|
require 'find'
|
|
|
|
require 'ftools'
|
|
|
|
|
|
|
|
include Config
|
|
|
|
|
2007-05-06 04:46:11 +00:00
|
|
|
# this was adapted from rdoc's install.rb by way of Log4r
|
2004-11-24 01:04:44 +00:00
|
|
|
|
|
|
|
$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-05-06 04:46:11 +00:00
|
|
|
# the actual gruntwork
|
2004-11-24 01:04:44 +00:00
|
|
|
Dir.chdir("lib")
|
2005-04-02 07:29:08 +00:00
|
|
|
|
|
|
|
Find.find("action_controller", "action_controller.rb", "action_view", "action_view.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
|
|
|
|
}
|