Class: File
Class Method Summary collapse
- .create_directory(dir) ⇒ Object
- .delete_directory(dir) ⇒ Object
- .read(path) ⇒ Object
- .write(path, data) ⇒ Object
Class Method Details
.create_directory(dir) ⇒ Object
15 16 17 |
# File 'lib/RubyExt/file.rb', line 15 def create_directory dir Dir.mkdir dir unless File.exist? dir end |
.delete_directory(dir) ⇒ Object
19 20 21 |
# File 'lib/RubyExt/file.rb', line 19 def delete_directory dir FileUtils.rm_r dir, :force => true if File.exist? dir end |