Sha256: fb3058b52965d61e0bc87905542586721d09b71897db7633bcf91dd178f04554

Contents?: true

Size: 1.2 KB

Versions: 6

Compression:

Stored size: 1.2 KB

Contents

# encoding: utf-8

module SimpleCaptcha
  autoload :Utils,             'simple_captcha/utils'

  autoload :ImageHelpers,      'simple_captcha/image'
  autoload :ViewHelper,        'simple_captcha/view'
  autoload :ControllerHelpers, 'simple_captcha/controller'
  autoload :ModelHelpers,      'simple_captcha/active_record'

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

  autoload :SimpleCaptchaData, 'simple_captcha/simple_captcha_data'

  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 = ''

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

  def self.setup
    yield self
  end
end

require 'simple_captcha/railtie'

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
wxianfeng_simple_captcha-0.5.0 lib/simple_captcha.rb
wxianfeng_simple_captcha-0.4.0 lib/simple_captcha.rb
wxianfeng_simple_captcha-0.3.0 lib/simple_captcha.rb
wxianfeng_simple_captcha-0.2.0 lib/simple_captcha.rb
wxianfeng_simple_captcha-0.1.0 lib/simple_captcha.rb
galetahub-simple_captcha-0.1.1 lib/simple_captcha.rb