Sha256: 1c89e72968c9db98859a394b51ffd5b72103f011fa4b214207877a08148c3107
Contents?: true
Size: 1.08 KB
Versions: 16
Compression:
Stored size: 1.08 KB
Contents
require 'yaml' module Gitx class Configuration CONFIG_FILE = '.gitx.yml' attr_reader :config def initialize(root_dir) @config = Thor::CoreExt::HashWithIndifferentAccess.new @config.merge!(load_config(File.join(__dir__, 'defaults.yml'))) @config.merge!(load_config(File.join(root_dir, CONFIG_FILE))) end def base_branch config[:base_branch] end def aggregate_branches config[:aggregate_branches] end def aggregate_branch?(branch) aggregate_branches.include?(branch) end def reserved_branches config[:reserved_branches] end def reserved_branch?(branch) reserved_branches.include?(branch) end def taggable_branches config[:taggable_branches] end def taggable_branch?(branch) taggable_branches.include?(branch) end def after_release_scripts config[:after_release] end private # load configuration file def load_config(path) if File.exist?(path) ::YAML.load_file(path) else {} end end end end
Version data entries
16 entries across 16 versions & 1 rubygems