2014-12-08 15:59:33 -08:00
|
|
|
# questiongenerator
|
|
|
|
|
2015-01-17 16:05:42 -08:00
|
|
|
A simple question generator, used by Retrospring (formerly justask).
|
2014-12-08 15:59:33 -08:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Add this line to your application's Gemfile:
|
|
|
|
|
|
|
|
gem 'questiongenerator'
|
|
|
|
|
|
|
|
If you're feeling _edgy_, you can add this line instead:
|
|
|
|
|
2015-01-17 16:05:42 -08:00
|
|
|
gem 'questiongenerator', git: 'https://github.com/retrospring/questiongenerator.git'
|
2014-12-08 15:59:33 -08:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
``` ruby
|
|
|
|
require 'questiongenerator'
|
|
|
|
|
|
|
|
# Configure it
|
|
|
|
QuestionGenerator.question_base_path = '/home/nilsding/questions'
|
|
|
|
QuestionGenerator.default_locale = :en
|
|
|
|
|
2015-01-17 16:05:42 -08:00
|
|
|
# Compile the questions for increased randomness
|
|
|
|
QuestionGenerator.compile
|
|
|
|
|
2014-12-08 15:59:33 -08:00
|
|
|
# Get some questions
|
|
|
|
puts QuestionGenerator.generate
|
|
|
|
# => "What is the best thing about the internet?"
|
|
|
|
|
|
|
|
# You can also specify the locale, if you want to
|
2015-01-17 16:05:42 -08:00
|
|
|
puts QuestionGenerator.generate locale: :de
|
2014-12-08 15:59:33 -08:00
|
|
|
# => "Was war das letzte, das du gegessen hast?"
|
|
|
|
```
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
|
2015-01-17 16:05:42 -08:00
|
|
|
1. Fork it ( https://github.com/retrospring/questiongenerator/fork )
|
2014-12-08 15:59:33 -08:00
|
|
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
|
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
|
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
|
|
5. Create a new Pull Request
|