triumph 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,26 @@
1
1
  = triumph
2
2
 
3
- Description goes here.
3
+ 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.
4
+
5
+ == Use
6
+
7
+ To use Triumph, simply do the following:
8
+
9
+ * Include the gem:
10
+ * Add gem 'triumph' to your gemfile
11
+ * Create database tables:
12
+ * rails generate triumph
13
+ * rake db:migrate
14
+ * Add an observer on any objects you want to count for your users' achevements
15
+ * rake generate acheivement_observer Post
16
+ * rake generate acheivement_observer Comment
17
+ * add those observers to the 'config.active_record.observers' variable in config/application.rb
18
+ * In your users model, add:
19
+ * include Achievements
20
+
21
+ That's it. You can now create new Acheivements, and when a post is saved, for example, Triumph will check if the conditions are met.
22
+
23
+ For more info, see the sample app at http://github.com/adambray/triumph-sample.git
4
24
 
5
25
  == Contributing to triumph
6
26
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/lib/achievements.rb CHANGED
@@ -2,7 +2,11 @@ module Achievements
2
2
 
3
3
  def self.included(base)
4
4
  base.class_eval do
5
- has_many :achievements
5
+ #for some reason, this is not adding the proper association to the users model
6
+ # when I do 'include Achievemnts', though everything else works as expected.
7
+ # For now, I'm manually adding the 'has_many :completed_achievements' to the user
8
+ # model in my sample app, but I need to figure this out.
9
+ has_many :completed_achievements
6
10
  end
7
11
  end
8
12
 
@@ -1,8 +1,8 @@
1
1
  class CreateCompletedAchievements < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :completed_achievements do |t|
4
- t.integer :achievement_id
5
- t.integer :user_id
4
+ t.integer :achievement_id
5
+ t.integer :user_id
6
6
 
7
7
  t.timestamps
8
8
  end
data/triumph.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{triumph}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Adam Bray}]
@@ -17,8 +17,6 @@ Gem::Specification.new do |s|
17
17
  "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
- ".DS_Store",
21
- ".document",
22
20
  "Gemfile",
23
21
  "Gemfile.lock",
24
22
  "LICENSE.txt",
@@ -41,7 +39,6 @@ Gem::Specification.new do |s|
41
39
  "lib/generators/achievement_observer/templates/achievement_observer.rb",
42
40
  "lib/generators/triumph/.DS_Store",
43
41
  "lib/generators/triumph/triumph_generator.rb",
44
- "lib/tasks/triumph_tasks.rake",
45
42
  "lib/triumph.rb",
46
43
  "rails/init.rb",
47
44
  "test/helper.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: triumph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Bray
@@ -147,8 +147,6 @@ extra_rdoc_files:
147
147
  - LICENSE.txt
148
148
  - README.rdoc
149
149
  files:
150
- - .DS_Store
151
- - .document
152
150
  - Gemfile
153
151
  - Gemfile.lock
154
152
  - LICENSE.txt
@@ -171,7 +169,6 @@ files:
171
169
  - lib/generators/achievement_observer/templates/achievement_observer.rb
172
170
  - lib/generators/triumph/.DS_Store
173
171
  - lib/generators/triumph/triumph_generator.rb
174
- - lib/tasks/triumph_tasks.rake
175
172
  - lib/triumph.rb
176
173
  - rails/init.rb
177
174
  - test/helper.rb
data/.DS_Store DELETED
Binary file
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
@@ -1,14 +0,0 @@
1
- namespace :db do
2
- namespace :migrate do
3
- description = "Migrate the database through scripts in triumph/lib/db/migrate"
4
- description << "and update db/schema.rb by invoking db:schema:dump."
5
- description << "Target specific version with VERSION=x. Turn off output with VERBOSE=false."
6
-
7
- desc description
8
- task :triumph => :environment do
9
- ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
10
- ActiveRecord::Migrator.migrate("triumph/lib/db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
11
- Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
12
- end
13
- end
14
- end