Module: Motion::FileUtils
- Defined in:
- lib/project/motion-fileutils.rb
Class Method Summary collapse
- .makedirs ⇒ Object
- .mkdir(dir, options = {}) ⇒ Object
- .mkdir_p(dir, options = {}) ⇒ Object
- .mkpath ⇒ Object
-
.private_module_function(name) ⇒ Object
:nodoc:.
- .remove ⇒ Object
- .rm(list, options = {}) ⇒ Object
Class Method Details
.makedirs ⇒ Object
22 23 24 |
# File 'lib/project/motion-fileutils.rb', line 22 def mkdir_p(dir, = {}) mkdir_with_intermediate(dir, true, ) end |
.mkdir(dir, options = {}) ⇒ Object
9 10 11 |
# File 'lib/project/motion-fileutils.rb', line 9 def mkdir(dir, = {}) mkdir_with_intermediate(dir, false, ) end |
.mkdir_p(dir, options = {}) ⇒ Object
14 15 16 |
# File 'lib/project/motion-fileutils.rb', line 14 def mkdir_p(dir, = {}) mkdir_with_intermediate(dir, true, ) end |
.mkpath ⇒ Object
19 20 21 |
# File 'lib/project/motion-fileutils.rb', line 19 def mkdir_p(dir, = {}) mkdir_with_intermediate(dir, true, ) 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 |
.remove ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/project/motion-fileutils.rb', line 36 def rm(list, = {}) 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, = {}) 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 |