Sha256: 1c5240b9e5cb6304c9381355dcf55cd3d76e9684fd668f2c1c171341be8654b0

Contents?: true

Size: 267 Bytes

Versions: 6

Compression:

Stored size: 267 Bytes

Contents

module Kernel
  # Raise error if Load Failed
  # @param [String] file file to Load
  # @param [String] prompt To prompt what when load error
  def safe_require(file, prompt)
    begin
      require file
    rescue LoadError => _e
      raise prompt
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
em-midori-0.2.0 lib/midori/core_ext/safe_require.rb
em-midori-0.1.12 lib/midori/core_ext/safe_require.rb
em-midori-0.1.11 lib/midori/core_ext/safe_require.rb
em-midori-0.1.10 lib/midori/core_ext/safe_require.rb
em-midori-0.1.9 lib/midori/core_ext/safe_require.rb
em-midori-0.1.8 lib/midori/core_ext/safe_require.rb