File: install.rb

package info (click to toggle)
libimage-size-ruby 20040618-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 204 kB
  • ctags: 27
  • sloc: ruby: 317; makefile: 64
file content (32 lines) | stat: -rwxr-xr-x 565 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env ruby

require "rbconfig"
require "ftools"
include Config

RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
DSTPATH = CONFIG["sitedir"] + "/" +  RV 

def join( *arg )
  File.join( *arg )
end

def base( name )
  File.basename( name )
end

begin
  unless FileTest.directory?( "lib" )
    raise RuntimeError.new( "'lib' not found." )
  end

  Dir[ 'lib/*.rb' ].each do | name |
    File.install( name, join( DSTPATH, base( name )), 0644, true )
  end

  puts "install succeed!"

rescue 
  puts "install failed!"
  puts $!
end