rakismet 0.3.5 → 0.3.6
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.
- data/CHANGELOG +2 -2
- data/README.md +4 -12
- data/lib/rakismet.rb +1 -1
- data/lib/rakismet/model_extensions.rb +6 -4
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= 0.3.5
|
2
|
-
* Added gemspec and rails/init.rb so rakismet can work as a gem [
|
3
|
-
* Added generator template and manifest [
|
2
|
+
* Added gemspec and rails/init.rb so rakismet can work as a gem [Michael Air]
|
3
|
+
* Added generator template and manifest [Michael Air]
|
4
4
|
= 0.3.0
|
5
5
|
* Abstract out Rakismet version string
|
6
6
|
* Set default Akismet Host
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@ Rakismet
|
|
2
2
|
========
|
3
3
|
|
4
4
|
**Akismet** (<http://akismet.com/>) is a collaborative spam filtering service.
|
5
|
-
**Rakismet** is easy Akismet integration with your Rails app, including
|
6
|
-
for TypePad's AntiSpam service.
|
5
|
+
**Rakismet** is easy Akismet integration with your Rails app, including
|
6
|
+
support for TypePad's AntiSpam service.
|
7
7
|
|
8
8
|
|
9
9
|
Setup
|
@@ -41,8 +41,8 @@ from WordPress.
|
|
41
41
|
If you wish to use another Akismet-compatible API provider such as TypePad's
|
42
42
|
antispam service, you'll also need to change the `Rakismet::HOST`.
|
43
43
|
|
44
|
-
Finally, introduce Rakismet to your application. Let's assume you have a
|
45
|
-
model and a CommentsController:
|
44
|
+
Finally, introduce Rakismet to your application. Let's assume you have a
|
45
|
+
Comment model and a CommentsController:
|
46
46
|
|
47
47
|
class Comment < ActiveRecord::Base
|
48
48
|
has_rakismet
|
@@ -144,13 +144,5 @@ options.
|
|
144
144
|
has_rakismet :only => :create
|
145
145
|
end
|
146
146
|
|
147
|
-
Forked
|
148
|
-
=============================
|
149
|
-
|
150
|
-
At the time of forking, the only addition to this project has been to add gemspec
|
151
|
-
and generator templates so rakismet can be used as a gem. This is a better solution
|
152
|
-
when working with reloadable plugins as rakismet is not compatible when plugins are
|
153
|
-
reloadable.
|
154
|
-
|
155
147
|
--------------------------------------------------------------
|
156
148
|
Copyright (c) 2008 Josh French, released under the MIT license
|
data/lib/rakismet.rb
CHANGED
@@ -19,7 +19,7 @@ module Rakismet
|
|
19
19
|
self.akismet_attrs[fieldname] = args.delete(field) || field
|
20
20
|
end
|
21
21
|
[:user_ip, :user_agent, :referrer].each do |field|
|
22
|
-
self.akismet_attrs[field] =
|
22
|
+
self.akismet_attrs[field] = args.delete(field)
|
23
23
|
end
|
24
24
|
args.each_pair do |f,v|
|
25
25
|
self.akismet_attrs[f] = v
|
@@ -56,12 +56,14 @@ module Rakismet
|
|
56
56
|
self.class.akismet_attrs.keys.inject({}) do |data,attr|
|
57
57
|
data.merge attr => if self.class.akismet_attrs[attr].is_a?(Proc)
|
58
58
|
instance_eval(&self.class.akismet_attrs[attr])
|
59
|
-
elsif respond_to?(self.class.akismet_attrs[attr])
|
59
|
+
elsif !self.class.akismet_attrs[attr].nil? && respond_to?(self.class.akismet_attrs[attr])
|
60
60
|
send(self.class.akismet_attrs[attr])
|
61
|
-
|
61
|
+
elsif !self.class.akismet_attrs[attr].nil?
|
62
62
|
self.class.akismet_attrs[attr]
|
63
|
+
elsif respond_to?(attr)
|
64
|
+
send(attr)
|
63
65
|
end
|
64
|
-
end
|
66
|
+
end.delete_if { |k,v| v.blank? }
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
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: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh French
|
@@ -9,12 +9,12 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-05 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: Rakismet is easy Akismet integration with your Rails app, including support for TypePad's AntiSpam service.
|
17
|
-
email:
|
17
|
+
email: josh@digitalpulp.com
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions: []
|