# File lib/jammit.rb, line 67
  def self.load_configuration(config_path, soft=false)
    exists = config_path && File.exists?(config_path)
    return false if soft && !exists
    raise MissingConfiguration, "could not find the \"#{config_path}\" configuration file" unless exists
    conf = YAML.load(ERB.new(File.read(config_path)).result)

    # Optionally overwrite configuration based on the environment.
    rails_env = defined?(Rails) ? Rails.env : ENV['RAILS_ENV']
    conf.merge! conf.delete rails_env if conf.has_key? rails_env

    @config_path            = config_path
    @configuration          = symbolize_keys(conf)
    @package_path           = conf[:package_path] || DEFAULT_PACKAGE_PATH
    @embed_assets           = conf[:embed_assets] || conf[:embed_images]
    @compress_assets        = !(conf[:compress_assets] == false)
    @gzip_assets            = !(conf[:gzip_assets] == false)
    @allow_debugging        = !(conf[:allow_debugging] == false)
    @mhtml_enabled          = @embed_assets && @embed_assets != "datauri"
    @compressor_options     = symbolize_keys(conf[:compressor_options] || {})
    @css_compressor_options = symbolize_keys(conf[:css_compressor_options] || {})
    set_javascript_compressor(conf[:javascript_compressor])
    set_package_assets(conf[:package_assets])
    set_template_function(conf[:template_function])
    set_template_namespace(conf[:template_namespace])
    set_template_extension(conf[:template_extension])
    set_public_root(conf[:public_root]) if conf[:public_root]
    symbolize_keys(conf[:stylesheets]) if conf[:stylesheets]
    symbolize_keys(conf[:javascripts]) if conf[:javascripts]
    check_for_deprecations
    self
  end