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