module LetsencryptPlugin::Configuration

This is a class whose responsibility is to load the lets_encrypt configuration file

Public Class Methods

create_config(config_hash) click to toggle source
# File lib/letsencrypt_plugin/configuration.rb, line 11
def self.create_config(config_hash)
  Config.new(config_hash.merge(config_hash.fetch(Rails.env, {})) || {})
end
evaluate_file(filename) click to toggle source
# File lib/letsencrypt_plugin/configuration.rb, line 19
def self.evaluate_file(filename)
  ERB.new(read_file(filename)).result
end
load_file(filename = Rails.root.join('config', 'letsencrypt_plugin.yml')) click to toggle source
# File lib/letsencrypt_plugin/configuration.rb, line 6
def self.load_file(filename = Rails.root.join('config', 'letsencrypt_plugin.yml'))
  config_data = parse_yaml_file(filename)
  create_config(config_data)
end
parse_yaml_file(filename) click to toggle source
# File lib/letsencrypt_plugin/configuration.rb, line 23
def self.parse_yaml_file(filename)
  YAML.load(evaluate_file(filename))
end
read_file(filename) click to toggle source
# File lib/letsencrypt_plugin/configuration.rb, line 15
def self.read_file(filename)
  File.read(filename)
end