module Jekyll::Minibundle::Environment

Public Class Methods

development?(site) click to toggle source
   # File lib/jekyll/minibundle/environment.rb
12 def self.development?(site)
13   mode = ENV['JEKYLL_MINIBUNDLE_MODE'] || Environment.find_site_config(site, %w[minibundle mode], String)
14   mode == 'development'
15 end
find_site_config(site, keys, type) click to toggle source
   # File lib/jekyll/minibundle/environment.rb
17 def self.find_site_config(site, keys, type)
18   value = Hashes.dig(site.config, *keys)
19 
20   if value && !value.is_a?(type)
21     raise "Invalid site configuration for key #{keys.join('.')}; expecting type #{type}"
22   end
23 
24   value
25 end
minifier_command(site, type) click to toggle source
   # File lib/jekyll/minibundle/environment.rb
 7 def self.minifier_command(site, type)
 8   type = type.to_s
 9   ENV["JEKYLL_MINIBUNDLE_CMD_#{type.upcase}"] || Environment.find_site_config(site, ['minibundle', 'minifier_commands', type], String)
10 end