Sha256: 5d747b8b48cc74bc06ebde71580836238feb7ca29213dbbc2f70cf2763e493e7
Contents?: true
Size: 796 Bytes
Versions: 33
Compression:
Stored size: 796 Bytes
Contents
module PowerStencil module Utils module SecureRequire def securely_require(ruby_source_file, fail_on_error: false) PowerStencil.logger.debug "Securely requiring Ruby source file '#{ruby_source_file}'..." require ruby_source_file yield if block_given? rescue => e PowerStencil.logger.debug PowerStencil::Error.report_error(e) msg = "Could not require Ruby source file '#{ruby_source_file}' !" if fail_on_error msg << ' Aborting !' PowerStencil.logger.error msg raise PowerStencil::Error, "Invalid Ruby source file: '#{ruby_source_file}' !" else msg << " (#{e.message})" msg << ' Ignoring...' PowerStencil.logger.warn msg end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems