Class: Pione::Util::FTPLocalFS

Inherits:
FTPFileSystem show all
Defined in:
lib/pione/util/ftp-server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from FTPFileSystem

#exist?

Constructor Details

#initialize(base) ⇒ FTPLocalFS

Returns a new instance of FTPLocalFS.



229
230
231
# File 'lib/pione/util/ftp-server.rb', line 229

def initialize(base)
  @base = base
end

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



225
226
227
# File 'lib/pione/util/ftp-server.rb', line 225

def directory
  @directory
end

#fileObject (readonly)

Returns the value of attribute file.



226
227
228
# File 'lib/pione/util/ftp-server.rb', line 226

def file
  @file
end

#mtimeObject (readonly)

Returns the value of attribute mtime.



227
228
229
# File 'lib/pione/util/ftp-server.rb', line 227

def mtime
  @mtime
end

Instance Method Details

#delete_file(path) ⇒ Object



249
250
251
# File 'lib/pione/util/ftp-server.rb', line 249

def delete_file(path)
  merge(path).delete
end

#directory?(path) ⇒ Boolean

Returns:

  • (Boolean)


233
234
235
# File 'lib/pione/util/ftp-server.rb', line 233

def directory?(path)
  merge(path).directory?
end

#entries(path) ⇒ Object



261
262
263
# File 'lib/pione/util/ftp-server.rb', line 261

def entries(path)
  merge(path).entries.map{|entry| Pathname.new(entry.basename)}
end

#file?(path) ⇒ Boolean

Returns:

  • (Boolean)


237
238
239
# File 'lib/pione/util/ftp-server.rb', line 237

def file?(path)
  merge(path).file?
end

#get_file(path) ⇒ Object



241
242
243
# File 'lib/pione/util/ftp-server.rb', line 241

def get_file(path)
  merge(path).read
end

#get_mtime(path) ⇒ Object



257
258
259
# File 'lib/pione/util/ftp-server.rb', line 257

def get_mtime(path)
  merge(path).mtime
end

#get_size(path) ⇒ Object



253
254
255
# File 'lib/pione/util/ftp-server.rb', line 253

def get_size(path)
  merge(path).size
end

#mkdir(path) ⇒ Object



265
266
267
# File 'lib/pione/util/ftp-server.rb', line 265

def mkdir(path)
  merge(path).path.mkdir
end

#mv(from_path, to_path) ⇒ Object



273
274
275
# 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) ⇒ Object



245
246
247
# File 'lib/pione/util/ftp-server.rb', line 245

def put_file(path, data)
  Location[data].copy(merge(path))
end

#rmdir(path) ⇒ Object



269
270
271
# File 'lib/pione/util/ftp-server.rb', line 269

def rmdir(path)
  merge(path).path.rmdir
end