Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 50 lines (40 sloc) 1.087 kB
863c5ad Initial revision
nahi authored
1 #!/usr/bin/env ruby
2 #
90db881 * renamed http-access2 -> httpclient (HTTPAccess2::Client -> HTTPCli…
nahi authored
3 # Installer for httpclient
863c5ad Initial revision
nahi authored
4
5 require "rbconfig"
5ff4274 * use fileutils.rb instead of ftools.rb (removed from 1.9)
nahi authored
6 require "fileutils"
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
7
863c5ad Initial revision
nahi authored
8 include Config
9
5ff4274 * use fileutils.rb instead of ftools.rb (removed from 1.9)
nahi authored
10 SITELIBDIR = CONFIG["sitelibdir"]
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
11 SRCPATH = File.join(File.dirname($0), 'lib')
863c5ad Initial revision
nahi authored
12
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
13 def install_file(from, to)
5ff4274 * use fileutils.rb instead of ftools.rb (removed from 1.9)
nahi authored
14 unless File.directory?(to)
15 to = File.dirname(to)
16 end
17 to_path = File.join(to, File.basename(from))
18 unless FileTest.exist?(to_path) and FileUtils.compare_file(from, to_path)
19 FileUtils.install(from, to_path, :mode => 0644, :preserve => true, :verbose => true)
863c5ad Initial revision
nahi authored
20 end
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
21 end
863c5ad Initial revision
nahi authored
22
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
23 def install(*path)
24 from_path = File.join(SRCPATH, *path)
25 if FileTest.directory?(from_path)
26 to_path_sitelib = File.join(SITELIBDIR, *path)
27 Dir[File.join(from_path, '*.rb')].each do |name|
5ff4274 * use fileutils.rb instead of ftools.rb (removed from 1.9)
nahi authored
28 FileUtils.mkdir_p(to_path_sitelib)
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
29 install_file(name, to_path_sitelib)
30 end
31 else
62172cb * install.rb did not install cacert.p7s into libdir. Thanks to knu …
nahi authored
32 install_file(from_path, File.join(SITELIBDIR, *path))
863c5ad Initial revision
nahi authored
33 end
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
34 end
863c5ad Initial revision
nahi authored
35
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
36 begin
90db881 * renamed http-access2 -> httpclient (HTTPAccess2::Client -> HTTPCli…
nahi authored
37 install('httpclient.rb')
38 install('httpclient')
39 install('httpclient', 'cacert.p7s')
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
40 install('http-access2.rb')
41 install('http-access2')
42
43 puts "install succeed!"
863c5ad Initial revision
nahi authored
44
45 rescue
46 puts "install failed!"
60f45a4 follows soap4r's install.rb. you can run install.rb from another wor…
nahi authored
47 raise
48
863c5ad Initial revision
nahi authored
49 end
Something went wrong with that request. Please try again.