Sha256: f71ce06c90a8352a5e5a175d58de1c3577422ad655817a0d3853014ee5a88b2d
Contents?: true
Size: 1.74 KB
Versions: 7
Compression:
Stored size: 1.74 KB
Contents
module Curate class << self attr_accessor :configuration end def self.configure self.configuration ||= Configuration.new yield(configuration) end class Configuration # An anonymous function that receives a path to a file # and returns AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE if no # virus is found; Any other returned value means a virus was found attr_writer :default_antivirus_instance def default_antivirus_instance @default_antivirus_instance ||= lambda {|file_path| AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE } end # Configure the application root url. attr_writer :application_root_url def application_root_url @application_root_url || (raise RuntimeError.new("Make sure to set your Curate.configuration.application_root_url")) end # When was this last built/deployed attr_writer :build_identifier def build_identifier # If you restart the server, this could be out of sync; A better # implementation is to read something from the file system. However # that detail is an exercise for the developer. @build_identifier ||= Time.now.strftime("%Y-%m-%d %H:%M:%S") end # Override characterization runner attr_accessor :characterization_runner def register_curation_concern(*curation_concern_types) Array(curation_concern_types).flatten.compact.each do |cc_type| class_name = ClassifyConcern.normalize_concern_name(cc_type) if ! registered_curation_concern_types.include?(class_name) self.registered_curation_concern_types << class_name end end end def registered_curation_concern_types @registered_curation_concern_types ||= [] end end configure {} end
Version data entries
7 entries across 7 versions & 1 rubygems