mikehale-akismet 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Michael Hale
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,8 @@
1
+ Akismet
2
+ =======
3
+ Ruby Library for talking to the akismet spam service. See http://akismet.com/development/api/ for detailed api information.
4
+
5
+ COPYRIGHT
6
+ =========
7
+
8
+ Copyright (c) 2008 Michael Hale. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ require 'rake'
2
+
3
+ begin
4
+ require 'jeweler'
5
+ Jeweler::Tasks.new do |s|
6
+ s.name = "akismet"
7
+ s.summary = %Q{TODO}
8
+ s.email = "mikehale@gmail.com"
9
+ s.homepage = "http://github.com/mikehale/akismet"
10
+ s.description = "TODO"
11
+ s.authors = ["Michael Hale"]
12
+ end
13
+ rescue LoadError
14
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
15
+ end
16
+
17
+ require 'rake/rdoctask'
18
+ Rake::RDocTask.new do |rdoc|
19
+ rdoc.rdoc_dir = 'rdoc'
20
+ rdoc.title = 'akismet'
21
+ rdoc.options << '--line-numbers' << '--inline-source'
22
+ rdoc.rdoc_files.include('README*')
23
+ rdoc.rdoc_files.include('lib/**/*.rb')
24
+ end
25
+
26
+ require 'spec/rake/spectask'
27
+ Spec::Rake::SpecTask.new(:spec) do |t|
28
+ t.libs << 'lib' << 'spec'
29
+ t.spec_files = FileList['spec/**/*_spec.rb']
30
+ end
31
+
32
+ Spec::Rake::SpecTask.new(:rcov) do |t|
33
+ t.libs << 'lib' << 'spec'
34
+ t.spec_files = FileList['spec/**/*_spec.rb']
35
+ t.rcov = true
36
+ end
37
+
38
+ begin
39
+ require 'cucumber/rake/task'
40
+ Cucumber::Rake::Task.new(:features)
41
+ rescue LoadError
42
+ puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
43
+ end
44
+
45
+ task :default => :spec
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 3
3
- :major: 0
4
2
  :minor: 0
3
+ :patch: 4
4
+ :major: 0
data/lib/akismet.rb CHANGED
@@ -63,6 +63,7 @@ class Akismet
63
63
  def post_data(hash)
64
64
  hash.inject([]) do |memo, hash|
65
65
  k, v = hash
66
+ v ||= ""
66
67
  memo << "#{k}=#{URI.escape(v)}"
67
68
  end.join('&')
68
69
  end
data/spec/akismet_spec.rb CHANGED
@@ -61,6 +61,10 @@ describe "Akismet" do
61
61
  request.body.should include("comment_author_url=blog.smith.com")
62
62
  request.body.should include("comment_content=viagra-test-123")
63
63
  end
64
+
65
+ it "should handle nil values" do
66
+ lambda {@akismet.spam?(params.update(:referrer => nil))}.should_not raise_error
67
+ end
64
68
 
65
69
  it "should detect ham" do
66
70
  @akismet.ham?(params.update(:comment_content => "not spam")).should == true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mikehale-akismet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hale
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-07 00:00:00 -07:00
12
+ date: 2009-05-15 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -19,20 +19,23 @@ executables: []
19
19
 
20
20
  extensions: []
21
21
 
22
- extra_rdoc_files: []
23
-
22
+ extra_rdoc_files:
23
+ - LICENSE
24
+ - README
24
25
  files:
26
+ - LICENSE
27
+ - Rakefile
25
28
  - VERSION.yml
26
29
  - lib/akismet.rb
27
30
  - spec/akismet_spec.rb
28
31
  - spec/spec.opts
29
32
  - spec/spec_helper.rb
30
33
  - spec/spec_http.rb
31
- has_rdoc: true
34
+ - README
35
+ has_rdoc: false
32
36
  homepage: http://github.com/mikehale/akismet
33
37
  post_install_message:
34
38
  rdoc_options:
35
- - --inline-source
36
39
  - --charset=UTF-8
37
40
  require_paths:
38
41
  - lib
@@ -53,7 +56,9 @@ requirements: []
53
56
  rubyforge_project:
54
57
  rubygems_version: 1.2.0
55
58
  signing_key:
56
- specification_version: 2
59
+ specification_version: 3
57
60
  summary: TODO
58
- test_files: []
59
-
61
+ test_files:
62
+ - spec/akismet_spec.rb
63
+ - spec/spec_helper.rb
64
+ - spec/spec_http.rb