Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/tags/RUBY18_IMPORT/install.rb

Revision 971, 1.5 kB (checked in by nahi, 5 years ago)

Add new install directory.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to author date id revision
Line 
1 #!/usr/bin/env ruby
2
3 require 'rbconfig'
4 require 'ftools'
5
6 include Config
7
8 RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
9 DSTPATH = CONFIG["sitedir"] + "/" +  RV
10 SRCPATH = File.dirname($0)
11
12 def join(*arg)
13   File.join(*arg)
14 end
15
16 def install(from, to)
17   toPath = File.catname(from, to)
18   unless FileTest.exist?(toPath) and File.compare(from, toPath)
19     File.install(from, toPath, 0644, true)
20   end
21 end
22
23 def installDir(from, to)
24   unless FileTest.directory?(from)
25     raise RuntimeError.new("'#{ from }' not found.")
26   end
27   File.mkpath(to, true)
28   Dir[join(from, '*.rb')].each do |name|
29     install(name, to)
30   end
31 end
32
33 begin
34   installDir(
35     join(SRCPATH, 'lib', 'soap'),
36     join(DSTPATH, 'soap'))
37   installDir(
38     join(SRCPATH, 'lib', 'soap', 'rpc'),
39     join(DSTPATH, 'soap', 'rpc'))
40   installDir(
41     join(SRCPATH, 'lib', 'soap', 'mapping'),
42     join(DSTPATH, 'soap', 'mapping'))
43   installDir(
44     join(SRCPATH, 'lib', 'soap', 'encodingstyle'),
45     join(DSTPATH, 'soap', 'encodingstyle'))
46   installDir(
47     join(SRCPATH, 'lib', 'wsdl'),
48     join(DSTPATH, 'wsdl'))
49   installDir(
50     join(SRCPATH, 'lib', 'wsdl', 'xmlSchema'),
51     join(DSTPATH, 'wsdl', 'xmlSchema'))
52   installDir(
53     join(SRCPATH, 'lib', 'wsdl', 'soap'),
54     join(DSTPATH, 'wsdl', 'soap'))
55   installDir(
56     join(SRCPATH, 'lib', 'xsd'),
57     join(DSTPATH, 'xsd'))
58   installDir(
59     join(SRCPATH, 'lib', 'xsd', 'xmlparser'),
60     join(DSTPATH, 'xsd', 'xmlparser'))
61
62   puts "install succeed!"
63
64 rescue
65   puts "install failed!"
66   puts $!
67
68 end
Note: See TracBrowser for help on using the browser.