Skip to content

@jhenry /loremipsum.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/usr/bin/env ruby -wKU
text_source = ARGV[0] || 'ipsum'
filename = File.join(File.dirname(__FILE__), text_source + '.txt')
copy_to_use = File.read(filename)
if text_source == 'ipsum'
chopped_copy = copy_to_use.scan(/.*?[.!?](?:\s|$)/)
else
chopped_copy = copy_to_use.split(/\n\n/)
end
print chopped_copy[rand(chopped_copy.length)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.