Benefits of using Ruby FileUtils instead of Bash commands?

What are the benefits of using the FileUtils methods http://ruby-doc.org/core/classes/FileUtils.html than the equivalent Bash commands?

+5
source share
6 answers

Besides the fact that you don’t have to worry about providing the target platform, you have certain tools that you use, and besides the problem of correctly quoting shell oddities (especially problematic if you are targeting both Windows and Unix-alikes - Cygwin, GNUWin32, etc.), if you use Ruby FileUtils, you have overhead with a moderate size of the Ruby function call, and if you use external utilities, you have pretty significant overhead for starting an external process every "call" .

+7
source

FileUtils methods work on Windows.

+6
source

Ruby-, Ruby . , , .

+2

, . FileUtils - , ( , ), Ruby.

+1
  • .
  • ( )
+1

, Ruby FileUtils Ruby FileUtils, , Ruby ( -). , . , * nix, , , Windows cygwin GNU win32 ( ). Ruby FileUtils , , FileUtils, .

-2

All Articles