lib/simple_captcha.rb in glebtv-simple_captcha-0.1.6 vs lib/simple_captcha.rb in glebtv-simple_captcha-0.2.0
- old
+ new
@@ -8,42 +8,37 @@
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'
+
+ if defined?(Mongoid)
+ autoload :SimpleCaptchaData, 'simple_captcha/simple_captcha_data_mongoid'
+ else
+ autoload :SimpleCaptchaData, 'simple_captcha/simple_captcha_data_ar'
+ end
autoload :Middleware, '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'
+ mattr_accessor :image_color
+ @@image_color = '#0089d1'
# '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
+ # tmp directory
+ mattr_accessor :tmp_path
+ @@tmp_path = nil
def self.setup
yield self
end
end