Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zigzag/339996 to your computer and use it in GitHub Desktop.
Save zigzag/339996 to your computer and use it in GitHub Desktop.
#Dir.glob("**/*.java").map{|it| it.split('/').last[0..-6]}.map{|it| [it, it.length]}.sort{|a, b| b[1] <=> a[1]}[0..5]
# A bit short version:
Dir['**/*'].grep(/(\w*)\.java/){$1}.sort_by(&:length).reverse.first(5).map{|it| [it,it.length]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment