merit 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +70 -58
- data/README.md +1 -0
- data/lib/merit/models/active_record/sash.rb +4 -1
- data/merit.gemspec +2 -2
- data/test/dummy/app/models/comment.rb +3 -0
- data/test/dummy/app/models/user.rb +2 -0
- data/test/dummy/config/application.rb +1 -0
- data/test/dummy/config/environments/development.rb +0 -1
- data/test/dummy/db/schema.rb +8 -8
- metadata +13 -13
data/Gemfile.lock
CHANGED
@@ -1,42 +1,43 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
merit (0.6.
|
4
|
+
merit (0.6.3)
|
5
5
|
ambry
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
rack (~> 1.2
|
21
|
-
rack-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
10
|
+
actionmailer (3.2.3)
|
11
|
+
actionpack (= 3.2.3)
|
12
|
+
mail (~> 2.4.4)
|
13
|
+
actionpack (3.2.3)
|
14
|
+
activemodel (= 3.2.3)
|
15
|
+
activesupport (= 3.2.3)
|
16
|
+
builder (~> 3.0.0)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
journey (~> 1.0.1)
|
19
|
+
rack (~> 1.4.0)
|
20
|
+
rack-cache (~> 1.2)
|
21
|
+
rack-test (~> 0.6.1)
|
22
|
+
sprockets (~> 2.1.2)
|
23
|
+
activemodel (3.2.3)
|
24
|
+
activesupport (= 3.2.3)
|
25
|
+
builder (~> 3.0.0)
|
26
|
+
activerecord (3.2.3)
|
27
|
+
activemodel (= 3.2.3)
|
28
|
+
activesupport (= 3.2.3)
|
29
|
+
arel (~> 3.0.2)
|
30
|
+
tzinfo (~> 0.3.29)
|
31
|
+
activeresource (3.2.3)
|
32
|
+
activemodel (= 3.2.3)
|
33
|
+
activesupport (= 3.2.3)
|
34
|
+
activesupport (3.2.3)
|
35
|
+
i18n (~> 0.6)
|
36
|
+
multi_json (~> 1.0)
|
37
|
+
addressable (2.2.7)
|
37
38
|
ambry (0.3.0)
|
38
|
-
arel (
|
39
|
-
builder (
|
39
|
+
arel (3.0.2)
|
40
|
+
builder (3.0.0)
|
40
41
|
capybara (1.1.2)
|
41
42
|
mime-types (>= 1.16)
|
42
43
|
nokogiri (>= 1.3.3)
|
@@ -44,57 +45,68 @@ GEM
|
|
44
45
|
rack-test (>= 0.5.4)
|
45
46
|
selenium-webdriver (~> 2.0)
|
46
47
|
xpath (~> 0.1.4)
|
47
|
-
childprocess (0.3.
|
48
|
+
childprocess (0.3.2)
|
48
49
|
ffi (~> 1.0.6)
|
49
|
-
erubis (2.
|
50
|
-
abstract (>= 1.0.0)
|
50
|
+
erubis (2.7.0)
|
51
51
|
ffi (1.0.11)
|
52
52
|
haml (3.1.4)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
hike (1.2.1)
|
54
|
+
i18n (0.6.0)
|
55
|
+
journey (1.0.3)
|
56
|
+
json (1.7.0)
|
57
|
+
libwebsocket (0.1.3)
|
58
|
+
addressable
|
59
|
+
mail (2.4.4)
|
57
60
|
i18n (>= 0.4.0)
|
58
61
|
mime-types (~> 1.16)
|
59
62
|
treetop (~> 1.4.8)
|
60
63
|
mime-types (1.18)
|
61
|
-
multi_json (1.
|
64
|
+
multi_json (1.3.2)
|
62
65
|
nokogiri (1.5.2)
|
63
66
|
polyglot (0.3.3)
|
64
|
-
rack (1.
|
65
|
-
rack-
|
66
|
-
rack (>=
|
67
|
-
rack-
|
67
|
+
rack (1.4.1)
|
68
|
+
rack-cache (1.2)
|
69
|
+
rack (>= 0.4)
|
70
|
+
rack-ssl (1.3.2)
|
71
|
+
rack
|
72
|
+
rack-test (0.6.1)
|
68
73
|
rack (>= 1.0)
|
69
|
-
rails (3.
|
70
|
-
actionmailer (= 3.
|
71
|
-
actionpack (= 3.
|
72
|
-
activerecord (= 3.
|
73
|
-
activeresource (= 3.
|
74
|
-
activesupport (= 3.
|
74
|
+
rails (3.2.3)
|
75
|
+
actionmailer (= 3.2.3)
|
76
|
+
actionpack (= 3.2.3)
|
77
|
+
activerecord (= 3.2.3)
|
78
|
+
activeresource (= 3.2.3)
|
79
|
+
activesupport (= 3.2.3)
|
75
80
|
bundler (~> 1.0)
|
76
|
-
railties (= 3.
|
77
|
-
railties (3.
|
78
|
-
actionpack (= 3.
|
79
|
-
activesupport (= 3.
|
81
|
+
railties (= 3.2.3)
|
82
|
+
railties (3.2.3)
|
83
|
+
actionpack (= 3.2.3)
|
84
|
+
activesupport (= 3.2.3)
|
85
|
+
rack-ssl (~> 1.3.2)
|
80
86
|
rake (>= 0.8.7)
|
81
87
|
rdoc (~> 3.4)
|
82
|
-
thor (~> 0.14.
|
88
|
+
thor (~> 0.14.6)
|
83
89
|
rake (0.9.3.beta.1)
|
84
90
|
rdoc (3.12)
|
85
91
|
json (~> 1.4)
|
86
|
-
rubyzip (0.9.
|
87
|
-
selenium-webdriver (2.
|
92
|
+
rubyzip (0.9.8)
|
93
|
+
selenium-webdriver (2.21.2)
|
88
94
|
childprocess (>= 0.2.5)
|
89
95
|
ffi (~> 1.0)
|
96
|
+
libwebsocket (~> 0.1.3)
|
90
97
|
multi_json (~> 1.0)
|
91
98
|
rubyzip
|
92
|
-
|
99
|
+
sprockets (2.1.3)
|
100
|
+
hike (~> 1.2)
|
101
|
+
rack (~> 1.0)
|
102
|
+
tilt (~> 1.1, != 1.3.0)
|
103
|
+
sqlite3 (1.3.6)
|
93
104
|
thor (0.14.6)
|
105
|
+
tilt (1.3.3)
|
94
106
|
treetop (1.4.10)
|
95
107
|
polyglot
|
96
108
|
polyglot (>= 0.3.1)
|
97
|
-
tzinfo (0.3.
|
109
|
+
tzinfo (0.3.33)
|
98
110
|
xpath (0.1.4)
|
99
111
|
nokogiri (~> 1.3)
|
100
112
|
|
@@ -105,5 +117,5 @@ DEPENDENCIES
|
|
105
117
|
capybara
|
106
118
|
haml
|
107
119
|
merit!
|
108
|
-
rails (~> 3.
|
120
|
+
rails (~> 3.2.3)
|
109
121
|
sqlite3
|
data/README.md
CHANGED
@@ -114,6 +114,7 @@ Check for rules on a rake task executed in background like:
|
|
114
114
|
|
115
115
|
# To-do list
|
116
116
|
|
117
|
+
* rails g merit MODEL_NAME shouldn't create general migrations again.
|
117
118
|
* Abstract User (rule.rb#51 for instance) into a Merit option.
|
118
119
|
* Should namespace app/models into Merit module.
|
119
120
|
* rescue ActiveRecord::... should depend on ORM used (MongoMapper?)
|
@@ -6,7 +6,10 @@ class Sash < ActiveRecord::Base
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def add_badge(badge_id)
|
9
|
-
BadgesSash.
|
9
|
+
bs = BadgesSash.new
|
10
|
+
bs.sash_id = self.id
|
11
|
+
bs.badge_id = badge_id
|
12
|
+
bs.save
|
10
13
|
end
|
11
14
|
def rm_badge(badge_id)
|
12
15
|
badges_sashes = BadgesSash.where(:badge_id => badge_id, :sash_id => self.id)
|
data/merit.gemspec
CHANGED
@@ -4,11 +4,11 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.description = "Manage badges, points and rankings (reputation) of resources in a Rails application."
|
5
5
|
s.homepage = "http://github.com/tute/merit"
|
6
6
|
s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
|
7
|
-
s.version = "0.6.
|
7
|
+
s.version = "0.6.3"
|
8
8
|
s.authors = ["Tute Costa"]
|
9
9
|
s.email = 'tutecosta@gmail.com'
|
10
10
|
s.add_dependency 'ambry'
|
11
|
-
s.add_development_dependency 'rails', '~> 3.
|
11
|
+
s.add_development_dependency 'rails', '~> 3.2.3'
|
12
12
|
s.add_development_dependency 'sqlite3'
|
13
13
|
s.add_development_dependency 'haml'
|
14
14
|
s.add_development_dependency 'capybara'
|
@@ -14,6 +14,7 @@ module Dummy
|
|
14
14
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
15
15
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
16
16
|
# config.i18n.default_locale = :de
|
17
|
+
config.active_record.whitelist_attributes = true
|
17
18
|
|
18
19
|
# Configure the default encoding used in templates for Ruby 1.9.
|
19
20
|
config.encoding = "utf-8"
|
@@ -11,7 +11,6 @@ Dummy::Application.configure do
|
|
11
11
|
|
12
12
|
# Show full error reports and disable caching
|
13
13
|
config.consider_all_requests_local = true
|
14
|
-
config.action_view.debug_rjs = true
|
15
14
|
config.action_controller.perform_caching = false
|
16
15
|
|
17
16
|
# Don't care if the mailer can't send
|
data/test/dummy/db/schema.rb
CHANGED
@@ -29,8 +29,8 @@ ActiveRecord::Schema.define(:version => 20120318022220) do
|
|
29
29
|
t.text "comment"
|
30
30
|
t.integer "user_id"
|
31
31
|
t.integer "votes", :default => 0
|
32
|
-
t.datetime "created_at"
|
33
|
-
t.datetime "updated_at"
|
32
|
+
t.datetime "created_at", :null => false
|
33
|
+
t.datetime "updated_at", :null => false
|
34
34
|
end
|
35
35
|
|
36
36
|
create_table "merit_actions", :force => true do |t|
|
@@ -42,19 +42,19 @@ ActiveRecord::Schema.define(:version => 20120318022220) do
|
|
42
42
|
t.integer "target_id"
|
43
43
|
t.boolean "processed", :default => false
|
44
44
|
t.string "log"
|
45
|
-
t.datetime "created_at"
|
46
|
-
t.datetime "updated_at"
|
45
|
+
t.datetime "created_at", :null => false
|
46
|
+
t.datetime "updated_at", :null => false
|
47
47
|
end
|
48
48
|
|
49
49
|
create_table "sashes", :force => true do |t|
|
50
|
-
t.datetime "created_at"
|
51
|
-
t.datetime "updated_at"
|
50
|
+
t.datetime "created_at", :null => false
|
51
|
+
t.datetime "updated_at", :null => false
|
52
52
|
end
|
53
53
|
|
54
54
|
create_table "users", :force => true do |t|
|
55
55
|
t.string "name"
|
56
|
-
t.datetime "created_at"
|
57
|
-
t.datetime "updated_at"
|
56
|
+
t.datetime "created_at", :null => false
|
57
|
+
t.datetime "updated_at", :null => false
|
58
58
|
t.integer "sash_id"
|
59
59
|
t.integer "points", :default => 0
|
60
60
|
t.integer "level", :default => 0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ambry
|
16
|
-
requirement: &
|
16
|
+
requirement: &70291939751160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,21 +21,21 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70291939751160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &70291939744340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.
|
32
|
+
version: 3.2.3
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70291939744340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sqlite3
|
38
|
-
requirement: &
|
38
|
+
requirement: &70291939743780 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70291939743780
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: haml
|
49
|
-
requirement: &
|
49
|
+
requirement: &70291939743320 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70291939743320
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: capybara
|
60
|
-
requirement: &
|
60
|
+
requirement: &70291939742900 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70291939742900
|
69
69
|
description: Manage badges, points and rankings (reputation) of resources in a Rails
|
70
70
|
application.
|
71
71
|
email: tutecosta@gmail.com
|