merit 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80cd3f1c6e1d7bac792d556e3b5145c82f0e3db9bd5b07eb6487c2de7f029613
4
- data.tar.gz: ba6e5ee3691603cf88f3871b23bd875bb755fe2206c24f790d3ce427f6c2430f
3
+ metadata.gz: 1163ea7681b5daca51eb89a7785bc648fe86ddbefff1a05cdc765c20c9b91973
4
+ data.tar.gz: 1329168f700f69f1d0eff4ca196ed511302b7839745eb8ed58bb5bb277cd5d51
5
5
  SHA512:
6
- metadata.gz: 639a9e1f07a6c5505a41ee412fb4d8de43184c125ca254b941501863b92ebc15c9495f1714d4edba4f286166e895c4962b62ed249a546eddc9b1201b8154dfdb
7
- data.tar.gz: ba40fb0d27815c0f1e523cf445eef9b44f5fa06682562e067405216bb4b56c748af0574baaa7e9d4b5d3ec935dd2f7002bb03fa0655eb6d73805acc568079097
6
+ metadata.gz: 2e112a21e6ada4964c86c7253c72bc4235f4ab478a876badfa27cf1d60d2cea3ec297f234219100bc9049e50ea859860a7d6c3f504dcca86b8424da3aa28e007
7
+ data.tar.gz: 39f8af732714702142e9b0f279c63b7aa528113fd81f39df99f94ae09ca0320e9a2f52b230dd919bedc9e42f5947aed9ad656df89c84c9bc09a56cdacd7e8438
data/NEWS.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  User-visible changes worth mentioning.
4
4
 
5
+ ## 4.0.3
6
+
7
+ - Add webrick as a development dependency
8
+ - [#363] Fix: `warning: already initialized constant Merit::*` messages
9
+ - [#357] Fix `merit_actions` migration template
10
+
5
11
  ## 4.0.2
6
12
 
7
13
  - [#355, #356] Add index on merit_actions.processed column
@@ -11,7 +11,7 @@ class CreateMeritActions < ActiveRecord::Migration<%= migration_version %>
11
11
  t.boolean :processed, default: false
12
12
  t.timestamps null: false
13
13
  end
14
- end
15
14
 
16
- add_index :merit_actions, :processed
15
+ add_index :merit_actions, :processed
16
+ end
17
17
  end
data/lib/merit.rb CHANGED
@@ -35,6 +35,16 @@ module Merit
35
35
  @config.add_observer(class_name)
36
36
  end
37
37
 
38
+ # If the app is reloaded, avoid printing `warning: previous definition of AppBadgeRules was here`
39
+ def self.remove_badge_rules
40
+ remove_const(:AppBadgeRules) if self.const_defined?('AppBadgeRules')
41
+ end
42
+
43
+ # If the app is reloaded, avoid printing `warning: previous definition of AppPointRules was here`
44
+ def self.remove_point_rules
45
+ remove_const(:AppPointRules) if self.const_defined?('AppPointRules')
46
+ end
47
+
38
48
  class Configuration
39
49
  attr_accessor :checks_on_each_request, :orm, :user_model_name, :observers,
40
50
  :current_user_method
@@ -65,6 +75,9 @@ module Merit
65
75
  ActiveSupport.on_load(:active_record) { include Merit }
66
76
  ActiveSupport.on_load(app.config.api_only ? :action_controller_api : :action_controller_base) do
67
77
  begin
78
+ # Remove previous definitions of constant if they are defined when app reloads
79
+ Merit.remove_badge_rules
80
+ Merit.remove_point_rules
68
81
  # Load app rules on boot up
69
82
  Merit::AppBadgeRules = Merit::BadgeRules.new.defined_rules
70
83
  Merit::AppPointRules = Merit::PointRules.new.defined_rules
data/merit.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
7
7
  s.test_files = `git ls-files -- test/*`.split("\n")
8
8
  s.license = 'MIT'
9
- s.version = '4.0.2'
9
+ s.version = '4.0.3'
10
10
  s.authors = ["Tute Costa"]
11
11
  s.email = 'tutecosta@gmail.com'
12
12
 
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'rubocop'
22
22
  s.add_development_dependency 'minitest-rails'
23
23
  s.add_development_dependency 'mocha'
24
+ s.add_development_dependency 'webrick'
24
25
  end
@@ -2,8 +2,8 @@
2
2
  # of editing this file, please use the migrations feature of Active Record to
3
3
  # incrementally modify your database, and then regenerate this schema definition.
4
4
  #
5
- # This file is the source Rails uses to define your schema when running `rails
6
- # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
7
  # be faster and is potentially less error prone than running all of your
8
8
  # migrations from scratch. Old migrations may fail to apply correctly if those
9
9
  # migrations use external dependencies or application code.
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.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tute Costa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2022-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ambry
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: webrick
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: Manage badges, points and rankings (reputation) in your Rails app.
126
140
  email: tutecosta@gmail.com
127
141
  executables: []
@@ -280,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
294
  - !ruby/object:Gem::Version
281
295
  version: '0'
282
296
  requirements: []
283
- rubygems_version: 3.1.6
297
+ rubygems_version: 3.2.32
284
298
  signing_key:
285
299
  specification_version: 4
286
300
  summary: Reputation engine for Rails apps