Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View loremipsum.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/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.