Sha256: 4ce727b1a638e8395ba97705fe1c7f2c10ef435c3de6d71344d6f4693884d2b7
Contents?: true
Size: 620 Bytes
Versions: 7
Compression:
Stored size: 620 Bytes
Contents
module EnvironmentOverride module_function def with_anti_virus_scanner(success = true) if ! Rails.configuration.respond_to?(:default_antivirus_instance) raise RuntimeError, "Undefined Rails.configuration.default_antivirus_instance" end before_override = Rails.configuration.default_antivirus_instance instance = success ? lambda {|f| 0 } : lambda {|f| 1 } Rails.configuration.default_antivirus_instance = instance yield ensure if Rails.configuration.respond_to?(:default_antivirus_instance) Rails.configuration.default_antivirus_instance = before_override end end end
Version data entries
7 entries across 7 versions & 1 rubygems