A clean (i.e. "kid friendly") random word generator.
Currently the word list varies in size from 4 to 12 letters in length and consists mostly of words for animals, food, plants, and buildings.
Add this line to your application's Gemfile:
gem 'clean_words'And then execute:
$ bundle
Or install it yourself as:
$ gem install clean_words
words = CleanWords::Random.new
# Fetch a random word
words.fetch
#=> 'aspen'
# Fetch a number of random words
words.fetch(nil, 3)
#=> ['aspen', 'terrier', 'apple']
# Fetch a random word of a particular size
words.fetch(6)
#=> 'arctic'
# Fetch random words of an array of sizes
words.fetch([4,6], 2)
#=> ['arctic', 'fort']
# Fetch random words of a range of sizes
words.fetch((4..6), 4)
#=> ['fort', 'gopher', 'arctic', 'maple']- Fork it ( https://github.com/foraker/clean_words/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature')
- NOTE: If adding words to
data/words.txt, please executeruby util/sanitize_list.rbfrom the project root before commiting.
- Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Foraker Labs builds exciting web and mobile apps in Boulder, CO. Our work powers a wide variety of businesses with many different needs. We love open source software, and we're proud to contribute where we can. Interested to learn more? Contact us today.
This project is maintained by Foraker Labs. The names and logos of Foraker Labs are fully owned and copyright Foraker Design, LLC.
