antispam 0.2.8 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/antispam/tools.rb +6 -1
- data/lib/antispam/version.rb +1 -1
- data/lib/antispam.rb +1 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b9976b110e83413c117ba4e2aadebe3ee782a2e22075b4d005b8ee23f859b6c
|
4
|
+
data.tar.gz: b103e465db532012980a7a37e01d0b337a11bf58c5182e6951471ee2a344c427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74852eabd842ab4d54b5dc99cc99224ee40c930d4a1e047a77506c3cc4a6a04bb445c0a92d3946dbdbf81116c1f9334046e4631574af9001b4b13bfee8eebaf
|
7
|
+
data.tar.gz: 34c5bd57b1db3f574f16a7b467a9e16fb3eb01271a172491eca71d6362f454f8df42cd4c468bfa7059e72466904fbe778f5e26aa7748f29c45bf53820ffb72bf
|
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(
|
111
|
+
check_ip_against_database(ip_blacklists: {default: 'your_api_key_here'}, verbose: true)
|
112
112
|
end
|
113
113
|
```
|
114
114
|
|
data/lib/antispam/tools.rb
CHANGED
@@ -2,7 +2,12 @@ module Antispam
|
|
2
2
|
module Tools
|
3
3
|
# Checks spam against an IP database of spammers.
|
4
4
|
# Usage: before_action :check_ip_against_database
|
5
|
-
def check_ip_against_database(
|
5
|
+
def check_ip_against_database(
|
6
|
+
ip_blacklists: { default: '' },
|
7
|
+
methods: nil,
|
8
|
+
scrutinize_countries_except: nil,
|
9
|
+
verbose: false
|
10
|
+
)
|
6
11
|
if (options[:methods])
|
7
12
|
return if request.get? unless options[:methods].include?(:get)
|
8
13
|
return if request.post? unless options[:methods].include?(:post)
|
data/lib/antispam/version.rb
CHANGED
data/lib/antispam.rb
CHANGED
@@ -8,14 +8,6 @@ require "antispam/results"
|
|
8
8
|
|
9
9
|
module Antispam
|
10
10
|
ActiveSupport.on_load(:action_controller_base) do
|
11
|
-
|
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
|
19
|
-
end
|
11
|
+
ActionController::Base.include Antispam::Tools
|
20
12
|
end
|
21
13
|
end
|