rakismet 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +2 -0
- data/lib/rakismet/model.rb +3 -4
- data/lib/rakismet/version.rb +1 -1
- data/rakismet.gemspec +1 -1
- data/spec/models/custom_params_spec.rb +6 -4
- data/spec/models/rakismet_model_spec.rb +7 -5
- data/spec/rakismet_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8bc157e4813efa686db0b46304c70f757c60dd7
|
4
|
+
data.tar.gz: dd04179466c530a7c3dc2a633ee27e95f842ee8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7321aaccaa49a51f68218b9a851db5dd6ebfe69ffef9822c136e2f8092517515634bc4dac07f1d020e4a4f660eaca5826ecadfe14e4ad9a5fcc184dafb42beeb
|
7
|
+
data.tar.gz: d014957d99a0822a481e65aa35ef0f41672c6a731816d03aef5e2f387566558745dd95f109cd3507553970623f4c477a108d211446678c88e3803bd0b215bb36
|
data/CHANGELOG
CHANGED
data/lib/rakismet/model.rb
CHANGED
@@ -14,12 +14,11 @@ module Rakismet
|
|
14
14
|
module ClassMethods
|
15
15
|
def rakismet_attrs(args={})
|
16
16
|
self.akismet_attrs ||= {}
|
17
|
-
[:
|
18
|
-
|
19
|
-
fieldname = field.to_s =~ %r(^comment_) ? field : "comment_#{field}".intern
|
17
|
+
[:author, :author_url, :author_email, :content].each do |field|
|
18
|
+
fieldname = "comment_#{field}".intern
|
20
19
|
self.akismet_attrs[fieldname] = args.delete(field) || field
|
21
20
|
end
|
22
|
-
[:user_ip, :user_agent, :referrer, :user_role].each do |field|
|
21
|
+
[:comment_type, :user_ip, :user_agent, :referrer, :user_role, :permalink].each do |field|
|
23
22
|
self.akismet_attrs[field] = args.delete(field) || field
|
24
23
|
end
|
25
24
|
args.each_pair do |f,v|
|
data/lib/rakismet/version.rb
CHANGED
data/rakismet.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "http://github.com/joshfrench/rakismet"
|
11
11
|
s.summary = "Akismet and TypePad AntiSpam integration for Rails."
|
12
12
|
s.description = "Rakismet is the easiest way to integrate Akismet or TypePad's AntiSpam into your Rails app."
|
13
|
-
s.date = "
|
13
|
+
s.date = "2017-07-14"
|
14
14
|
|
15
15
|
s.rubyforge_project = "rakismet"
|
16
16
|
s.add_development_dependency "rake"
|
@@ -12,9 +12,11 @@ end
|
|
12
12
|
|
13
13
|
describe CustomAkismetModel do
|
14
14
|
it "should override default mappings" do
|
15
|
-
[:comment_type
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
CustomAkismetModel.akismet_attrs[:comment_type].should eql(:type2)
|
16
|
+
CustomAkismetModel.akismet_attrs[:comment_author].should eql(:author2)
|
17
|
+
CustomAkismetModel.akismet_attrs[:comment_content].should eql(:content2)
|
18
|
+
CustomAkismetModel.akismet_attrs[:comment_author_email].should eql(:author_email2)
|
19
|
+
CustomAkismetModel.akismet_attrs[:comment_author_url].should eql(:author_url2)
|
20
|
+
CustomAkismetModel.akismet_attrs[:permalink].should eql(:permalink2)
|
19
21
|
end
|
20
22
|
end
|
@@ -7,11 +7,13 @@ describe AkismetModel do
|
|
7
7
|
comment_attrs.each_pair { |k,v| @model.stub(k).and_return(v) }
|
8
8
|
end
|
9
9
|
|
10
|
-
it "should
|
11
|
-
[:
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
it "should map internal params to Akismet params" do
|
11
|
+
AkismetModel::akismet_attrs[:comment_author].should eql(:author)
|
12
|
+
AkismetModel::akismet_attrs[:comment_author_email].should eql(:author_email)
|
13
|
+
AkismetModel::akismet_attrs[:comment_author_url].should eql(:author_url)
|
14
|
+
AkismetModel::akismet_attrs[:comment_content].should eql(:content)
|
15
|
+
AkismetModel::akismet_attrs[:comment_type].should eql(:comment_type)
|
16
|
+
AkismetModel::akismet_attrs[:permalink].should eql(:permalink)
|
15
17
|
AkismetModel::akismet_attrs[:user_role].should eql(:user_role)
|
16
18
|
end
|
17
19
|
|
data/spec/rakismet_spec.rb
CHANGED
@@ -39,17 +39,17 @@ describe Rakismet do
|
|
39
39
|
describe ".validate_config" do
|
40
40
|
it "should raise an error if key is not found" do
|
41
41
|
Rakismet.key = ''
|
42
|
-
lambda { Rakismet.send(:validate_config) }.should raise_error
|
42
|
+
lambda { Rakismet.send(:validate_config) }.should raise_error(Rakismet::Undefined)
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should raise an error if url is not found" do
|
46
46
|
Rakismet.url = ''
|
47
|
-
lambda { Rakismet.send(:validate_config) }.should raise_error
|
47
|
+
lambda { Rakismet.send(:validate_config) }.should raise_error(Rakismet::Undefined)
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should raise an error if host is not found" do
|
51
51
|
Rakismet.host = ''
|
52
|
-
lambda { Rakismet.send(:validate_config) }.should raise_error
|
52
|
+
lambda { Rakismet.send(:validate_config) }.should raise_error(Rakismet::Undefined)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh French
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project: rakismet
|
90
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.6.11
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Akismet and TypePad AntiSpam integration for Rails.
|