Skip to content

Instantly share code, notes, and snippets.

@icebreaker
Created May 11, 2011 13:42
Show Gist options
  • Select an option

  • Save icebreaker/966461 to your computer and use it in GitHub Desktop.

Select an option

Save icebreaker/966461 to your computer and use it in GitHub Desktop.
Basic t(...) extractor
#!/usr/bin/env ruby
if ARGV.size < 1
puts "usage: t_extrator dir"
exit(1)
end
Dir.glob("#{ARGV[0]}/**/*").each do |file|
if FileTest.file? file
c = File.read(file)
#m = c.match(/t\(("|')(.*)("|')\)/)
m = c.match(/t\(("|')(.*)("|')/)
if m
puts m[2]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment