RockPaperScissors

LizardSpock

Ruby: Optionally Add Path Separator

| Comments

I was wanting to use Dir.glob to get a file list and wanted to do Dir.glob( path + '*') but nicely handle when the final ‘/’ of path was missing.

Instead of doing string manipulation we should just be using the file utilities.

Dir.glob( File.join( path, '*')  ) 

Comments