Skip to content

Instantly share code, notes, and snippets.

@temochka
Created May 21, 2019 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save temochka/08a85e250712e36bd6d62248e971cfce to your computer and use it in GitHub Desktop.
Save temochka/08a85e250712e36bd6d62248e971cfce to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
while (path = gets)
filename = File.basename(path)
next if filename.start_with?('@')
filename.gsub(/\..+$/, '').split(/[_.]/).reject(&:empty?).each { |token| puts token }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment