2015-10-26 06:09:39 +00:00
|
|
|
require 'active_support/core_ext'
|
|
|
|
require_relative 'rucaptcha/version'
|
|
|
|
require_relative 'rucaptcha/configuration'
|
|
|
|
require_relative 'rucaptcha/controller_helpers'
|
|
|
|
require_relative 'rucaptcha/view_helpers'
|
2015-10-26 09:40:59 +00:00
|
|
|
require_relative 'rucaptcha/captcha'
|
2015-10-26 06:09:39 +00:00
|
|
|
require_relative 'rucaptcha/engine'
|
|
|
|
|
|
|
|
module RuCaptcha
|
|
|
|
class << self
|
|
|
|
def config
|
|
|
|
return @config if defined?(@config)
|
|
|
|
@config = Configuration.new
|
|
|
|
@config.len = 4
|
2015-10-26 09:40:59 +00:00
|
|
|
@config.width = 150
|
2015-10-26 06:09:39 +00:00
|
|
|
@config.height = 48
|
2015-10-26 09:40:59 +00:00
|
|
|
@config.implode = 0.4
|
2015-10-26 06:09:39 +00:00
|
|
|
@config
|
|
|
|
end
|
|
|
|
|
|
|
|
def configure(&block)
|
|
|
|
config.instance_exec(&block)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
ActionController::Base.send :include, RuCaptcha::ControllerHelpers
|
|
|
|
ActionView::Base.send :include, RuCaptcha::ViewHelpers
|