class Gitx::Configuration

Constants

CONFIG_FILE

Attributes

config[R]

Public Class Methods

new(root_dir) click to toggle source
# File lib/gitx/configuration.rb, line 10
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

Public Instance Methods

after_release_scripts() click to toggle source
# File lib/gitx/configuration.rb, line 48
def after_release_scripts
  config[:after_release]
end
aggregate_branch?(branch) click to toggle source
# File lib/gitx/configuration.rb, line 28
def aggregate_branch?(branch)
  aggregate_branches.include?(branch)
end
aggregate_branches() click to toggle source
# File lib/gitx/configuration.rb, line 24
def aggregate_branches
  config[:aggregate_branches]
end
base_branch() click to toggle source
# File lib/gitx/configuration.rb, line 16
def base_branch
  config[:base_branch]
end
release_label() click to toggle source
# File lib/gitx/configuration.rb, line 20
def release_label
  config[:release_label]
end
reserved_branch?(branch) click to toggle source
# File lib/gitx/configuration.rb, line 36
def reserved_branch?(branch)
  reserved_branches.include?(branch)
end
reserved_branches() click to toggle source
# File lib/gitx/configuration.rb, line 32
def reserved_branches
  config[:reserved_branches]
end
taggable_branch?(branch) click to toggle source
# File lib/gitx/configuration.rb, line 44
def taggable_branch?(branch)
  taggable_branches.include?(branch)
end
taggable_branches() click to toggle source
# File lib/gitx/configuration.rb, line 40
def taggable_branches
  config[:taggable_branches]
end

Private Instance Methods

load_config(path) click to toggle source

load configuration file

# File lib/gitx/configuration.rb, line 55
def load_config(path)
  if File.exist?(path)
    ::YAML.load_file(path)
  else
    {}
  end
end