abongo 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  class Abongo
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  MAJOR_VERSION = '1'
4
4
  end
@@ -56,6 +56,15 @@ class Abongo
56
56
  #This causes an AJAX post against the URL. That URL should call Abongo.human!
57
57
  #This guarantees that anyone calling Abongo.human! is capable of at least minimal Javascript execution, and thus is (probably) not a robot.
58
58
  def include_humanizing_javascript(url = "/abongo_mark_human", style = :prototype)
59
+ begin
60
+ return if Abongo.is_human?
61
+ rescue
62
+ if Abongo.options[:failsafe]
63
+ else
64
+ raise
65
+ end
66
+ end
67
+
59
68
  script = nil
60
69
  if (style == :prototype)
61
70
  script = "var a=Math.floor(Math.random()*11); var b=Math.floor(Math.random()*11);var x=new Ajax.Request('#{url}', {parameters:{a: a, b: b, c: a+b}})"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 4
9
- version: 1.0.4
8
+ - 5
9
+ version: 1.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Fairley
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-28 00:00:00 -08:00
17
+ date: 2011-03-12 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency