Method: #install_rb

Defined in:
lib/crazy_ivan/vendor/lockfile-1.4.3/install.rb

#install_rb(srcdir = nil, destdir = nil, mode = nil, bin = nil) ⇒ Object



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
# File 'lib/crazy_ivan/vendor/lockfile-1.4.3/install.rb', line 31

def install_rb(srcdir=nil, destdir=nil, mode=nil, bin=nil)
#{{{
  path   = []
  dir    = []
  Find.find(srcdir) do |f|
    next unless FileTest.file?(f)
    next if (f = f[srcdir.length+1..-1]) == nil
    next if (/CVS$/ =~ File.dirname(f))
    next if f =~ %r/\.lnk/
    path.push f
    dir |= [File.dirname(f)]
  end
  for f in dir
    next if f == "."
    next if f == "CVS"
    File::makedirs(File.join(destdir, f))
  end
  for f in path
    next if (/\~$/ =~ f)
    next if (/^\./ =~ File.basename(f))
    unless bin
      File::install(File.join(srcdir, f), File.join(destdir, f), mode, true)
    else
      from = File.join(srcdir, f)
      to = File.join(destdir, f)
      shebangify(from) do |sf|
        $deferr.print from, " -> ", File::catname(from, to), "\n"
        $deferr.printf "chmod %04o %s\n", mode, to 
        File::install(sf, to, mode, false)
      end
    end
  end
#}}}
end