In Files

Parent

Files

Path::List

Attributes

local[R]

Public Class Methods

new(local, *globs) click to toggle source
# File lib/path/list.rb, line 9
def initialize(local, *globs)
  @local = Pathname.new(local)
end

Public Instance Methods

[](*entries) click to toggle source
# File lib/path/list.rb, line 14
def [](*entries)
  entries.each do |entry|
    case entry
    when Pathname
      push(@local + entry)
    else
      concat(Dir.glob(@local + entry).map{ |f| Pathname.new(f) })
    end
  end
  return self
end
absolute?() click to toggle source
# File lib/path/list.rb, line 69
def absolute?   ; all?{ |path| FileTest.absolute?(path)   } ; end
blockdev?() click to toggle source
# File lib/path/list.rb, line 57
def blockdev?   ; all?{ |path| FileTest.blockdev?(path)   } ; end
chardev?() click to toggle source
# File lib/path/list.rb, line 50
def chardev?    ; all?{ |path| FileTest.chardev?(path)    } ; end
chmod(mode, list, options={}) click to toggle source
# File lib/path/list.rb, line 195
def chmod(mode, list, options={})
  list = to_a
  fileutils.chmod(mode, list, options)
end
chmod_r(mode, list, options={}) click to toggle source
# File lib/path/list.rb, line 200
def chmod_r(mode, list, options={})
  list = to_a
  fileutils.chmod_r(mode, list, options)
end
chown(user, group, list, options={}) click to toggle source

alias_method :chmod_R, :chmod_r

# File lib/path/list.rb, line 206
def chown(user, group, list, options={})
  list = to_a
  fileutils.chown(user, group, list, options)
end
chown_r(user, group, list, options={}) click to toggle source
# File lib/path/list.rb, line 211
def chown_r(user, group, list, options={})
  list = to_a
  fileutils.chown_r(user, group, list, options)
end
cmp(other) click to toggle source
Alias for: identical?
compare_file(other) click to toggle source
Alias for: identical?
copy(dest, options={}) click to toggle source
Alias for: cp
cp(dest, options={}) click to toggle source

cp(list, dir, options={})

# File lib/path/list.rb, line 146
def cp(dest, options={})
  src  = to_a
  #dest = localize(dest)
  fileutils.cp(src, dest, options)
end
Also aliased as: copy
cp_r(dest, options={}) click to toggle source

cp_r(list, dir, options={})

# File lib/path/list.rb, line 154
def cp_r(dest, options={})
  src  = to_a
  #dest = localize(dest)
  fileutils.cp_r(src, dest, options)
end
dir?() click to toggle source
Alias for: directory?
directory?() click to toggle source
# File lib/path/list.rb, line 47
def directory?  ; all?{ |path| FileTest.directory?(path)  } ; end
Also aliased as: dir?
entries() click to toggle source

relative to local

# File lib/path/list.rb, line 27
def entries
  map{ |entry| entry.sub(local+'/','') }
end
executable?() click to toggle source
# File lib/path/list.rb, line 64
def executable? ; all?{ |path| FileTest.executable?(path) } ; end
executable_real?() click to toggle source
# File lib/path/list.rb, line 72
def executable_real? ; all?{ |path| FileTest.executable_real?(path) } ; end
exist?() click to toggle source
# File lib/path/list.rb, line 51
def exist?      ; all?{ |path| FileTest.exist?(path)      } ; end
exists?() click to toggle source
# File lib/path/list.rb, line 52
def exists?     ; all?{ |path| FileTest.exists?(path)     } ; end
file?() click to toggle source
# File lib/path/list.rb, line 55
def file?       ; all?{ |path| FileTest.file?(path)       } ; end
grpowned?() click to toggle source
# File lib/path/list.rb, line 58
def grpowned?   ; all?{ |path| FileTest.grpowned?(path)   } ; end
identical?(other) click to toggle source
# File lib/path/list.rb, line 77
def identical?(other)
  all?{ |path| FileTest.identical?(path, other)  }
end
Also aliased as: compare_file, cmp
install(src, dest, mode, options={}) click to toggle source
# File lib/path/list.rb, line 189
def install(src, dest, mode, options={})
  src  = to_a
  #dest = localize(dest)
  fileutils.install(src, dest, mode, options)
end
ln(new, options={}) click to toggle source

ln(list, destdir, options={})

# File lib/path/list.rb, line 124
def ln(new, options={})
  src = to_a
  #new = localize(new)
  fileutils.ln(src, new, options)
end
Also aliased as: link
ln_s(new, options={}) click to toggle source

ln_s(list, destdir, options={})

# File lib/path/list.rb, line 132
def ln_s(new, options={})
  src = to_a
  #new = localize(new)
  fileutils.ln_s(src, new, options)
end
Also aliased as: symlink
ln_sf(new, options={}) click to toggle source
# File lib/path/list.rb, line 139
def ln_sf(new, options={})
  src = to_a
  #new = localize(new)
  fileutils.ln_sf(src, new, options)
end
mkdir(options={}) click to toggle source
# File lib/path/list.rb, line 110
def mkdir(options={})
  map{ |dir| fileutils.mkdir(dir, options) }
end
mkdir_p(options={}) click to toggle source
# File lib/path/list.rb, line 114
def mkdir_p(options={})
  map{ |dir| fileutils.mkdir_p(dir, options) }
end
Also aliased as: mkpath
mkpath(options={}) click to toggle source
Alias for: mkdir_p
move(dest, options={}) click to toggle source
Alias for: mv
mv(dest, options={}) click to toggle source

mv(list, dir, options={})

# File lib/path/list.rb, line 161
def mv(dest, options={})
  src  = to_a
  #dest = localize(dest)
  fileutils.mv(src, dest, options)
end
Also aliased as: move
outofdate?(path) click to toggle source
# File lib/path/list.rb, line 243
def outofdate?(path)
  fileutils.outofdate?(path, to_a)
end
owned?() click to toggle source
# File lib/path/list.rb, line 62
def owned?      ; all?{ |path| FileTest.owned?(path)      } ; end
pipe?() click to toggle source
# File lib/path/list.rb, line 54
def pipe?       ; all?{ |path| FileTest.pipe?(path)       } ; end
pwd() click to toggle source

Present working directory. (?)

# File lib/path/list.rb, line 105
def pwd
  @local
end
readable?() click to toggle source
# File lib/path/list.rb, line 49
def readable?   ; all?{ |path| FileTest.readable?(path)   } ; end
readable_real?() click to toggle source
# File lib/path/list.rb, line 73
def readable_real?   ; all?{ |path| FileTest.readable_real?(path)   } ; end
relative?() click to toggle source

Will these work since all paths are localized?

# File lib/path/list.rb, line 68
def relative?   ; all?{ |path| FileTest.relative?(path)   } ; end
remove(options={}) click to toggle source
Alias for: rm
rm(options={}) click to toggle source
# File lib/path/list.rb, line 168
def rm(options={})
  list = to_a
  fileutils.rm(list, options)
end
Also aliased as: remove
rm_f(list, options={}) click to toggle source
# File lib/path/list.rb, line 179
def rm_f(list, options={})
  list = to_a
  fileutils.rm_f(list, options)
end
rm_r(options={}) click to toggle source
# File lib/path/list.rb, line 174
def rm_r(options={})
  list = to_a
  fileutils.rm_r(list, options)
end
rm_rf(list, options={}) click to toggle source
# File lib/path/list.rb, line 184
def rm_rf(list, options={})
  list = to_a
  fileutils.rm_rf(list, options)
end
rmdir(options={}) click to toggle source
# File lib/path/list.rb, line 119
def rmdir(options={})
  map{ |dir| fileutils.rmdir(dir, options) }
end
safe?() click to toggle source
# File lib/path/list.rb, line 65
def safe?       ; all?{ |path| FileTest.safe?(path)       } ; end
setgid?() click to toggle source
# File lib/path/list.rb, line 59
def setgid?     ; all?{ |path| FileTest.setgid?(path)     } ; end
setuid?() click to toggle source
# File lib/path/list.rb, line 60
def setuid?     ; all?{ |path| FileTest.setuid?(path)     } ; end
size() click to toggle source
# File lib/path/list.rb, line 42
def size
  inject(0){ |sum, path| sum + FileTest.size(path) }
end
Also aliased as: size?
size?() click to toggle source
Alias for: size
socket?() click to toggle source
# File lib/path/list.rb, line 61
def socket?     ; all?{ |path| FileTest.socket?(path)     } ; end
stage(dir) click to toggle source
# File lib/path/list.rb, line 223
def stage(dir)
  #dir   = localize(directory)
  #files = localize(files)
  #fileutils.stage(dir, work, entries)
  fileutils.stage(dir, local, entries)
end
sticky?() click to toggle source
# File lib/path/list.rb, line 56
def sticky?     ; all?{ |path| FileTest.sticky?(path)     } ; end
touch(list, options={}) click to toggle source

alias_method :chown_R, :chown_r

# File lib/path/list.rb, line 217
def touch(list, options={})
  list = to_a
  fileutils.touch(list, options)
end
uptodate?(path) click to toggle source
# File lib/path/list.rb, line 248
def uptodate?(path)
  fileutils.uptodate?(path, to_a)
end
writable?() click to toggle source
# File lib/path/list.rb, line 63
def writable?   ; all?{ |path| FileTest.writable?(path)   } ; end
writable_real?() click to toggle source
# File lib/path/list.rb, line 71
def writable_real?   ; all?{ |path| FileTest.writable_real?(path)   } ; end
zero?() click to toggle source
# File lib/path/list.rb, line 53
def zero?       ; all?{ |path| FileTest.zero?(path)       } ; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.