Class: Pione::Util::FTPLocalFS
- Inherits:
-
FTPFileSystem
- Object
- FTPFileSystem
- Pione::Util::FTPLocalFS
- Defined in:
- lib/pione/util/ftp-server.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#mtime ⇒ Object
readonly
Returns the value of attribute mtime.
Instance Method Summary collapse
- #delete_file(path) ⇒ Object
- #directory?(path) ⇒ Boolean
- #entries(path) ⇒ Object
- #file?(path) ⇒ Boolean
- #get_file(path) ⇒ Object
- #get_mtime(path) ⇒ Object
- #get_size(path) ⇒ Object
-
#initialize(base) ⇒ FTPLocalFS
constructor
A new instance of FTPLocalFS.
- #mkdir(path) ⇒ Object
- #mv(from_path, to_path) ⇒ Object
- #put_file(path, data) ⇒ Object
- #rmdir(path) ⇒ Object
Methods inherited from FTPFileSystem
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
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
225 226 227 |
# File 'lib/pione/util/ftp-server.rb', line 225 def directory @directory end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
226 227 228 |
# File 'lib/pione/util/ftp-server.rb', line 226 def file @file end |
#mtime ⇒ Object (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
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
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 |