Sha256: 9819c3f1fd926fcc2ce67d97939c24cc494d92ff2c3abd53987db8c3d5bee5dd

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

# encoding: utf-8

module SoaringSimpleCaptcha
  autoload :Utils,             'soaring_simple_captcha/utils'

  autoload :ImageHelpers,      'soaring_simple_captcha/image'
  autoload :ViewHelper,        'soaring_simple_captcha/view'
  autoload :ControllerHelpers, 'soaring_simple_captcha/controller'

  autoload :FormBuilder,       'soaring_simple_captcha/form_builder'
  autoload :CustomFormBuilder, 'soaring_simple_captcha/formtastic'

  if defined?(ActiveRecord)
    autoload :ModelHelpers,      'soaring_simple_captcha/active_record'
    autoload :SimpleCaptchaData, 'soaring_simple_captcha/simple_captcha_data'
  else
    autoload :SimpleCaptchaData,      'soaring_simple_captcha/simple_captcha_data_mongoid.rb'
  end


  autoload :Middleware,        'soaring_simple_captcha/middleware'

  mattr_accessor :image_size
  @@image_size = "100x28"

  mattr_accessor :length
  @@length = 5

  # 'embosed_silver',
  # 'simply_red',
  # 'simply_green',
  # 'simply_blue',
  # 'distorted_black',
  # 'all_black',
  # 'charcoal_grey',
  # 'almost_invisible'
  # 'random'
  mattr_accessor :image_style
  @@image_style = 'simply_blue'

  # 'low', 'medium', 'high', 'random'
  mattr_accessor :distortion
  @@distortion = 'low'

  # command path
  mattr_accessor :image_magick_path
  @@image_magick_path = ''

  # tmp directory
  mattr_accessor :tmp_path
  @@tmp_path = nil

  def self.add_image_style(name, params = [])
    SoaringSimpleCaptcha::ImageHelpers.image_styles.update(name.to_s => params)
  end

  def self.setup
    yield self
  end
end

require 'soaring_simple_captcha/engine' if defined?(Rails)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soaring_simple_captcha-0.1.6 lib/soaring_simple_captcha.rb