forked from rubyjedi/soap4r
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.rb
executable file
·68 lines (58 loc) · 1.47 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env ruby
require 'rbconfig'
require 'ftools'
include Config
RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
DSTPATH = CONFIG["sitedir"] + "/" + RV
SRCPATH = File.dirname($0)
def join(*arg)
File.join(*arg)
end
def install(from, to)
toPath = File.catname(from, to)
unless FileTest.exist?(toPath) and File.compare(from, toPath)
File.install(from, toPath, 0644, true)
end
end
def installDir(from, to)
unless FileTest.directory?(from)
raise RuntimeError.new("'#{ from }' not found.")
end
File.mkpath(to, true)
Dir[join(from, '*.rb')].each do |name|
install(name, to)
end
end
begin
installDir(
join(SRCPATH, 'lib', 'soap'),
join(DSTPATH, 'soap'))
installDir(
join(SRCPATH, 'lib', 'soap', 'rpc'),
join(DSTPATH, 'soap', 'rpc'))
installDir(
join(SRCPATH, 'lib', 'soap', 'mapping'),
join(DSTPATH, 'soap', 'mapping'))
installDir(
join(SRCPATH, 'lib', 'soap', 'encodingstyle'),
join(DSTPATH, 'soap', 'encodingstyle'))
installDir(
join(SRCPATH, 'lib', 'wsdl'),
join(DSTPATH, 'wsdl'))
installDir(
join(SRCPATH, 'lib', 'wsdl', 'xmlSchema'),
join(DSTPATH, 'wsdl', 'xmlSchema'))
installDir(
join(SRCPATH, 'lib', 'wsdl', 'soap'),
join(DSTPATH, 'wsdl', 'soap'))
installDir(
join(SRCPATH, 'lib', 'xsd'),
join(DSTPATH, 'xsd'))
installDir(
join(SRCPATH, 'lib', 'xsd', 'xmlparser'),
join(DSTPATH, 'xsd', 'xmlparser'))
puts "install succeed!"
rescue
puts "install failed!"
puts $!
end