Skip to content

Instantly share code, notes, and snippets.

@JKring
Last active September 5, 2015 02:24
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 JKring/70eb0c41859a1e2dac69 to your computer and use it in GitHub Desktop.
Save JKring/70eb0c41859a1e2dac69 to your computer and use it in GitHub Desktop.
All the words!
content = []
Document.no_timeout.each do |d|
if d.revisions.present?
revision = d.revisions.select { |r| r.contents.present? }.last
if revision
content << revision.contents.join(' ').gsub(/<\/?[^>]*>/, ' ')
end
end
end
puts content.join(' ').scan(/\w+/).size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment