Ruby gem for creating nonsense babble in the form of an adjective plus a noun
Ruby
Switch branches/tags
Latest commit f4710b4 Nov 17, 2015 @jpslav jpslav Merge pull request #5 from lml/add-adjective-config-feature
Closes #3 Add format config feature
Permalink
Failed to load latest commit information.
lib
script added multiple adjective support Dec 1, 2012
spec
.gitignore added multiple adjective support Dec 1, 2012
.rspec
.ruby-gemset Added safer words, CA words, and ability to switch word lists Nov 14, 2015
.ruby-version Added safer words, CA words, and ability to switch word lists Nov 14, 2015
Gemfile
LICENSE.txt
README.md
Rakefile Added safer words, CA words, and ability to switch word lists Nov 14, 2015
babbler.gemspec Add pry for debugging needs Nov 17, 2015

README.md

Babbler

Babbler is a Ruby gem that will make short nonsense phrases for you. The phrases nominally consist of an adjective followed by a noun, though the format can be configured. The words in the phrase are common English words.

Installation

Add this line to your application's Gemfile:

gem 'babbler'

And then execute:

$ bundle

Or install it yourself as:

$ gem install babbler

Configuration

To configure Babbler, put the following code in your applications initialization logic (eg. in the config/initializers in a Rails app)

Babbler.configure do |config|
  ...
end

The following example lists all of the available configuration options, with the default values shown:

Babbler.configure do |config|
  # Use a different format for the resulting phrase
  # phrase, e.g. with a value of 'nn' you might get 'prosecutor dog'
  config.format = 'an'

  # Choose a different word list. Options:
  #   :original - the original word list in Babbler
  #   :safer_words_1 - the original list with potentially awkward words removed
  #   :california_words - words 2nd graders in California are expected to know
  config.word_list = :original
end

Usage

To get a random babble, type:

Babbler.babble

To always be able to get a specific babble, pass an integer in:

Note: This is not guaranteed to be the same result over major versions

Babbler.babble(42)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Add tests
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request