Skip to content

Instantly share code, notes, and snippets.

@swards
Last active August 29, 2015 14:19
Show Gist options
  • Save swards/e3e9442bda4adafbbed1 to your computer and use it in GitHub Desktop.
Save swards/e3e9442bda4adafbbed1 to your computer and use it in GitHub Desktop.
In Ruby - List all files and order by the day they were last modified. Note, irb is launched from the rails application directory. This is very helpful if your contracting and want to see what files have changed recently.
$ irb
> puts Dir['app/**/*'].sort_by{ |f| File.mtime(f) }.map{|f| "#{f} #{" " * (80-f.length)} #{File.mtime(f).strftime('%m%d')}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment