Sha256: 478c2055ce532e90c162396fe85a07a18c763af51be2467843b56648e6366ece
Contents?: true
Size: 782 Bytes
Versions: 4
Compression:
Stored size: 782 Bytes
Contents
# Frozen-string-literal: true # Copyright: 2012-2015 - MIT License # Encoding: utf-8 module Kernel def has_javascript? require "execjs" if block_given? yield end rescue LoadError, ExecJS::RuntimeUnavailable Jekyll.logger.debug("ExecJS or JS Runtime not available." \ " Skipping loading of library.") end # 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
4 entries across 4 versions & 1 rubygems