merit 2.4.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +3 -35
- data/NEWS.md +31 -0
- data/README.md +15 -3
- data/RELEASING.md +16 -0
- data/Rakefile +13 -1
- data/app/models/merit/badge.rb +2 -19
- data/lib/merit.rb +13 -35
- data/lib/merit/{rules_badge_methods.rb → badge_rules_methods.rb} +0 -0
- data/lib/merit/base_target_finder.rb +1 -6
- data/lib/merit/{model_additions.rb → class_methods.rb} +2 -19
- data/lib/merit/controller_extensions.rb +13 -30
- data/lib/{generators → merit/generators}/active_record/install_generator.rb +12 -8
- data/lib/{generators → merit/generators}/active_record/merit_generator.rb +7 -3
- data/lib/{generators → merit/generators}/active_record/remove_generator.rb +9 -5
- data/lib/{generators/active_record/templates/add_merit_fields_to_model.rb → merit/generators/active_record/templates/add_merit_fields_to_model.erb} +1 -1
- data/lib/{generators/active_record/templates/create_badges_sashes.rb → merit/generators/active_record/templates/create_badges_sashes.erb} +1 -1
- data/lib/{generators/active_record/templates/create_merit_actions.rb → merit/generators/active_record/templates/create_merit_actions.erb} +2 -2
- data/lib/{generators/active_record/templates/create_merit_activity_logs.rb → merit/generators/active_record/templates/create_merit_activity_logs.erb} +1 -1
- data/lib/merit/generators/active_record/templates/create_sashes.erb +7 -0
- data/lib/{generators/active_record/templates/create_scores_and_points.rb → merit/generators/active_record/templates/create_scores_and_points.erb} +2 -2
- data/lib/{generators/active_record/templates/remove_merit_fields_from_model.rb → merit/generators/active_record/templates/remove_merit_fields_from_model.erb} +1 -1
- data/lib/{generators/active_record/templates/remove_merit_tables.rb → merit/generators/active_record/templates/remove_merit_tables.erb} +1 -1
- data/lib/merit/generators/install_generator.rb +18 -0
- data/lib/{generators/merit → merit/generators}/merit_generator.rb +3 -1
- data/lib/{generators/merit → merit/generators}/remove_generator.rb +3 -1
- data/lib/{generators/merit/templates/merit.rb → merit/generators/templates/merit.erb} +0 -3
- data/lib/{generators/merit/templates/merit_badge_rules.rb → merit/generators/templates/merit_badge_rules.erb} +0 -0
- data/lib/{generators/merit/templates/merit_point_rules.rb → merit/generators/templates/merit_point_rules.erb} +0 -0
- data/lib/{generators/merit/templates/merit_rank_rules.rb → merit/generators/templates/merit_rank_rules.erb} +0 -0
- data/{app/models/merit/action.rb → lib/merit/models/action_concern.rb} +12 -10
- data/lib/merit/models/active_record/action.rb +11 -0
- data/lib/merit/models/active_record/{merit/activity_log.rb → activity_log.rb} +4 -6
- data/lib/merit/models/active_record/{merit/badges_sash.rb → badges_sash.rb} +4 -4
- data/lib/merit/models/active_record/{merit/sash.rb → sash.rb} +5 -2
- data/lib/merit/models/active_record/{merit/score.rb → score.rb} +4 -1
- data/lib/merit/models/badges_sash_concern.rb +13 -0
- data/lib/merit/models/base/badges_sash.rb +1 -1
- data/lib/merit/models/base/sash.rb +1 -1
- data/lib/merit/models/sash_concern.rb +53 -0
- data/lib/merit/{rules_points_methods.rb → point_rules_methods.rb} +0 -0
- data/lib/merit/{rules_rank_methods.rb → rank_rules_methods.rb} +3 -18
- data/merit.gemspec +7 -5
- data/test/dummy/app/controllers/comments_controller.rb +1 -1
- data/test/dummy/app/controllers/registrations_controller.rb +1 -1
- data/test/dummy/app/models/address.rb +1 -12
- data/test/dummy/app/models/comment.rb +3 -25
- data/test/dummy/app/models/user.rb +1 -18
- data/test/dummy/config/application.rb +8 -10
- data/test/dummy/config/application_api_only.rb +28 -0
- data/test/dummy/config/environment_api_only.rb +7 -0
- data/test/dummy/config/environments/test.rb +1 -1
- data/test/dummy/config/initializers/new_framework_defaults.rb +3 -0
- data/test/dummy/db/migrate/20110421191249_create_users.rb +2 -2
- data/test/dummy/db/migrate/20110421191250_create_comments.rb +2 -2
- data/test/dummy/db/migrate/20120318022220_add_fields_to_users.rb +1 -1
- data/test/dummy/db/migrate/20130321082817_add_fields_to_comments.rb +1 -1
- data/test/dummy/db/migrate/20130329224406_create_merit_actions.rb +2 -2
- data/test/dummy/db/migrate/20130329224407_create_merit_activity_logs.rb +1 -1
- data/test/dummy/db/migrate/20130329224408_create_sashes.rb +2 -2
- data/test/dummy/db/migrate/20130329224409_create_badges_sashes.rb +1 -1
- data/test/dummy/db/migrate/20130329224410_create_scores_and_points.rb +1 -1
- data/test/dummy/db/migrate/20140211144001_create_addresses.rb +1 -1
- data/test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb +1 -1
- data/test/dummy/db/schema.rb +55 -59
- data/test/integration/navigation_test.rb +2 -2
- data/test/test_helper.rb +11 -12
- data/test/unit/base_target_finder_test.rb +7 -26
- data/test/unit/merit_unit_test.rb +13 -17
- data/test/unit/rule_unit_test.rb +15 -8
- data/test/unit/rules_matcher_test.rb +9 -6
- data/test/unit/sash_finder_test.rb +5 -5
- data/test/unit/score_test.rb +1 -1
- data/test/unit/target_finder_test.rb +13 -13
- metadata +61 -70
- data/UPGRADING.md +0 -256
- data/lib/generators/active_record/templates/add_target_data_to_merit_actions.rb +0 -5
- data/lib/generators/active_record/templates/create_sashes.rb +0 -7
- data/lib/generators/active_record/upgrade_generator.rb +0 -36
- data/lib/generators/merit/install_generator.rb +0 -16
- data/lib/generators/merit/upgrade_generator.rb +0 -7
- data/lib/merit/models/active_record/merit/action.rb +0 -12
- data/lib/merit/models/mongoid/merit/action.rb +0 -18
- data/lib/merit/models/mongoid/merit/activity_log.rb +0 -11
- data/lib/merit/models/mongoid/merit/badges_sash.rb +0 -22
- data/lib/merit/models/mongoid/merit/sash.rb +0 -30
- data/lib/merit/models/mongoid/merit/score.rb +0 -45
- data/test/dummy/db/migrate/20140906225844_create_players.rb +0 -8
- data/test/dummy/public/javascripts/application.js +0 -2
- data/test/dummy/public/javascripts/controls.js +0 -965
- data/test/dummy/public/javascripts/dragdrop.js +0 -974
- data/test/dummy/public/javascripts/effects.js +0 -1123
- data/test/dummy/public/javascripts/prototype.js +0 -6001
- data/test/dummy/public/javascripts/rails.js +0 -191
- data/test/orm/active_record.rb +0 -2
- data/test/orm/mongoid.rb +0 -6
- data/test/orm_models/active_record.rb +0 -11
- data/test/orm_models/mongoid.rb +0 -15
@@ -14,7 +14,7 @@ describe Merit::BaseTargetFinder do
|
|
14
14
|
|
15
15
|
finder = Merit::BaseTargetFinder.new(rule, action)
|
16
16
|
collection = finder.find
|
17
|
-
collection.must_be :==, comment
|
17
|
+
_(collection).must_be :==, comment
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -22,13 +22,13 @@ describe Merit::BaseTargetFinder do
|
|
22
22
|
it 'should fall back to the action#target_model' do
|
23
23
|
rule = Merit::Rule.new
|
24
24
|
rule.to = :itself
|
25
|
-
action = Merit::Action.new(target_model: '
|
26
|
-
user =
|
25
|
+
action = Merit::Action.new(target_model: 'users', target_id: 3)
|
26
|
+
user = User.new(id: 3)
|
27
27
|
|
28
|
-
|
28
|
+
User.stubs(:find_by_id).with(3).returns(user)
|
29
29
|
|
30
30
|
finder = Merit::BaseTargetFinder.new(rule, action)
|
31
|
-
finder.find.must_be :==, user
|
31
|
+
_(finder.find).must_be :==, user
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -41,7 +41,7 @@ describe Merit::BaseTargetFinder do
|
|
41
41
|
|
42
42
|
finder = Merit::BaseTargetFinder.new(rule, action)
|
43
43
|
Rails.logger.expects(:warn)
|
44
|
-
finder.find.must_be_nil
|
44
|
+
_(finder.find).must_be_nil
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -57,26 +57,7 @@ describe Merit::BaseTargetFinder do
|
|
57
57
|
target_data: comment.to_yaml)
|
58
58
|
|
59
59
|
finder = Merit::BaseTargetFinder.new(rule, action)
|
60
|
-
finder.find.name.must_be :==, 'the comment name'
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
describe 'warns when the target_data column has not been created' do
|
65
|
-
it 'sends a message to the logger' do
|
66
|
-
comment = Comment.new(name: 'the comment name')
|
67
|
-
|
68
|
-
rule = Merit::Rule.new
|
69
|
-
rule.to = :itself
|
70
|
-
rule.model_name = 'comment'
|
71
|
-
action = Merit::Action.new(target_model: 'comment',
|
72
|
-
target_id: 2,
|
73
|
-
target_data: comment.to_yaml)
|
74
|
-
action.stubs(:respond_to?).with(:target_data).returns(false)
|
75
|
-
|
76
|
-
Rails.logger.expects(:warn)
|
77
|
-
|
78
|
-
finder = Merit::BaseTargetFinder.new(rule, action)
|
79
|
-
finder.reanimate_target_from_action
|
60
|
+
_(finder.find.name).must_be :==, 'the comment name'
|
80
61
|
end
|
81
62
|
end
|
82
63
|
end
|
@@ -1,31 +1,27 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
# TODO: Split different objects tests in it's own files
|
4
3
|
class MeritUnitTest < ActiveSupport::TestCase
|
5
|
-
require "orm_models/#{Merit.orm}"
|
6
|
-
|
7
4
|
test 'extends only meritable models' do
|
8
|
-
assert
|
9
|
-
assert !
|
5
|
+
assert User.method_defined?(:points), 'has_merit adds methods'
|
6
|
+
assert !Address.method_defined?(:points), 'other models aren\'t extended'
|
10
7
|
end
|
11
8
|
|
12
9
|
test 'Badges get "related_models" methods' do
|
13
|
-
|
14
|
-
assert Merit::Badge.method_defined?(:
|
10
|
+
Comment.new; User.new # load meritable classes
|
11
|
+
assert Merit::Badge.method_defined?(:comments), 'Badge#comments should be defined'
|
12
|
+
assert Merit::Badge.method_defined?(:users), 'Badge#users should be defined'
|
15
13
|
end
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
set_rank level: 1, to: Player, level_name: :clown
|
23
|
-
end
|
24
|
-
end
|
25
|
-
assert_raises Merit::RankAttributeNotDefined do
|
26
|
-
WeirdRankRules.new.check_rank_rules
|
15
|
+
test 'unknown ranking raises exception' do
|
16
|
+
class WeirdRankRules
|
17
|
+
include Merit::RankRulesMethods
|
18
|
+
def initialize
|
19
|
+
set_rank level: 1, to: User, level_name: :clown
|
27
20
|
end
|
28
21
|
end
|
22
|
+
assert_raises Merit::RankAttributeNotDefined do
|
23
|
+
WeirdRankRules.new.check_rank_rules
|
24
|
+
end
|
29
25
|
end
|
30
26
|
|
31
27
|
test 'Badge#custom_fields_hash saves correctly' do
|
data/test/unit/rule_unit_test.rb
CHANGED
@@ -11,40 +11,47 @@ describe Merit::Rule do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'truthy block should make rule apply' do
|
14
|
-
@rule.applies?('str').must_be :==, true
|
14
|
+
_(@rule.applies?('str')).must_be :==, true
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'falsy block should make rule fail' do
|
18
|
-
@rule.applies?('string').must_be :==, false
|
18
|
+
_(@rule.applies?('string')).must_be :==, false
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'block needs parameter for rule to pass' do
|
22
|
-
@rule.applies
|
22
|
+
_(@rule.applies?).must_be :==, false
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe '#applies (without block)' do
|
27
27
|
it 'empty condition should make rule apply' do
|
28
|
-
@rule.applies
|
28
|
+
_(@rule.applies?).must_be :==, true
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
describe '#badge' do
|
33
33
|
it 'raises exception on inexistent badge' do
|
34
34
|
@rule.badge_name = 'inexistent'
|
35
|
-
-> { @rule.badge }.must_raise Merit::BadgeNotFound
|
35
|
+
_(-> { @rule.badge }).must_raise Merit::BadgeNotFound
|
36
36
|
end
|
37
37
|
|
38
|
-
it 'finds related badge by name' do
|
38
|
+
it 'finds related badge by name, when the name is a string' do
|
39
39
|
Merit::Badge.create(id: 98, name: 'test-badge-98')
|
40
40
|
@rule.badge_name = "test-badge-98"
|
41
|
-
@rule.badge.must_be :==, Merit::Badge.find(98)
|
41
|
+
_(@rule.badge).must_be :==, Merit::Badge.find(98)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'finds related badge by name, when the name is a symbol' do
|
45
|
+
Merit::Badge.create(id: 100, name: :testbadge)
|
46
|
+
@rule.badge_name = 'testbadge'
|
47
|
+
_(@rule.badge).must_be :==, Merit::Badge.find(100)
|
48
|
+
@rule.badge
|
42
49
|
end
|
43
50
|
|
44
51
|
it 'finds related badge by name' do
|
45
52
|
Merit::Badge.create(id: 98, name: 'test-badge-98')
|
46
53
|
@rule.badge_id = 98
|
47
|
-
@rule.badge.must_be :==, Merit::Badge.find(98)
|
54
|
+
_(@rule.badge).must_be :==, Merit::Badge.find(98)
|
48
55
|
end
|
49
56
|
end
|
50
57
|
end
|
@@ -5,29 +5,32 @@ describe Merit::RulesMatcher do
|
|
5
5
|
describe 'rules actions are treated as a regexp' do
|
6
6
|
it 'selects matching rules (suffix)' do
|
7
7
|
matcher = Merit::RulesMatcher.new('comments', 'update')
|
8
|
-
matcher.select_from(
|
8
|
+
selected = matcher.select_from(
|
9
9
|
'comments#update' => 'comments#update',
|
10
10
|
'comments#up' => 'comments#up',
|
11
11
|
'comments#up$' => 'comments#up$',
|
12
12
|
'comments#up.+$' => 'comments#up.+$',
|
13
|
-
)
|
13
|
+
)
|
14
|
+
_(selected).must_be :==, ['comments#update', 'comments#up.+$']
|
14
15
|
|
15
16
|
matcher = Merit::RulesMatcher.new('comments', 'up')
|
16
|
-
matcher.select_from(
|
17
|
+
selected = matcher.select_from(
|
17
18
|
'comments#update' => 'comments#update',
|
18
19
|
'comments#up' => 'comments#up',
|
19
20
|
'comments#up$' => 'comments#up$',
|
20
21
|
'comments#up.+$' => 'comments#up.+$',
|
21
|
-
)
|
22
|
+
)
|
23
|
+
_(selected).must_be :==, ['comments#up', 'comments#up$']
|
22
24
|
end
|
23
25
|
|
24
26
|
it 'selects matching rules (prefix)' do
|
25
27
|
matcher = Merit::RulesMatcher.new('/posts/1/comments', 'create')
|
26
|
-
matcher.select_from(
|
28
|
+
selected = matcher.select_from(
|
27
29
|
'comments#create' => 'comments#create',
|
28
30
|
'^comments#create' => '^comments#create',
|
29
31
|
'^.*/comments#create' => '^.*/comments#create',
|
30
|
-
)
|
32
|
+
)
|
33
|
+
_(selected).must_be :==, ['^.*/comments#create']
|
31
34
|
end
|
32
35
|
end
|
33
36
|
|
@@ -3,11 +3,11 @@ require 'test_helper'
|
|
3
3
|
describe Merit::SashFinder do
|
4
4
|
it 'should return an array of sashes of the target objects' do
|
5
5
|
sash_1 = Merit::Sash.new
|
6
|
-
user_1 =
|
6
|
+
user_1 = User.new
|
7
7
|
user_1.stubs(:_sash).returns(sash_1)
|
8
8
|
|
9
9
|
sash_2 = Merit::Sash.new
|
10
|
-
user_2 =
|
10
|
+
user_2 = User.new
|
11
11
|
user_2.stubs(:_sash).returns(sash_2)
|
12
12
|
|
13
13
|
# TODO: With stub we are not exercising compact
|
@@ -20,8 +20,8 @@ describe Merit::SashFinder do
|
|
20
20
|
|
21
21
|
Merit::SashFinder.stubs(:targets).returns(users)
|
22
22
|
sashes = Merit::SashFinder.find(rule, action)
|
23
|
-
sashes.count.must_be :==, 2
|
24
|
-
sashes.must_include sash_1
|
25
|
-
sashes.must_include sash_2
|
23
|
+
_(sashes.count).must_be :==, 2
|
24
|
+
_(sashes).must_include sash_1
|
25
|
+
_(sashes).must_include sash_2
|
26
26
|
end
|
27
27
|
end
|
data/test/unit/score_test.rb
CHANGED
@@ -17,14 +17,14 @@ describe Merit::TargetFinder do
|
|
17
17
|
|
18
18
|
finder = Merit::TargetFinder.new(rule, action)
|
19
19
|
collection = finder.find
|
20
|
-
collection.size.must_be :==, 1
|
21
|
-
collection.must_include comment
|
20
|
+
_(collection.size).must_be :==, 1
|
21
|
+
_(collection).must_include comment
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe 'rule#to is :action_user' do
|
26
26
|
before do
|
27
|
-
Merit.setup { |config| config.user_model_name = '
|
27
|
+
Merit.setup { |config| config.user_model_name = 'User' }
|
28
28
|
end
|
29
29
|
after do
|
30
30
|
Merit.setup { |config| config.user_model_name = 'User' }
|
@@ -34,14 +34,14 @@ describe Merit::TargetFinder do
|
|
34
34
|
rule = Merit::Rule.new
|
35
35
|
rule.to = :action_user
|
36
36
|
action = Merit::Action.new(user_id: 22)
|
37
|
-
user =
|
37
|
+
user = User.new
|
38
38
|
|
39
|
-
|
39
|
+
User.stubs(:find_by_id).with(22).returns(user)
|
40
40
|
|
41
41
|
finder = Merit::TargetFinder.new(rule, action)
|
42
42
|
collection = finder.find
|
43
|
-
collection.size.must_be :==, 1
|
44
|
-
collection.must_include user
|
43
|
+
_(collection.size).must_be :==, 1
|
44
|
+
_(collection).must_include user
|
45
45
|
end
|
46
46
|
|
47
47
|
describe 'when user does not exist' do
|
@@ -50,9 +50,9 @@ describe Merit::TargetFinder do
|
|
50
50
|
rule.to = :action_user
|
51
51
|
action = Merit::Action.new(user_id: 22)
|
52
52
|
|
53
|
-
Rails.logger.expects(:warn).with('[merit] no
|
53
|
+
Rails.logger.expects(:warn).with('[merit] no User found with id 22')
|
54
54
|
finder = Merit::TargetFinder.new(rule, action)
|
55
|
-
finder.find.must_be_empty
|
55
|
+
_(finder.find).must_be_empty
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -64,15 +64,15 @@ describe Merit::TargetFinder do
|
|
64
64
|
rule.model_name = 'comments'
|
65
65
|
action = Merit::Action.new(target_id: 40)
|
66
66
|
|
67
|
-
user =
|
67
|
+
user = User.new
|
68
68
|
comment = Comment.new
|
69
69
|
comment.stubs(:user).returns(user)
|
70
70
|
Comment.stubs(:find_by_id).with(40).returns(comment)
|
71
71
|
|
72
72
|
finder = Merit::TargetFinder.new(rule, action)
|
73
73
|
collection = finder.find
|
74
|
-
collection.size.must_be :==, 1
|
75
|
-
collection.must_include user
|
74
|
+
_(collection.size).must_be :==, 1
|
75
|
+
_(collection).must_include user
|
76
76
|
end
|
77
77
|
|
78
78
|
describe 'rule#to does not exist as a method on the original target' do
|
@@ -90,7 +90,7 @@ describe Merit::TargetFinder do
|
|
90
90
|
|
91
91
|
Rails.logger.expects(:warn).with(str)
|
92
92
|
finder = Merit::TargetFinder.new(rule, action)
|
93
|
-
finder.find.must_be_empty
|
93
|
+
_(finder.find).must_be_empty
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tute Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ambry
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: zeitwerk
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rails
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: 5.1.6
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: 5.1.6
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: capybara
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +112,16 @@ dependencies:
|
|
98
112
|
name: mocha
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: '0'
|
111
125
|
description: Manage badges, points and rankings (reputation) in your Rails app.
|
112
126
|
email: tutecosta@gmail.com
|
113
127
|
executables: []
|
@@ -119,56 +133,50 @@ files:
|
|
119
133
|
- MIT-LICENSE
|
120
134
|
- NEWS.md
|
121
135
|
- README.md
|
136
|
+
- RELEASING.md
|
122
137
|
- Rakefile
|
123
138
|
- TESTING.txt
|
124
|
-
- UPGRADING.md
|
125
|
-
- app/models/merit/action.rb
|
126
139
|
- app/models/merit/badge.rb
|
127
140
|
- config/locales/en.yml
|
128
|
-
- lib/generators/active_record/install_generator.rb
|
129
|
-
- lib/generators/active_record/merit_generator.rb
|
130
|
-
- lib/generators/active_record/remove_generator.rb
|
131
|
-
- lib/generators/active_record/templates/add_merit_fields_to_model.rb
|
132
|
-
- lib/generators/active_record/templates/add_target_data_to_merit_actions.rb
|
133
|
-
- lib/generators/active_record/templates/create_badges_sashes.rb
|
134
|
-
- lib/generators/active_record/templates/create_merit_actions.rb
|
135
|
-
- lib/generators/active_record/templates/create_merit_activity_logs.rb
|
136
|
-
- lib/generators/active_record/templates/create_sashes.rb
|
137
|
-
- lib/generators/active_record/templates/create_scores_and_points.rb
|
138
|
-
- lib/generators/active_record/templates/remove_merit_fields_from_model.rb
|
139
|
-
- lib/generators/active_record/templates/remove_merit_tables.rb
|
140
|
-
- lib/generators/active_record/upgrade_generator.rb
|
141
|
-
- lib/generators/merit/install_generator.rb
|
142
|
-
- lib/generators/merit/merit_generator.rb
|
143
|
-
- lib/generators/merit/remove_generator.rb
|
144
|
-
- lib/generators/merit/templates/merit.rb
|
145
|
-
- lib/generators/merit/templates/merit_badge_rules.rb
|
146
|
-
- lib/generators/merit/templates/merit_point_rules.rb
|
147
|
-
- lib/generators/merit/templates/merit_rank_rules.rb
|
148
|
-
- lib/generators/merit/upgrade_generator.rb
|
149
141
|
- lib/merit.rb
|
142
|
+
- lib/merit/badge_rules_methods.rb
|
150
143
|
- lib/merit/base_target_finder.rb
|
144
|
+
- lib/merit/class_methods.rb
|
151
145
|
- lib/merit/controller_extensions.rb
|
146
|
+
- lib/merit/generators/active_record/install_generator.rb
|
147
|
+
- lib/merit/generators/active_record/merit_generator.rb
|
148
|
+
- lib/merit/generators/active_record/remove_generator.rb
|
149
|
+
- lib/merit/generators/active_record/templates/add_merit_fields_to_model.erb
|
150
|
+
- lib/merit/generators/active_record/templates/create_badges_sashes.erb
|
151
|
+
- lib/merit/generators/active_record/templates/create_merit_actions.erb
|
152
|
+
- lib/merit/generators/active_record/templates/create_merit_activity_logs.erb
|
153
|
+
- lib/merit/generators/active_record/templates/create_sashes.erb
|
154
|
+
- lib/merit/generators/active_record/templates/create_scores_and_points.erb
|
155
|
+
- lib/merit/generators/active_record/templates/remove_merit_fields_from_model.erb
|
156
|
+
- lib/merit/generators/active_record/templates/remove_merit_tables.erb
|
157
|
+
- lib/merit/generators/install_generator.rb
|
158
|
+
- lib/merit/generators/merit_generator.rb
|
159
|
+
- lib/merit/generators/remove_generator.rb
|
160
|
+
- lib/merit/generators/templates/merit.erb
|
161
|
+
- lib/merit/generators/templates/merit_badge_rules.erb
|
162
|
+
- lib/merit/generators/templates/merit_point_rules.erb
|
163
|
+
- lib/merit/generators/templates/merit_rank_rules.erb
|
152
164
|
- lib/merit/judge.rb
|
153
|
-
- lib/merit/
|
154
|
-
- lib/merit/models/active_record/
|
155
|
-
- lib/merit/models/active_record/
|
156
|
-
- lib/merit/models/active_record/
|
157
|
-
- lib/merit/models/active_record/
|
158
|
-
- lib/merit/models/active_record/
|
165
|
+
- lib/merit/models/action_concern.rb
|
166
|
+
- lib/merit/models/active_record/action.rb
|
167
|
+
- lib/merit/models/active_record/activity_log.rb
|
168
|
+
- lib/merit/models/active_record/badges_sash.rb
|
169
|
+
- lib/merit/models/active_record/sash.rb
|
170
|
+
- lib/merit/models/active_record/score.rb
|
171
|
+
- lib/merit/models/badges_sash_concern.rb
|
159
172
|
- lib/merit/models/base/badges_sash.rb
|
160
173
|
- lib/merit/models/base/sash.rb
|
161
|
-
- lib/merit/models/
|
162
|
-
- lib/merit/
|
163
|
-
- lib/merit/
|
164
|
-
- lib/merit/models/mongoid/merit/sash.rb
|
165
|
-
- lib/merit/models/mongoid/merit/score.rb
|
174
|
+
- lib/merit/models/sash_concern.rb
|
175
|
+
- lib/merit/point_rules_methods.rb
|
176
|
+
- lib/merit/rank_rules_methods.rb
|
166
177
|
- lib/merit/reputation_change_observer.rb
|
167
178
|
- lib/merit/rule.rb
|
168
|
-
- lib/merit/rules_badge_methods.rb
|
169
179
|
- lib/merit/rules_matcher.rb
|
170
|
-
- lib/merit/rules_points_methods.rb
|
171
|
-
- lib/merit/rules_rank_methods.rb
|
172
180
|
- lib/merit/sash_finder.rb
|
173
181
|
- lib/merit/target_finder.rb
|
174
182
|
- merit.gemspec
|
@@ -202,9 +210,11 @@ files:
|
|
202
210
|
- test/dummy/app/views/users/show.html.erb
|
203
211
|
- test/dummy/config.ru
|
204
212
|
- test/dummy/config/application.rb
|
213
|
+
- test/dummy/config/application_api_only.rb
|
205
214
|
- test/dummy/config/boot.rb
|
206
215
|
- test/dummy/config/database.yml
|
207
216
|
- test/dummy/config/environment.rb
|
217
|
+
- test/dummy/config/environment_api_only.rb
|
208
218
|
- test/dummy/config/environments/development.rb
|
209
219
|
- test/dummy/config/environments/production.rb
|
210
220
|
- test/dummy/config/environments/test.rb
|
@@ -212,6 +222,7 @@ files:
|
|
212
222
|
- test/dummy/config/initializers/inflections.rb
|
213
223
|
- test/dummy/config/initializers/merit.rb
|
214
224
|
- test/dummy/config/initializers/mime_types.rb
|
225
|
+
- test/dummy/config/initializers/new_framework_defaults.rb
|
215
226
|
- test/dummy/config/initializers/secret_token.rb
|
216
227
|
- test/dummy/config/initializers/session_store.rb
|
217
228
|
- test/dummy/config/locales/en.yml
|
@@ -228,28 +239,17 @@ files:
|
|
228
239
|
- test/dummy/db/migrate/20130329224410_create_scores_and_points.rb
|
229
240
|
- test/dummy/db/migrate/20140211144001_create_addresses.rb
|
230
241
|
- test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb
|
231
|
-
- test/dummy/db/migrate/20140906225844_create_players.rb
|
232
242
|
- test/dummy/db/schema.rb
|
233
243
|
- test/dummy/db/seeds.rb
|
234
244
|
- test/dummy/public/404.html
|
235
245
|
- test/dummy/public/422.html
|
236
246
|
- test/dummy/public/500.html
|
237
247
|
- test/dummy/public/favicon.ico
|
238
|
-
- test/dummy/public/javascripts/application.js
|
239
|
-
- test/dummy/public/javascripts/controls.js
|
240
|
-
- test/dummy/public/javascripts/dragdrop.js
|
241
|
-
- test/dummy/public/javascripts/effects.js
|
242
|
-
- test/dummy/public/javascripts/prototype.js
|
243
|
-
- test/dummy/public/javascripts/rails.js
|
244
248
|
- test/dummy/public/rails.js
|
245
249
|
- test/dummy/public/stylesheets/.gitkeep
|
246
250
|
- test/dummy/public/stylesheets/scaffold.css
|
247
251
|
- test/dummy/script/rails
|
248
252
|
- test/integration/navigation_test.rb
|
249
|
-
- test/orm/active_record.rb
|
250
|
-
- test/orm/mongoid.rb
|
251
|
-
- test/orm_models/active_record.rb
|
252
|
-
- test/orm_models/mongoid.rb
|
253
253
|
- test/support/integration_case.rb
|
254
254
|
- test/test_helper.rb
|
255
255
|
- test/unit/action_test.rb
|
@@ -273,15 +273,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
273
273
|
requirements:
|
274
274
|
- - ">="
|
275
275
|
- !ruby/object:Gem::Version
|
276
|
-
version:
|
276
|
+
version: 2.3.0
|
277
277
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
278
278
|
requirements:
|
279
279
|
- - ">="
|
280
280
|
- !ruby/object:Gem::Version
|
281
281
|
version: '0'
|
282
282
|
requirements: []
|
283
|
-
|
284
|
-
rubygems_version: 2.5.1
|
283
|
+
rubygems_version: 3.0.3
|
285
284
|
signing_key:
|
286
285
|
specification_version: 4
|
287
286
|
summary: Reputation engine for Rails apps
|
@@ -316,9 +315,11 @@ test_files:
|
|
316
315
|
- test/dummy/app/views/users/show.html.erb
|
317
316
|
- test/dummy/config.ru
|
318
317
|
- test/dummy/config/application.rb
|
318
|
+
- test/dummy/config/application_api_only.rb
|
319
319
|
- test/dummy/config/boot.rb
|
320
320
|
- test/dummy/config/database.yml
|
321
321
|
- test/dummy/config/environment.rb
|
322
|
+
- test/dummy/config/environment_api_only.rb
|
322
323
|
- test/dummy/config/environments/development.rb
|
323
324
|
- test/dummy/config/environments/production.rb
|
324
325
|
- test/dummy/config/environments/test.rb
|
@@ -326,6 +327,7 @@ test_files:
|
|
326
327
|
- test/dummy/config/initializers/inflections.rb
|
327
328
|
- test/dummy/config/initializers/merit.rb
|
328
329
|
- test/dummy/config/initializers/mime_types.rb
|
330
|
+
- test/dummy/config/initializers/new_framework_defaults.rb
|
329
331
|
- test/dummy/config/initializers/secret_token.rb
|
330
332
|
- test/dummy/config/initializers/session_store.rb
|
331
333
|
- test/dummy/config/locales/en.yml
|
@@ -342,28 +344,17 @@ test_files:
|
|
342
344
|
- test/dummy/db/migrate/20130329224410_create_scores_and_points.rb
|
343
345
|
- test/dummy/db/migrate/20140211144001_create_addresses.rb
|
344
346
|
- test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb
|
345
|
-
- test/dummy/db/migrate/20140906225844_create_players.rb
|
346
347
|
- test/dummy/db/schema.rb
|
347
348
|
- test/dummy/db/seeds.rb
|
348
349
|
- test/dummy/public/404.html
|
349
350
|
- test/dummy/public/422.html
|
350
351
|
- test/dummy/public/500.html
|
351
352
|
- test/dummy/public/favicon.ico
|
352
|
-
- test/dummy/public/javascripts/application.js
|
353
|
-
- test/dummy/public/javascripts/controls.js
|
354
|
-
- test/dummy/public/javascripts/dragdrop.js
|
355
|
-
- test/dummy/public/javascripts/effects.js
|
356
|
-
- test/dummy/public/javascripts/prototype.js
|
357
|
-
- test/dummy/public/javascripts/rails.js
|
358
353
|
- test/dummy/public/rails.js
|
359
354
|
- test/dummy/public/stylesheets/.gitkeep
|
360
355
|
- test/dummy/public/stylesheets/scaffold.css
|
361
356
|
- test/dummy/script/rails
|
362
357
|
- test/integration/navigation_test.rb
|
363
|
-
- test/orm/active_record.rb
|
364
|
-
- test/orm/mongoid.rb
|
365
|
-
- test/orm_models/active_record.rb
|
366
|
-
- test/orm_models/mongoid.rb
|
367
358
|
- test/support/integration_case.rb
|
368
359
|
- test/test_helper.rb
|
369
360
|
- test/unit/action_test.rb
|