class Pione::Util::FTPLocalFS
Attributes
directory[R]
file[R]
mtime[R]
Public Class Methods
new(base)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 229 def initialize(base) @base = base end
Public Instance Methods
delete_file(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 249 def delete_file(path) merge(path).delete end
directory?(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 233 def directory?(path) merge(path).directory? end
entries(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 261 def entries(path) merge(path).entries.map{|entry| Pathname.new(entry.basename)} end
file?(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 237 def file?(path) merge(path).file? end
get_file(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 241 def get_file(path) merge(path).read end
get_mtime(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 257 def get_mtime(path) merge(path).mtime end
get_size(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 253 def get_size(path) merge(path).size end
mkdir(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 265 def mkdir(path) merge(path).path.mkdir end
mv(from_path, to_path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 273 def mv(from_path, to_path) merge(from_path).path.rename(merge(to_path).path) end
put_file(path, data)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 245 def put_file(path, data) Location[data].copy(merge(path)) end
rmdir(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 269 def rmdir(path) merge(path).path.rmdir end
Private Instance Methods
merge(path)
click to toggle source
# File lib/pione/util/ftp-server.rb, line 279 def merge(path) @base + path.relative_path_from(Pathname.new("/")) end