antispam 0.2.4 → 0.2.6
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/app/views/layouts/antispam/application.html.erb +1 -0
- data/lib/antispam/version.rb +1 -1
- data/lib/antispam.rb +5 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53c420a7a1e56c8bd54887bb7d9777d2356d2bfbe94c78398c7033277060792f
|
4
|
+
data.tar.gz: 22513e56c23e8aa75d179dbf896ca950a8a5ef8d5beb4f5e7b97d472f363d9fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f8bb3c319ef0548dae033a5f1b435b24ba67d8ac2a9b6d062f2c13bb89d9389b0c4e1cb3adf857d5b141835a7076260dee28d6d3989bea0b01fbaa9a76a497
|
7
|
+
data.tar.gz: 1f466a72702dbc7cc97b7b5fc973d9264fcc9e9c597a242afbb1226b8f3b8270d3113dfe808922654cbc1cf3702451e63ed91d9ee0919127ff810780b3a81b94
|
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
|
|
data/lib/antispam/version.rb
CHANGED
data/lib/antispam.rb
CHANGED
@@ -8,14 +8,11 @@ require "antispam/results"
|
|
8
8
|
|
9
9
|
module Antispam
|
10
10
|
ActiveSupport.on_load(:action_controller) do
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
Rails.application.config.to_prepare do
|
12
|
+
unless ApplicationController.method_defined?(:is_admin?)
|
13
|
+
raise "Antispam Error: ApplicationController must define `is_admin?` method to use Antispam."
|
14
|
+
end
|
15
|
+
ActionController::Base.include Antispam::Tools
|
14
16
|
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
17
|
end
|
21
18
|
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.
|
4
|
+
version: 0.2.6
|
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-
|
11
|
+
date: 2024-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|