Class: Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/base/dir.rb

Class Method Summary collapse

Class Method Details

.make(directory) ⇒ Object



6
7
8
# File 'lib/base/dir.rb', line 6

def self.make directory
  FileUtils.mkdir_p directory if !File.exists? directory
end

.remove(directory) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/base/dir.rb', line 9

def self.remove directory
  if(File.exists?(directory))
    begin
      FileUtils.rm_rf directory
      FileUtils.rm_r directory
    rescue
    end
  end
end