Project

triumph

0.0
No commit activity in last 3 years
No release in over 3 years
Triumph makes it easy to add achievements to your app, even dynamically at runtime.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.6.4
>= 3.0.0
>= 0
>= 0

Runtime

 Project Readme

Triumph¶ ↑

Triumph is a gem that not only lets you add achievements to your rails app, but lets you dynamically define new achievements (e.g. by an admin) at runtime.

Installing¶ ↑

To use Triumph, simply do the following:

  • Include the gem:

    • Add gem ‘triumph’ to your gemfile

  • Create database tables:

    • rails generate triumph

    • rake db:migrate

  • Add an observer on any objects you want to count for your users’ achevements

    • rails generate achievement_observer Post

    • rails generate achievement_observer Comment

    • add those observers to the ‘config.active_record.observers’ variable in config/application.rb

  • In your users model, add:

    • include Achievements

  • Restart your App!

Using¶ ↑

Once you’ve installed Triumph, you can visit the achievements controller to add new achievement definitions. Each achievement must have:

  • A name

  • A description

  • A set of conditions

That’s it. You can now create new Achievements, and when a post is saved, for example, Triumph will check if the conditions are met.

For more info, see the sample app at github.com/adambray/triumph-sample.git

Contributing to triumph¶ ↑

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Adam Bray. See LICENSE.txt for further details.