Sha256: 958baa3a54089a887a8565aa68945bb611e71ef88413694b269e4bb3727ea5ed
Contents?: true
Size: 1.02 KB
Versions: 15
Compression:
Stored size: 1.02 KB
Contents
require 'yaml' module Gitx class Configuration DEFAULT_CONFIG = { 'aggregate_branches' => %w( staging prototype ), 'reserved_branches' => %w( HEAD master next_release staging prototype ), 'taggable_branches' => %w( master staging ) } CONFIG_FILE = '.gitx.yml' attr_reader :config def initialize(root_dir) @config = Thor::CoreExt::HashWithIndifferentAccess.new(DEFAULT_CONFIG) config_file_path = File.join(root_dir, CONFIG_FILE) @config.merge!(::YAML.load_file(config_file_path)) if File.exist?(config_file_path) 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 end end
Version data entries
15 entries across 15 versions & 1 rubygems