Jake Worth

FileUtils For All

October 01, 20151 min read

A step in the Ruby deploy scripts for one of my projects shells out as such: rm -rf build/assets/ui. This prevents all design artifacts from going out with the production push. Pretty cool, right?

The problem comes when a Windows developer joins the project. Windows does not have rm, so that developer can’t deploy. We want to include everybody, even Windows devs!

Ruby’s FileUtils library to the rescue:

FileUtils.rm_rf(‘build/assets/ui’)

This library includes many Ruby methods that mimic Unix terminal commands.

http://ruby-doc.org/stdlib-2.2.3/libdoc/fileutils/rdoc/FileUtils.html


Each week, I write an email about React. It's a collection of quotes, news, conference talks, and documentation curated be me to help you get up to speed on this exploding ecosystem. Join my subscribers today by subscribing to React Explained.


Jake Worth

I'm Jake Worth, a web developer. Home About Now Newsletter