akismet 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/akismet/client.rb +9 -10
- data/lib/akismet/version.rb +1 -1
- metadata +19 -39
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Akismet
|
|
4
4
|
A Ruby client for the Akismet API.
|
5
5
|
|
6
6
|
Instantiate an `Akismet::Client` with your API key and home page URL. Then
|
7
|
-
call `verify_key`, `
|
7
|
+
call `verify_key`, `comment_check`, `submit_ham`, or `submit_spam`.
|
8
8
|
|
9
9
|
Use `Akismet::Client.open` or `Akismet::Client#open` to submit multiple
|
10
10
|
requests over a single TCP connection.
|
data/lib/akismet/client.rb
CHANGED
@@ -9,7 +9,7 @@ module Akismet
|
|
9
9
|
#
|
10
10
|
# # Verify an API key
|
11
11
|
# #
|
12
|
-
#
|
12
|
+
#
|
13
13
|
# Akismet::Client.new( 'apikey123', 'http://jonahb.com' ).verify_key
|
14
14
|
#
|
15
15
|
# @example
|
@@ -27,14 +27,14 @@ module Akismet
|
|
27
27
|
# request.user_agent,
|
28
28
|
# :content_type => 'comment',
|
29
29
|
# :referrer => request.headers[ 'HTTP_REFERER' ],
|
30
|
-
# :permalink => post_url,
|
30
|
+
# :permalink => post_url,
|
31
31
|
# :comment_author => comment.author,
|
32
32
|
# :comment_author_email => comment.author_email,
|
33
33
|
# :comment_content => comment.body )
|
34
34
|
#
|
35
35
|
# if spam
|
36
36
|
# # ...
|
37
|
-
# end
|
37
|
+
# end
|
38
38
|
#
|
39
39
|
# @example
|
40
40
|
#
|
@@ -141,7 +141,7 @@ module Akismet
|
|
141
141
|
# to submit a batch of requests using a single TCP and HTTP session.
|
142
142
|
#
|
143
143
|
# If you don't call this before calling {#comment_check}, {#submit_ham},
|
144
|
-
# or {#submit_spam}, a session will be created and opened for the duration
|
144
|
+
# or {#submit_spam}, a session will be created and opened for the duration
|
145
145
|
# of the call.
|
146
146
|
#
|
147
147
|
# Note that calls to {#verify_key} always create a session. This is due to
|
@@ -258,7 +258,7 @@ module Akismet
|
|
258
258
|
params )
|
259
259
|
|
260
260
|
unless response.body == 'Thanks for making the web a better place.'
|
261
|
-
|
261
|
+
raise_with_response response
|
262
262
|
end
|
263
263
|
|
264
264
|
nil
|
@@ -280,7 +280,7 @@ module Akismet
|
|
280
280
|
params )
|
281
281
|
|
282
282
|
unless response.body == 'Thanks for making the web a better place.'
|
283
|
-
|
283
|
+
raise_with_response response
|
284
284
|
end
|
285
285
|
|
286
286
|
nil
|
@@ -332,14 +332,13 @@ module Akismet
|
|
332
332
|
params = params.merge :blog => home_url,
|
333
333
|
:user_ip => user_ip,
|
334
334
|
:user_agent => user_agent
|
335
|
-
|
335
|
+
|
336
336
|
response = in_http_session do |session|
|
337
337
|
invoke( session, method_name, params )
|
338
338
|
end
|
339
339
|
|
340
340
|
if response.body == 'invalid'
|
341
341
|
raise Error.new( Error::INVALID_API_KEY, 'Invalid API key' )
|
342
|
-
raise Error, 'Invalid API key'
|
343
342
|
end
|
344
343
|
|
345
344
|
response
|
@@ -404,7 +403,7 @@ module Akismet
|
|
404
403
|
#
|
405
404
|
def user_agent_plugin
|
406
405
|
"Ruby Akismet/#{ Akismet::VERSION }"
|
407
|
-
end
|
408
|
-
|
406
|
+
end
|
407
|
+
|
409
408
|
end
|
410
409
|
end
|
data/lib/akismet/version.rb
CHANGED
metadata
CHANGED
@@ -1,32 +1,22 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: akismet
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jonah Burke
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2012-01-14 00:00:00 Z
|
12
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
14
|
description: A Ruby client for the Akismet API
|
22
15
|
email: jonah@jonahb.com
|
23
16
|
executables: []
|
24
|
-
|
25
17
|
extensions: []
|
26
|
-
|
27
18
|
extra_rdoc_files: []
|
28
|
-
|
29
|
-
files:
|
19
|
+
files:
|
30
20
|
- README.md
|
31
21
|
- MIT-LICENSE
|
32
22
|
- lib/akismet/client.rb
|
@@ -34,38 +24,28 @@ files:
|
|
34
24
|
- lib/akismet/version.rb
|
35
25
|
- lib/akismet.rb
|
36
26
|
homepage: http://github.com/jonahb/akismet
|
37
|
-
licenses:
|
27
|
+
licenses:
|
38
28
|
- MIT
|
39
29
|
post_install_message:
|
40
30
|
rdoc_options: []
|
41
|
-
|
42
|
-
require_paths:
|
31
|
+
require_paths:
|
43
32
|
- lib
|
44
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
34
|
none: false
|
46
|
-
requirements:
|
47
|
-
- -
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
|
50
|
-
|
51
|
-
- 0
|
52
|
-
version: "0"
|
53
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
40
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
version: "0"
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
62
45
|
requirements: []
|
63
|
-
|
64
46
|
rubyforge_project:
|
65
|
-
rubygems_version: 1.8.
|
47
|
+
rubygems_version: 1.8.23.2
|
66
48
|
signing_key:
|
67
49
|
specification_version: 3
|
68
50
|
summary: A Ruby client for the Akismet API
|
69
51
|
test_files: []
|
70
|
-
|
71
|
-
has_rdoc: yard
|