spamtrap 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,8 +6,9 @@ module Spamtrap
6
6
 
7
7
  module ActsAsMethods
8
8
  def spamtrap(actions, parameter='spamtrap')
9
+ actions = [actions] unless actions.is_a?(Array)
9
10
  raise 'Spamtrap must have actions defined.' if actions.empty?
10
- before_filter(:only => actions.is_a?(Array) ? actions : [actions]) do |controller|
11
+ before_filter(:only => actions) do |controller|
11
12
  controller.instance_eval do
12
13
  if params[parameter.to_s].present?
13
14
  Rails.logger.warn "Spamtrap triggered by #{request.remote_ip}."
@@ -1,5 +1,5 @@
1
1
  module Spamtrap
2
2
 
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spamtrap
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cedric Howe
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-21 00:00:00 -04:00
18
+ date: 2010-10-26 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency