From 8d488264b5177966217982740cdd152bfc4f8903 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 2 Apr 2005 07:29:08 +0000 Subject: Added install.rbs for all frameworks and made all of them generic enough not to require maintenance #1013, #1012 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1053 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/install.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 activesupport/install.rb (limited to 'activesupport') diff --git a/activesupport/install.rb b/activesupport/install.rb new file mode 100644 index 0000000000..f84f06bdaa --- /dev/null +++ b/activesupport/install.rb @@ -0,0 +1,30 @@ +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 + +# the acual gruntwork +Dir.chdir("lib") + +Find.find("active_support", "active_support.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 +} -- cgit v1.2.3