Class: Tumugi::FileSystem
- Inherits:
-
Object
- Object
- Tumugi::FileSystem
- Defined in:
- lib/tumugi/file_system.rb
Overview
This class defines interfaces of file system such as local file, Amazon S3, Google Cloud Storage
Instance Method Summary collapse
- #directory?(path) ⇒ Boolean
- #entries(path) ⇒ Object
- #exist?(path) ⇒ Boolean
- #mkdir(path, parents: true, raise_if_exist: false) ⇒ Object
- #move(src, dest, raise_if_exist: false) ⇒ Object
- #remove(path, recursive: true) ⇒ Object
- #rename(path, dest) ⇒ Object
Instance Method Details
#directory?(path) ⇒ Boolean
20 21 22 |
# File 'lib/tumugi/file_system.rb', line 20 def directory?(path) raise NotImplementedError, "You must implement #{self.class}##{__method__}" end |
#entries(path) ⇒ Object
24 25 26 |
# File 'lib/tumugi/file_system.rb', line 24 def entries(path) raise NotImplementedError, "You must implement #{self.class}##{__method__}" end |
#exist?(path) ⇒ Boolean
8 9 10 |
# File 'lib/tumugi/file_system.rb', line 8 def exist?(path) raise NotImplementedError, "You must implement #{self.class}##{__method__}" end |
#mkdir(path, parents: true, raise_if_exist: false) ⇒ Object
16 17 18 |
# File 'lib/tumugi/file_system.rb', line 16 def mkdir(path, parents: true, raise_if_exist: false) raise NotImplementedError, "You must implement #{self.class}##{__method__}" end |
#move(src, dest, raise_if_exist: false) ⇒ Object
28 29 30 |
# File 'lib/tumugi/file_system.rb', line 28 def move(src, dest, raise_if_exist: false) raise NotImplementedError, "You must implement #{self.class}##{__method__}" end |
#remove(path, recursive: true) ⇒ Object
12 13 14 |
# File 'lib/tumugi/file_system.rb', line 12 def remove(path, recursive: true) raise NotImplementedError, "You must implement #{self.class}##{__method__}" end |
#rename(path, dest) ⇒ Object
32 33 34 35 36 |
# File 'lib/tumugi/file_system.rb', line 32 def rename(path, dest) Tumugi::Logger.instance.warn "File system #{self.class.name} client doesn't support atomic move." raise FileAlreadyExistError if exist?(dest) move(path, dest) end |