Sha256: ac61092beef38bb8c51b9df88dac91afb05308dc98da5d0cb084a94f913634d4
Contents?: true
Size: 876 Bytes
Versions: 23
Compression:
Stored size: 876 Bytes
Contents
module CC module CLI class Config delegate :to_yaml, to: :config def initialize @config = { "engines" => {}, "ratings" => { "paths" => [] }, } end def add_engine(engine_name, engine_config) config["engines"][engine_name] = { "enabled" => true } if engine_config["default_config"].present? config["engines"][engine_name]["config"] = engine_config["default_config"] end config["ratings"]["paths"] |= engine_config["default_ratings_paths"] end def add_exclude_paths(paths) config["exclude_paths"] ||= [] config["exclude_paths"] += paths.map do |path| if path.ends_with?("/") "#{path}**/*" else path end end end private attr_reader :config end end end
Version data entries
23 entries across 23 versions & 1 rubygems