diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-02 07:29:08 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-02 07:29:08 +0000 |
commit | 8d488264b5177966217982740cdd152bfc4f8903 (patch) | |
tree | 4c83cd8b4b1f5c42d96e2a484664692cf87df483 /activesupport | |
parent | 998ab50974403ddc1cd166a3fe97528d344b1db4 (diff) | |
download | rails-8d488264b5177966217982740cdd152bfc4f8903.tar.gz rails-8d488264b5177966217982740cdd152bfc4f8903.tar.bz2 rails-8d488264b5177966217982740cdd152bfc4f8903.zip |
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
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/install.rb | 30 |
1 files changed, 30 insertions, 0 deletions
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 +} |