]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/composite_primary_keys-2.2.2/install.rb
Rename notifier views to new style names
[rails.git] / vendor / gems / composite_primary_keys-2.2.2 / install.rb
1 require 'rbconfig'
2 require 'find'
3 require 'ftools'
4
5 include Config
6
7 # this was adapted from rdoc's install.rb by ways of Log4r
8
9 $sitedir = CONFIG["sitelibdir"]
10 unless $sitedir
11   version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
12   $libdir = File.join(CONFIG["libdir"], "ruby", version)
13   $sitedir = $:.find {|x| x =~ /site_ruby/ }
14   if !$sitedir
15     $sitedir = File.join($libdir, "site_ruby")
16   elsif $sitedir !~ Regexp.quote(version)
17     $sitedir = File.join($sitedir, version)
18   end
19 end
20
21 # the acual gruntwork
22 Dir.chdir("lib")
23
24 Find.find("composite_primary_keys", "composite_primary_keys.rb") { |f|
25   if f[-3..-1] == ".rb"
26     File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
27   else
28     File::makedirs(File.join($sitedir, *f.split(/\//)))
29   end
30 }