merit 3.0.1 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +3 -20
  3. data/NEWS.md +32 -0
  4. data/README.md +29 -10
  5. data/Rakefile +13 -1
  6. data/app/models/merit/badge.rb +2 -19
  7. data/lib/merit.rb +18 -50
  8. data/lib/merit/{rules_badge_methods.rb → badge_rules_methods.rb} +0 -0
  9. data/lib/merit/base_target_finder.rb +1 -6
  10. data/lib/merit/{model_additions.rb → class_methods.rb} +2 -19
  11. data/lib/merit/controller_extensions.rb +4 -22
  12. data/lib/{generators → merit/generators}/active_record/install_generator.rb +8 -8
  13. data/lib/{generators → merit/generators}/active_record/merit_generator.rb +4 -4
  14. data/lib/{generators → merit/generators}/active_record/remove_generator.rb +5 -5
  15. data/lib/{generators/active_record/templates/add_merit_fields_to_model.rb → merit/generators/active_record/templates/add_merit_fields_to_model.erb} +0 -0
  16. data/lib/{generators/active_record/templates/create_badges_sashes.rb → merit/generators/active_record/templates/create_badges_sashes.erb} +0 -0
  17. data/lib/{generators/active_record/templates/create_merit_actions.rb → merit/generators/active_record/templates/create_merit_actions.erb} +2 -0
  18. data/lib/{generators/active_record/templates/create_merit_activity_logs.rb → merit/generators/active_record/templates/create_merit_activity_logs.erb} +0 -0
  19. data/lib/{generators/active_record/templates/create_sashes.rb → merit/generators/active_record/templates/create_sashes.erb} +0 -0
  20. data/lib/{generators/active_record/templates/create_scores_and_points.rb → merit/generators/active_record/templates/create_scores_and_points.erb} +1 -1
  21. data/lib/{generators/active_record/templates/remove_merit_fields_from_model.rb → merit/generators/active_record/templates/remove_merit_fields_from_model.erb} +0 -0
  22. data/lib/{generators/active_record/templates/remove_merit_tables.rb → merit/generators/active_record/templates/remove_merit_tables.erb} +0 -0
  23. data/lib/merit/generators/install_generator.rb +21 -0
  24. data/lib/{generators/merit → merit/generators}/merit_generator.rb +7 -2
  25. data/lib/{generators/merit → merit/generators}/remove_generator.rb +7 -2
  26. data/lib/{generators/merit/templates/merit.rb → merit/generators/templates/merit.erb} +13 -14
  27. data/lib/{generators/merit/templates/merit_badge_rules.rb → merit/generators/templates/merit_badge_rules.erb} +0 -0
  28. data/lib/{generators/merit/templates/merit_point_rules.rb → merit/generators/templates/merit_point_rules.erb} +0 -0
  29. data/lib/{generators/merit/templates/merit_rank_rules.rb → merit/generators/templates/merit_rank_rules.erb} +0 -0
  30. data/lib/merit/judge.rb +6 -5
  31. data/{app/models/merit/action.rb → lib/merit/models/action_concern.rb} +12 -10
  32. data/lib/merit/models/active_record/action.rb +11 -0
  33. data/lib/merit/models/active_record/{merit/activity_log.rb → activity_log.rb} +4 -6
  34. data/lib/merit/models/active_record/{merit/badges_sash.rb → badges_sash.rb} +4 -4
  35. data/lib/merit/models/active_record/{merit/sash.rb → sash.rb} +5 -2
  36. data/lib/merit/models/active_record/{merit/score.rb → score.rb} +4 -1
  37. data/lib/merit/models/badges_sash_concern.rb +13 -0
  38. data/lib/merit/models/base/badges_sash.rb +1 -1
  39. data/lib/merit/models/base/sash.rb +1 -1
  40. data/lib/merit/models/sash_concern.rb +53 -0
  41. data/lib/merit/{rules_points_methods.rb → point_rules_methods.rb} +0 -0
  42. data/lib/merit/{rules_rank_methods.rb → rank_rules_methods.rb} +3 -18
  43. data/merit.gemspec +7 -5
  44. data/test/dummy/app/controllers/comments_controller.rb +1 -1
  45. data/test/dummy/app/controllers/registrations_controller.rb +1 -1
  46. data/test/dummy/app/models/address.rb +1 -12
  47. data/test/dummy/app/models/comment.rb +3 -25
  48. data/test/dummy/app/models/user.rb +1 -18
  49. data/test/dummy/config/application.rb +8 -10
  50. data/test/dummy/config/application_api_only.rb +28 -0
  51. data/test/dummy/config/environment_api_only.rb +7 -0
  52. data/test/dummy/config/initializers/new_framework_defaults.rb +3 -0
  53. data/test/dummy/db/migrate/20130329224406_create_merit_actions.rb +2 -0
  54. data/test/dummy/db/schema.rb +56 -59
  55. data/test/integration/navigation_test.rb +3 -3
  56. data/test/test_helper.rb +11 -12
  57. data/test/unit/base_target_finder_test.rb +7 -26
  58. data/test/unit/merit_unit_test.rb +13 -17
  59. data/test/unit/rule_unit_test.rb +15 -8
  60. data/test/unit/rules_matcher_test.rb +9 -6
  61. data/test/unit/sash_finder_test.rb +5 -5
  62. data/test/unit/sash_test.rb +16 -0
  63. data/test/unit/score_test.rb +1 -1
  64. data/test/unit/target_finder_test.rb +13 -13
  65. metadata +63 -73
  66. data/UPGRADING.md +0 -256
  67. data/lib/generators/active_record/templates/add_target_data_to_merit_actions.rb +0 -5
  68. data/lib/generators/active_record/upgrade_generator.rb +0 -40
  69. data/lib/generators/merit/install_generator.rb +0 -16
  70. data/lib/generators/merit/upgrade_generator.rb +0 -7
  71. data/lib/merit/models/active_record/merit/action.rb +0 -12
  72. data/lib/merit/models/mongoid/merit/action.rb +0 -18
  73. data/lib/merit/models/mongoid/merit/activity_log.rb +0 -11
  74. data/lib/merit/models/mongoid/merit/badges_sash.rb +0 -22
  75. data/lib/merit/models/mongoid/merit/sash.rb +0 -30
  76. data/lib/merit/models/mongoid/merit/score.rb +0 -45
  77. data/test/dummy/db/migrate/20140906225844_create_players.rb +0 -8
  78. data/test/dummy/public/javascripts/application.js +0 -2
  79. data/test/dummy/public/javascripts/controls.js +0 -965
  80. data/test/dummy/public/javascripts/dragdrop.js +0 -974
  81. data/test/dummy/public/javascripts/effects.js +0 -1123
  82. data/test/dummy/public/javascripts/prototype.js +0 -6001
  83. data/test/dummy/public/javascripts/rails.js +0 -191
  84. data/test/orm/active_record.rb +0 -2
  85. data/test/orm/mongoid.rb +0 -6
  86. data/test/orm_models/active_record.rb +0 -11
  87. data/test/orm_models/mongoid.rb +0 -15
@@ -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 Player.method_defined?(:points), 'has_merit adds methods'
9
- assert !Fruit.method_defined?(:points), 'other models aren\'t extended'
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
- assert Merit::Badge.method_defined?(:soldiers), 'Badge#soldiers should be defined'
14
- assert Merit::Badge.method_defined?(:players), 'Badge#players should be 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
- if active_record_orm?
18
- test 'unknown ranking raises exception' do
19
- class WeirdRankRules
20
- include Merit::RankRulesMethods
21
- def initialize
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
@@ -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?.must_be :==, false
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?.must_be :==, true
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
- ).must_be :==, ['comments#update', 'comments#up.+$']
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
- ).must_be :==, ['comments#up', 'comments#up$']
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
- ).must_be :==, ['^.*/comments#create']
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 = Player.new
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 = Player.new
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
@@ -6,6 +6,22 @@ class SashTest < ActiveSupport::TestCase
6
6
  @sash = Merit::Sash.create
7
7
  end
8
8
 
9
+ describe "#rm_badge" do
10
+ describe "when has badge" do
11
+ it "returns truthy" do
12
+ @sash.badges_sashes.create!(badge_id: 1)
13
+
14
+ assert_equal !!@sash.rm_badge(1), true
15
+ end
16
+ end
17
+
18
+ describe "when does NOT have badge" do
19
+ it "returns falsey" do
20
+ assert_equal !!@sash.rm_badge(0), false
21
+ end
22
+ end
23
+ end
24
+
9
25
  describe "#add_points" do
10
26
  describe "when category specified" do
11
27
  it "should create a new Point with specified category" do
@@ -8,6 +8,6 @@ describe Merit::Score do
8
8
  point = Merit::Score::Point.new
9
9
  point.score = score
10
10
 
11
- point.sash_id.must_be :==, score.sash_id
11
+ _(point.sash_id).must_be :==, score.sash_id
12
12
  end
13
13
  end
@@ -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 = 'Player' }
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 = Player.new
37
+ user = User.new
38
38
 
39
- Player.stubs(:find_by_id).with(22).returns(user)
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 Player found with id 22')
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 = Player.new
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: 3.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tute Costa
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-25 00:00:00.000000000 Z
11
+ date: 2021-04-09 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: 5.0.0
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: 5.0.0
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: 1.1.0
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: 1.1.0
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: []
@@ -122,54 +136,47 @@ files:
122
136
  - RELEASING.md
123
137
  - Rakefile
124
138
  - TESTING.txt
125
- - UPGRADING.md
126
- - app/models/merit/action.rb
127
139
  - app/models/merit/badge.rb
128
140
  - config/locales/en.yml
129
- - lib/generators/active_record/install_generator.rb
130
- - lib/generators/active_record/merit_generator.rb
131
- - lib/generators/active_record/remove_generator.rb
132
- - lib/generators/active_record/templates/add_merit_fields_to_model.rb
133
- - lib/generators/active_record/templates/add_target_data_to_merit_actions.rb
134
- - lib/generators/active_record/templates/create_badges_sashes.rb
135
- - lib/generators/active_record/templates/create_merit_actions.rb
136
- - lib/generators/active_record/templates/create_merit_activity_logs.rb
137
- - lib/generators/active_record/templates/create_sashes.rb
138
- - lib/generators/active_record/templates/create_scores_and_points.rb
139
- - lib/generators/active_record/templates/remove_merit_fields_from_model.rb
140
- - lib/generators/active_record/templates/remove_merit_tables.rb
141
- - lib/generators/active_record/upgrade_generator.rb
142
- - lib/generators/merit/install_generator.rb
143
- - lib/generators/merit/merit_generator.rb
144
- - lib/generators/merit/remove_generator.rb
145
- - lib/generators/merit/templates/merit.rb
146
- - lib/generators/merit/templates/merit_badge_rules.rb
147
- - lib/generators/merit/templates/merit_point_rules.rb
148
- - lib/generators/merit/templates/merit_rank_rules.rb
149
- - lib/generators/merit/upgrade_generator.rb
150
141
  - lib/merit.rb
142
+ - lib/merit/badge_rules_methods.rb
151
143
  - lib/merit/base_target_finder.rb
144
+ - lib/merit/class_methods.rb
152
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
153
164
  - lib/merit/judge.rb
154
- - lib/merit/model_additions.rb
155
- - lib/merit/models/active_record/merit/action.rb
156
- - lib/merit/models/active_record/merit/activity_log.rb
157
- - lib/merit/models/active_record/merit/badges_sash.rb
158
- - lib/merit/models/active_record/merit/sash.rb
159
- - lib/merit/models/active_record/merit/score.rb
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
160
172
  - lib/merit/models/base/badges_sash.rb
161
173
  - lib/merit/models/base/sash.rb
162
- - lib/merit/models/mongoid/merit/action.rb
163
- - lib/merit/models/mongoid/merit/activity_log.rb
164
- - lib/merit/models/mongoid/merit/badges_sash.rb
165
- - lib/merit/models/mongoid/merit/sash.rb
166
- - 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
167
177
  - lib/merit/reputation_change_observer.rb
168
178
  - lib/merit/rule.rb
169
- - lib/merit/rules_badge_methods.rb
170
179
  - lib/merit/rules_matcher.rb
171
- - lib/merit/rules_points_methods.rb
172
- - lib/merit/rules_rank_methods.rb
173
180
  - lib/merit/sash_finder.rb
174
181
  - lib/merit/target_finder.rb
175
182
  - merit.gemspec
@@ -203,9 +210,11 @@ files:
203
210
  - test/dummy/app/views/users/show.html.erb
204
211
  - test/dummy/config.ru
205
212
  - test/dummy/config/application.rb
213
+ - test/dummy/config/application_api_only.rb
206
214
  - test/dummy/config/boot.rb
207
215
  - test/dummy/config/database.yml
208
216
  - test/dummy/config/environment.rb
217
+ - test/dummy/config/environment_api_only.rb
209
218
  - test/dummy/config/environments/development.rb
210
219
  - test/dummy/config/environments/production.rb
211
220
  - test/dummy/config/environments/test.rb
@@ -213,6 +222,7 @@ files:
213
222
  - test/dummy/config/initializers/inflections.rb
214
223
  - test/dummy/config/initializers/merit.rb
215
224
  - test/dummy/config/initializers/mime_types.rb
225
+ - test/dummy/config/initializers/new_framework_defaults.rb
216
226
  - test/dummy/config/initializers/secret_token.rb
217
227
  - test/dummy/config/initializers/session_store.rb
218
228
  - test/dummy/config/locales/en.yml
@@ -229,28 +239,17 @@ files:
229
239
  - test/dummy/db/migrate/20130329224410_create_scores_and_points.rb
230
240
  - test/dummy/db/migrate/20140211144001_create_addresses.rb
231
241
  - test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb
232
- - test/dummy/db/migrate/20140906225844_create_players.rb
233
242
  - test/dummy/db/schema.rb
234
243
  - test/dummy/db/seeds.rb
235
244
  - test/dummy/public/404.html
236
245
  - test/dummy/public/422.html
237
246
  - test/dummy/public/500.html
238
247
  - test/dummy/public/favicon.ico
239
- - test/dummy/public/javascripts/application.js
240
- - test/dummy/public/javascripts/controls.js
241
- - test/dummy/public/javascripts/dragdrop.js
242
- - test/dummy/public/javascripts/effects.js
243
- - test/dummy/public/javascripts/prototype.js
244
- - test/dummy/public/javascripts/rails.js
245
248
  - test/dummy/public/rails.js
246
249
  - test/dummy/public/stylesheets/.gitkeep
247
250
  - test/dummy/public/stylesheets/scaffold.css
248
251
  - test/dummy/script/rails
249
252
  - test/integration/navigation_test.rb
250
- - test/orm/active_record.rb
251
- - test/orm/mongoid.rb
252
- - test/orm_models/active_record.rb
253
- - test/orm_models/mongoid.rb
254
253
  - test/support/integration_case.rb
255
254
  - test/test_helper.rb
256
255
  - test/unit/action_test.rb
@@ -266,7 +265,7 @@ homepage: https://github.com/merit-gem/merit
266
265
  licenses:
267
266
  - MIT
268
267
  metadata: {}
269
- post_install_message:
268
+ post_install_message:
270
269
  rdoc_options: []
271
270
  require_paths:
272
271
  - lib
@@ -274,16 +273,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
273
  requirements:
275
274
  - - ">="
276
275
  - !ruby/object:Gem::Version
277
- version: 2.2.2
276
+ version: 2.3.0
278
277
  required_rubygems_version: !ruby/object:Gem::Requirement
279
278
  requirements:
280
279
  - - ">="
281
280
  - !ruby/object:Gem::Version
282
281
  version: '0'
283
282
  requirements: []
284
- rubyforge_project:
285
- rubygems_version: 2.6.13
286
- signing_key:
283
+ rubygems_version: 3.1.6
284
+ signing_key:
287
285
  specification_version: 4
288
286
  summary: Reputation engine for Rails apps
289
287
  test_files:
@@ -317,9 +315,11 @@ test_files:
317
315
  - test/dummy/app/views/users/show.html.erb
318
316
  - test/dummy/config.ru
319
317
  - test/dummy/config/application.rb
318
+ - test/dummy/config/application_api_only.rb
320
319
  - test/dummy/config/boot.rb
321
320
  - test/dummy/config/database.yml
322
321
  - test/dummy/config/environment.rb
322
+ - test/dummy/config/environment_api_only.rb
323
323
  - test/dummy/config/environments/development.rb
324
324
  - test/dummy/config/environments/production.rb
325
325
  - test/dummy/config/environments/test.rb
@@ -327,6 +327,7 @@ test_files:
327
327
  - test/dummy/config/initializers/inflections.rb
328
328
  - test/dummy/config/initializers/merit.rb
329
329
  - test/dummy/config/initializers/mime_types.rb
330
+ - test/dummy/config/initializers/new_framework_defaults.rb
330
331
  - test/dummy/config/initializers/secret_token.rb
331
332
  - test/dummy/config/initializers/session_store.rb
332
333
  - test/dummy/config/locales/en.yml
@@ -343,28 +344,17 @@ test_files:
343
344
  - test/dummy/db/migrate/20130329224410_create_scores_and_points.rb
344
345
  - test/dummy/db/migrate/20140211144001_create_addresses.rb
345
346
  - test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb
346
- - test/dummy/db/migrate/20140906225844_create_players.rb
347
347
  - test/dummy/db/schema.rb
348
348
  - test/dummy/db/seeds.rb
349
349
  - test/dummy/public/404.html
350
350
  - test/dummy/public/422.html
351
351
  - test/dummy/public/500.html
352
352
  - test/dummy/public/favicon.ico
353
- - test/dummy/public/javascripts/application.js
354
- - test/dummy/public/javascripts/controls.js
355
- - test/dummy/public/javascripts/dragdrop.js
356
- - test/dummy/public/javascripts/effects.js
357
- - test/dummy/public/javascripts/prototype.js
358
- - test/dummy/public/javascripts/rails.js
359
353
  - test/dummy/public/rails.js
360
354
  - test/dummy/public/stylesheets/.gitkeep
361
355
  - test/dummy/public/stylesheets/scaffold.css
362
356
  - test/dummy/script/rails
363
357
  - test/integration/navigation_test.rb
364
- - test/orm/active_record.rb
365
- - test/orm/mongoid.rb
366
- - test/orm_models/active_record.rb
367
- - test/orm_models/mongoid.rb
368
358
  - test/support/integration_case.rb
369
359
  - test/test_helper.rb
370
360
  - test/unit/action_test.rb