rakismet 1.5.0 → 1.5.1
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 +13 -5
- data/CHANGELOG +2 -0
- data/README.md +3 -0
- data/lib/rakismet/model.rb +2 -2
- data/lib/rakismet/version.rb +1 -1
- data/spec/models/custom_params_spec.rb +1 -1
- data/spec/models/rakismet_model_spec.rb +2 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzYyMjAxMmVhYThlM2IyNjg3YzhmN2IyNjI3NzFiNDQ4YzkzNzE0Mg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MjI1YzE2YWQwMzUxNTk3NzY3Y2IzYjFhYzE5YzE5YTBjMjdmMzIyYg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NzI0MWU0YzBhZjYxN2FhNGIyZGI1M2QzNjFmMzVlMmFmNWVmYTNmZDVhOThl
|
10
|
+
NTc2OTA2Mjg1ZGE5YmE3ZjhiZDQwYzIwNzRkOGRkNzQ1MmYzMzA4NDE2ZDE2
|
11
|
+
NmIyNTMyZmU5ZjI4MWRkYjZmYThhZDFlZDM0NWU5ZWVmMzFhYjM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZWJjNTAwZDMxNzU2ZWU3OTI2NGU2ZmQ5NjBhMzRmZWU2M2JiOGIyMWYwOTNm
|
14
|
+
NjViNjM0MjIyZGY5ZjBlM2M0MDZmNjczODIxMjY4YTJmY2I5OWMwOTMzOWFh
|
15
|
+
YWRjZTU2YjYxNTQxOWYwZjMzNWZhNjdhOGE0NGUwMThiZjdlNTM=
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -220,6 +220,9 @@ How can I simulate a spam submission?
|
|
220
220
|
Most people have the opposite problem, where Akismet doesn't think anything is
|
221
221
|
spam. The only guaranteed way to trigger a positive spam response is to set the
|
222
222
|
comment author to "viagra-test-123".
|
223
|
+
To simulate a negative (not spam) result, set user_role to administrator, and all
|
224
|
+
other required fields populated with typical values. The Akismet API will always
|
225
|
+
return a false response.
|
223
226
|
|
224
227
|
If you've done this and `spam?` is still returning false, you're probably
|
225
228
|
missing the user IP or one of the key/url config variables. One way to check is
|
data/lib/rakismet/model.rb
CHANGED
@@ -14,12 +14,12 @@ module Rakismet
|
|
14
14
|
module ClassMethods
|
15
15
|
def rakismet_attrs(args={})
|
16
16
|
self.akismet_attrs ||= {}
|
17
|
-
[:comment_type, :author, :author_url, :author_email, :content, :
|
17
|
+
[:comment_type, :author, :author_url, :author_email, :content, :permalink].each do |field|
|
18
18
|
# clunky, but throwing around +type+ will break your heart
|
19
19
|
fieldname = field.to_s =~ %r(^comment_) ? field : "comment_#{field}".intern
|
20
20
|
self.akismet_attrs[fieldname] = args.delete(field) || field
|
21
21
|
end
|
22
|
-
[:user_ip, :user_agent, :referrer].each do |field|
|
22
|
+
[:user_ip, :user_agent, :referrer, :user_role].each do |field|
|
23
23
|
self.akismet_attrs[field] = args.delete(field) || field
|
24
24
|
end
|
25
25
|
args.each_pair do |f,v|
|
data/lib/rakismet/version.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
MAPPED_PARAMS = { :comment_type => :type2, :author => :author2, :content => :content2,
|
4
4
|
:author_email => :author_email2, :author_url => :author_url2,
|
5
|
-
:
|
5
|
+
:permalink => :permalink2 }
|
6
6
|
|
7
7
|
class CustomAkismetModel
|
8
8
|
include Rakismet::Model
|
@@ -8,10 +8,11 @@ describe AkismetModel do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should have default mappings" do
|
11
|
-
[:comment_type, :author, :author_email, :author_url, :content, :
|
11
|
+
[:comment_type, :author, :author_email, :author_url, :content, :permalink].each do |field|
|
12
12
|
fieldname = field.to_s =~ %r(^comment_) ? field : "comment_#{field}".intern
|
13
13
|
AkismetModel.akismet_attrs[fieldname].should eql(field)
|
14
14
|
end
|
15
|
+
AkismetModel::akismet_attrs[:user_role].should eql(:user_role)
|
15
16
|
end
|
16
17
|
|
17
18
|
it "should have request mappings" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rakismet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh French
|
@@ -14,14 +14,14 @@ dependencies:
|
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>='
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>='
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -77,17 +77,17 @@ require_paths:
|
|
77
77
|
- lib
|
78
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - '>='
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - '>='
|
85
|
+
- - ! '>='
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project: rakismet
|
90
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.4.1
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Akismet and TypePad AntiSpam integration for Rails.
|