No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
Gemfile
LICENSE.txt
README.md
Rakefile
adventure.gemspec
adventure.json

README.md

adventure-gem

Adventure

Adventure is an example gem. It was written as a demonstration for a presentation for Austin on Rails "How to Make A Ruby Gem".

Installation

Add this line to your application's Gemfile:

gem 'adventure'

And then execute:

$ bundle

Or install it yourself as:

$ gem install adventure

Usage

To use the gem:

  1. Require the gem:
require 'adventure'
  1. Make a new object:
plot = Adventure::Plot.new
  1. Call the make_plot method, passing in a JSON file with the plot elements.
plot.make_plot('adventure.json')

The JSON file should be structured as below. Each heading needs at least one item in the array.

{
    "characters": [
        "a clever dragon",
        "a ruthless detective",
        "a disgruntled shopkeeper",
        "an aging cowboy",
        "a grad student",
        "a mystical lizard"
    ],
    "with": [
        "nothing left to loose",
        "a secret past",
        "an enchanted sword",
        "a grudge",
        "a knack for cooking"
    ],
    "who": [
        "likes kebabs",
        "organizes poetry nights",
        "is a world-famous cyclist",
        "lived in a circus"
    ]
}