Sha256: 9bf9e54216ea3f151cd279042ce3a2180fa24ea9bf499d0bc82de6a975418cad
Contents?: true
Size: 772 Bytes
Versions: 12
Compression:
Stored size: 772 Bytes
Contents
# ---------------------------------------------------------------------------- # Frozen-string-literal: true # Copyright: 2012 - 2016 - MIT License # Encoding: utf-8 # ---------------------------------------------------------------------------- module Kernel def try_require(file) require file if block_given? yield end rescue LoadError return nil end # -------------------------------------------------------------------------- def try_require_if_javascript(file) ["execjs", file].map(&method(:require)) if block_given? yield end rescue LoadError, ExecJS::RuntimeUnavailable Jekyll.logger.debug("ExecJS, JS Runtime or `#{file}' not available." \ " Skipping the loading of libraries.") return end end
Version data entries
12 entries across 12 versions & 1 rubygems