<commit_before>= Badgr

Adds badge and achievement system to you app.
Inspired by : http://stackoverflow.com/questions/885277/how-to-implement-an-achievement-system-in-ror
== Installation into your rails app

Dead simple, add this to your gemfile:

	gem 'badgr', :git => "git://github.com/Pasta/badgr.git"
	
And then:

	rails g badgr


It will add some methods to your User model (for now, the model name you can add badges onto is restricted to User) through a line you have to add into your User model:
	class User < ActiveRecord::Base
		include Achievements

It also create a migration file that you have to run through

	rake db:migrate

== How to create an achievement?

Simply run

	rails g achievement YouAchievementFantasticName
	

It should create you 3 files:

1. A model (YouAchievementFantasticNameAchievement), in which you have to set the condition for the badge to be earn
2. An observer (YouAchievementFantasticNameAchievementObserver), which you can destroy or modify to observe a model to award a badge<commit_msg>improving README<commit_after>= Badgr

Adds badge and achievement system to you app.

Inspired by : http://stackoverflow.com/questions/885277/how-to-implement-an-achievement-system-in-ror



== Installation into your rails app

Dead simple, add this to your gemfile:

	gem 'badgr', :git => "git://github.com/Pasta/badgr.git"
	
And then:

	rails g badgr


It will add some methods to your User model (for now, the model name you can add badges onto is restricted to User) through a line you have to add into your User model:
	class User < ActiveRecord::Base
		include Achievements

It also create a migration file that you have to run through

	rake db:migrate

== How to create an achievement?

Simply run

	rails g achievement YouAchievementFantasticName
	

It should create you 3 files:

1. A model (YouAchievementFantasticNameAchievement), in which you have to set the condition for the badge to be earn
2. An observer (YouAchievementFantasticNameAchievementObserver), which you can destroy or modify to observe a model to award a badge
{'fraction_non_alphanumeric': 0.05794302269435055, 'fraction_numerical': 0.008691453404152583, 'mean_word_length': 4.367875647668394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1911055', 'n_tokens_mistral': 637, 'n_tokens_neox': 593, 'n_words': 280}