public
Fork of rsanheim/brain_buster
Description: BrainBuster - a logic captcha for Rails
Homepage: http://opensource.thinkrelevance.com/wiki/BrainBuster
Clone URL: git://github.com/fiveruns/brain_buster.git
use append_view_paths instead of directly appending to it, for edge rails 
compatibility [Hashrocket]
remove #send for 1.9 compatibility
update changelog
rsanheim (author)
Fri Feb 22 13:17:54 -0800 2008
commit  94d1804757b5eeca0339a3e55fce5f45fcf6df8d
tree    3226f8af83736ee5b46e8f197443ee3474f44fba
parent  6e9493f59b20dca93f24b0dd02a87bca12e75c7f
...
9
10
11
12
 
 
 
 
 
13
14
15
...
9
10
11
 
12
13
14
15
16
17
18
19
0
@@ -9,7 +9,11 @@ TODOs (someday/maybe)
0
   # protect :update, :from => [:show, :index]
0
   # brain_buster_form_on :show, :protect => :update
0
 
0
-0.8.0 (2007/02/12)
0
+0.8.1 2008/02/22
0
+* use append_view_paths instead of directly appending to it, for edge rails compatibility [Hashrocket]
0
+* remove #send for 1.9 compatibility
0
+
0
+0.8.0 2008/02/12
0
 * clean up all over the place
0
 * fix for Rails 2 compatibility - return false doesn't halt the filter chain
0
 * rename brain_buster_error_message to brain_buster_failure_message
...
1
2
3
4
5
 
6
...
1
2
3
 
4
5
6
0
@@ -1,4 +1,4 @@
0
 require 'brain_buster'
0
 require 'brain_buster_system'
0
 
0
-ActionController::Base.send(:include, BrainBusterSystem)
0
\ No newline at end of file
0
+ActionController::Base.class_eval { include BrainBusterSystem }
0
\ No newline at end of file
...
10
11
12
13
 
14
15
16
...
10
11
12
 
13
14
15
16
0
@@ -10,7 +10,7 @@ module BrainBusterSystem
0
   # Expose helper methods and setup config for brain buster
0
   def self.included(obj)
0
     obj.helper_method :captcha_passed?, :last_captcha_attempt_failed?
0
- obj.view_paths << File.expand_path(File.join("vendor", "plugins", "brain_buster", "views", "brain_busters"))
0
+ obj.append_view_path File.expand_path(File.join("vendor", "plugins", "brain_buster", "views", "brain_busters"))
0
     obj.class_eval do
0
       @@brain_buster_salt ||= "fGr0FXmYQCuW4TiQj/x3yPBTp5lcJ9l6DbO8CUpReDk="
0
       @@brain_buster_failure_message = "Your captcha answer failed - please try again."
...
32
33
34
 
 
 
 
 
35
36
37
...
32
33
34
35
36
37
38
39
40
41
42
0
@@ -32,6 +32,11 @@ context "BrainBuster contract" do
0
     @controller.brain_buster_salt = [Array.new(32){rand(256).chr}.join].pack("m").chomp
0
   end
0
   
0
+ specify "should add the plugin view path to the view path" do
0
+ plugin_view_path = File.expand_path(File.join(File.dirname(__FILE__), "..", "views", "brain_busters"))
0
+ @controller.view_paths.should.include plugin_view_path
0
+ end
0
+
0
   specify "should raise an exception if the salt doesnt get set to something" do
0
     @controller.brain_buster_salt = nil
0
     lambda { get(:new) }.should.raise(RuntimeError)

Comments

    No one has commented yet.