antispam 0.2.5 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e4b9dd3026ea307b38e2423a98891093dee84715401972038b51217ec1ea676
4
- data.tar.gz: 66bd056d12e3afcd9278d954aba5044957ab6b35e1a23aa53119e428eec28fca
3
+ metadata.gz: a68d75de5897063bea19649fbf62e3e75c56196412003615d22c1bf6d465150e
4
+ data.tar.gz: 5e731f9168becf1eb99e28bcd29b2b2b5d72cd251f6e08bcd2efccecdeb0139b
5
5
  SHA512:
6
- metadata.gz: 6effb1afb9f0f47f5440342115b74eb7068ad053c9914beeacead72054b6bb13d934bc8886b1be0bb2d003ae410c8e23f5d2c694622ca28b4490e298d74480cf
7
- data.tar.gz: 950052a1b1bd423fcf9da95cc28548d6e6856c96c7980ed0c838c2bb90f7b572859010945fdd616b597baafcf95ed3e9327e3caf78e4f23a664618c022883f7c
6
+ metadata.gz: 6a1395289f3440fc68ff37f25bf33611a1d871bd70524d98e20d5ed1152939e94225eadfbf800ed28edadef06b7e14596cfd5ca7a6ec722a5532c81fb882e6f6
7
+ data.tar.gz: 1d33c4449ef09163e9454a36db0e82df7b5723ad429b9fef17467181394f6a231d4cf654549e86385f5b1bc7d9aacfb69a9b394bea76fa6e0439b2ab5082d36e
data/README.md CHANGED
@@ -108,7 +108,7 @@ You need to add this to your routes.rb
108
108
  Then add to your application controller:
109
109
  ```
110
110
  before_action do
111
- check_ip_against_database(ip_blacklists: {default: 'your_api_key_here'}, verbose: true)
111
+ check_ip_against_database({ip_blacklists: {default: 'your_api_key_here'}, verbose: true})
112
112
  end
113
113
  ```
114
114
 
@@ -1,3 +1,3 @@
1
1
  module Antispam
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.8'
3
3
  end
data/lib/antispam.rb CHANGED
@@ -7,15 +7,15 @@ require "antispam/spamcheckers/defendium"
7
7
  require "antispam/results"
8
8
 
9
9
  module Antispam
10
- ActiveSupport.on_load(:action_controller) do
11
- # Ensure ApplicationController has is_admin? defined
12
- unless ApplicationController.method_defined?(:is_admin?)
13
- raise "Antispam Error: ApplicationController must define `is_admin?` method to use Antispam."
10
+ ActiveSupport.on_load(:action_controller_base) do
11
+ # Include Antispam::Tools into the application's ApplicationController
12
+ # Use ::ApplicationController to reference the top-level class
13
+ if defined?(::ApplicationController)
14
+ ::ApplicationController.include Antispam::Tools
15
+ else
16
+ Rails.application.config.to_prepare do
17
+ ::ApplicationController.include Antispam::Tools
18
+ end
14
19
  end
15
- # self refers to ActionController::Base here
16
- # This way is removed because below may be more compatible.
17
- # self.include Antispam::Tools
18
- # Would the below be a better (clearer? more compatible?) way to do this?
19
- ActionController::Base.send(:include, Antispam::Tools)
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: antispam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Kopf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-28 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails