diff options
-rw-r--r-- | lib/fileutils.rb | 52 |
1 files changed, 36 insertions, 16 deletions
@@ -475,7 +475,8 @@ module FileUtils # # Keyword arguments: # - # - <tt>dereference_root: false</tt> - does not follow soft links. # - <tt>noop: true</tt> - does not create links. # - <tt>remove_destination: true</tt> - removes +dest+ before creating links. # - <tt>verbose: true</tt> - prints an equivalent command: @@ -488,8 +489,8 @@ module FileUtils # cp -lr tmp0 tmp1 # cp -lr tmp0/tmp3/t2.txt tmp0/tmp3/t3.txt tmp1 # - # Raises an exception if +dest+ is the path to an existing file - # and keyword argument +remove_destination+ is not +true+. # def cp_lr(src, dest, noop: nil, verbose: nil, dereference_root: true, remove_destination: false) @@ -578,29 +579,48 @@ module FileUtils alias symlink ln_s module_function :symlink - # - # :call-seq: - # FileUtils.ln_sf(*args) - # - # Same as - # - # FileUtils.ln_s(*args, force: true) # def ln_sf(src, dest, noop: nil, verbose: nil) ln_s src, dest, force: true, noop: noop, verbose: verbose end module_function :ln_sf # - # Hard links a file system entry +src+ to +dest+. - # If +src+ is a directory, this method links its contents recursively. # - # Both of +src+ and +dest+ must be a path name. - # +src+ must exist, +dest+ must not exist. # - # If +dereference_root+ is true, this method dereferences the tree root. # - # If +remove_destination+ is true, this method removes each destination file before copy. # def link_entry(src, dest, dereference_root = false, remove_destination = false) Entry_.new(src, nil, dereference_root).traverse do |ent| |