-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.rb
41 lines (34 loc) · 987 Bytes
/
install.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'rbconfig'
require 'find'
require 'ftools'
include Config
# this was adapted from active_record's install.rb
$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
# deprecated files that should be removed
# deprecated = %w{ }
# files to install in library path
files = %w-
xml/mapping.rb
xml/xxpath.rb
xml/xxpath_methods.rb
xml/mapping/base.rb
xml/mapping/standard_nodes.rb
xml/mapping/version.rb
-
# the acual gruntwork
Dir.chdir("lib")
# File::safe_unlink *deprecated.collect{|f| File.join($sitedir, f.split(/\//))}
files.each {|f|
File::makedirs(File.join($sitedir, *f.split(/\//)[0..-2]))
File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
}