Skip to content

Instantly share code, notes, and snippets.

@drasch
drasch / count-files-by-extension.rb
Created September 24, 2012 14:06
Count files by extensicount-files-by-extension.rbon
require 'rubygems'
require 'activesupport'
ct = Hash.new(0)
while gets
ma = $_.match %r/\.(\w{2,10})$/
ct[ma[1]] += 1 if ma
end
y ActiveSupport::OrderedHash[ct.sort_by {|k,v| v}].reject {|k,v| v<50}