module CensorBear class Configuration # class name of you User model, default: 'User' attr_accessor :user_class # current_user method name in your Controller, default: 'current_user' attr_accessor :current_user_method attr_accessor :username_method attr_accessor :main_app_root_path_method attr_accessor :main_app_user_path_method # 第三方服务商名称, 默认为 aliyun attr_accessor :service # 阿里云绿网 API KEY attr_accessor :aliyun_green_access_key_id attr_accessor :aliyun_green_access_key_secret attr_accessor :aliyun_green_enable_internal attr_accessor :aliyun_green_image_callback_url end class << self def config return @config if defined?(@config) @config = Configuration.new # ModLog 管理后台 @config.user_class = "User" @config.current_user_method = "current_user" @config.username_method = "username" @config.main_app_root_path_method = "root_path" @config.main_app_user_path_method = "user_path" @config.service = "aliyun" # 阿里云绿网 API KEY # https://www.aliyun.com/product/lvwang @config.aliyun_green_access_key_id = "" @config.aliyun_green_access_key_secret = "" @config.aliyun_green_enable_internal = false @config end def configure yield(config) end def check_text(content, force = false) # Censor.new(content, type, options).check_text end end end