# frozen_string_literal: true require 'konfig' require 'core_ext' module Booru class Config < Konfig::Config ROOT = Rails.root.join('config', 'booru') CONFIG_CATEGORIES = [:aggregation, :avatar, :badges, :footer, :imports, :quick_tag_table, :ratings, :reports, :secrets, :settings, :tag, :wilson, :livefeed].freeze attr_accessor *CONFIG_CATEGORIES def initialize super ROOT, CONFIG_CATEGORIES end end # A global configuration object that contains items such as # predefined object mappings. To add a new element, simply # create a new YAML file in config/booru and add its name to # CONFIG_CATEGORIES. # # For example, if config/booru/test.yml contains # :hello_world: # - hello # - world # then the resulting Hash will be accessible at Booru::CONFIG.test, # and will be the following: # { :hello_world => ["hello", "world"] } CONFIG = Config.new end