spamtrap 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/spamtrap/controller.rb +1 -3
- data/lib/spamtrap/helper.rb +0 -1
- data/lib/spamtrap/version.rb +1 -1
- metadata +4 -4
data/lib/spamtrap/controller.rb
CHANGED
@@ -7,12 +7,10 @@ module Spamtrap
|
|
7
7
|
module ActsAsMethods
|
8
8
|
def spamtrap(actions, parameter='spamtrap')
|
9
9
|
raise 'Spamtrap must have actions defined.' if actions.empty?
|
10
|
-
# helper_attr :spamtrap_parameter
|
11
|
-
# attr_accessor :spamtrap_parameter
|
12
|
-
# self.spamtrap_parameter = parameter
|
13
10
|
before_filter(:only => actions.is_a?(Array) ? actions : [actions]) do |controller|
|
14
11
|
controller.instance_eval do
|
15
12
|
if params[parameter.to_s].present?
|
13
|
+
Rails.logger.warn "Spamtrap triggered by #{request.remote_ip}."
|
16
14
|
render :nothing => true, :status => 200
|
17
15
|
end
|
18
16
|
end
|
data/lib/spamtrap/helper.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
class ActionView::Helpers::FormBuilder
|
2
2
|
def spamtrap(parameter='spamtrap', options={})
|
3
|
-
# parameter ||= @template.controller.spamtrap_parameter || 'spamtrap'
|
4
3
|
options.reverse_merge({:class => 'spamtrap'})
|
5
4
|
@template.content_tag(:div, options) do
|
6
5
|
@template.label_tag(parameter) +
|
data/lib/spamtrap/version.rb
CHANGED
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
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-
|
18
|
+
date: 2010-10-21 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|