Module: Motion::FileUtils

Defined in:
lib/project/motion-fileutils.rb

Class Method Summary collapse

Class Method Details

.makedirsObject



22
23
24
# File 'lib/project/motion-fileutils.rb', line 22

def mkdir_p(dir, options = {})
  mkdir_with_intermediate(dir, true, options)
end

.mkdir(dir, options = {}) ⇒ Object



9
10
11
# File 'lib/project/motion-fileutils.rb', line 9

def mkdir(dir, options = {})
  mkdir_with_intermediate(dir, false, options)
end

.mkdir_p(dir, options = {}) ⇒ Object



14
15
16
# File 'lib/project/motion-fileutils.rb', line 14

def mkdir_p(dir, options = {})
  mkdir_with_intermediate(dir, true, options)
end

.mkpathObject



19
20
21
# File 'lib/project/motion-fileutils.rb', line 19

def mkdir_p(dir, options = {})
  mkdir_with_intermediate(dir, true, options)
end

.private_module_function(name) ⇒ Object

:nodoc:



4
5
6
7
# File 'lib/project/motion-fileutils.rb', line 4

def self.private_module_function(name)   #:nodoc:
  module_function name
  private_class_method name
end

.removeObject



36
37
38
39
40
41
42
43
44
# File 'lib/project/motion-fileutils.rb', line 36

def rm(list, options = {})
  error = Pointer.new(:object)
  m = NSFileManager.defaultManager
  list = [list] unless list.is_a? Array
  list.each do |path|
    r = m.removeItemAtPath path, error:error
#p error, r unless r
  end
end

.rm(list, options = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/project/motion-fileutils.rb', line 25

def rm(list, options = {})
  error = Pointer.new(:object)
  m = NSFileManager.defaultManager
  list = [list] unless list.is_a? Array
  list.each do |path|
    r = m.removeItemAtPath path, error:error
#p error, r unless r
  end
end