Tag Archives: files

Removing files with varied capitalization

Nothing ground-breaking today, just a one-liner that I expected to be longer than a one-liner. # Remove Rakefile, rakefile, RakeFile, etc… File.delete(*Dir.glob(‘rakefile’, File::FNM_CASEFOLD)) There are two notable things going on here: Dir.glob can take optional bitflags; in this case, FNM_CASEFOLD … Continue reading

Posted in Uncategorized | Tagged , | 5 Comments

Double-Load Guards in Ruby

If you’ve ever worked with C or C++ you no doubt remember that one of continual headaches of working with those languages is avoiding double-inclusions of header files. Most C headers start and end with preprocessor directives in order to … Continue reading

Posted in Uncategorized | Tagged , , , , | 7 Comments