Module: EM::FileUtils
- Defined in:
- lib/em-file-utils.rb
Overview
Evented FileUtils.
Constant Summary collapse
- @@cache =
Commands instances cache.
{ }
Class Method Summary collapse
-
.cp(from, to) ⇒ CommandBuilder
Copy object using cp -r command.
-
.mkdir(path) ⇒ CommandBuilder
Creates directory using mkdir -p command.
-
.mv(from, to) ⇒ CommandBuilder
Renames object using
mvcommand. -
.rm(path) ⇒ CommandBuilder
Removes object using rm -r command.
-
.touch(path) ⇒ CommandBuilder
Touches file using
touchcommand.
Class Method Details
.cp(from, to) ⇒ CommandBuilder
Copy object using cp -r command.
33 34 35 36 37 38 39 |
# File 'lib/em-file-utils.rb', line 33 def self.cp(from, to) cmd = __get(:cp) cmd << :r cmd << from cmd << to cmd end |
.mkdir(path) ⇒ CommandBuilder
Creates directory using mkdir -p command.
90 91 92 93 94 95 |
# File 'lib/em-file-utils.rb', line 90 def self.mkdir(path) cmd = __get(:mkdir) cmd << :p cmd << path cmd end |
.mv(from, to) ⇒ CommandBuilder
Renames object using mv command.
49 50 51 52 53 54 |
# File 'lib/em-file-utils.rb', line 49 def self.mv(from, to) cmd = __get(:mv) cmd << from cmd << to cmd end |
.rm(path) ⇒ CommandBuilder
Removes object using rm -r command.
63 64 65 66 67 68 |
# File 'lib/em-file-utils.rb', line 63 def self.rm(path) cmd = __get(:rm) cmd << :r cmd << path cmd end |
.touch(path) ⇒ CommandBuilder
Touches file using touch command.
77 78 79 80 81 |
# File 'lib/em-file-utils.rb', line 77 def self.touch(path) cmd = __get(:touch) cmd << path cmd end |