Module: RmagickCaptcha

Defined in:
lib/rmagick_captcha.rb,
lib/rmagick_captcha/version.rb,
lib/rmagick_captcha/view_additions.rb,
lib/rmagick_captcha/model_additions.rb,
lib/rmagick_captcha/rmagick_backend.rb,
lib/rmagick_captcha/controller_additions.rb,
lib/generators/rmagick_captcha/rmagick_captcha_generator.rb

Defined Under Namespace

Modules: ControllerAdditions, Generators, ModelAdditions, RmagickBackend, ViewAdditions

Constant Summary collapse

VERSION =
"0.6.4".freeze
@@options =

default options that can be overridden on the global level

{
  :controller         => "rmagick_captcha",                           #
  :action             => "show",                                      #
  :id                 => "id",                                        #
  :captcha_key_len    => 4,                                           #
  :case_sensitive     => true,                                        #
  :random_chars       => "ABCDEFGHJKLMNPQRSTUVWXYZ" + "0123456789",   #
  :random_colors      => ["red", "blue", "green", "gray", "pink"],    #
  :img_format         => "png",                                       #
  :gc_width           => 200,                                         #
  :gc_height          => 100,                                         #
  :font_family        => "times",                                     #
}

Class Method Summary collapse

Class Method Details

.enable_actionpackObject



32
33
34
35
36
# File 'lib/rmagick_captcha.rb', line 32

def self.enable_actionpack
  ActionController::Base.send :include, RmagickCaptcha::ControllerAdditions
  ActionController::Base.send :extend, RmagickCaptcha::ControllerAdditions::ClassMethods
  ActionView::Base.send :include, RmagickCaptcha::ViewAdditions
end

.enable_activerecordObject



27
28
29
30
# File 'lib/rmagick_captcha.rb', line 27

def self.enable_activerecord
  ActiveRecord::Base.send :include, RmagickCaptcha::ModelAdditions
  ActiveRecord::Base.send :extend, RmagickCaptcha::ModelAdditions::ClassMethods
end