class PrChangelog::Config

Loads the configuration

Constants

DEFAULTS

Attributes

loaded_data[R]

Public Class Methods

new(file = nil) click to toggle source
# File lib/pr_changelog/config.rb, line 40
def initialize(file = nil)
  @file = file || '.pr_changelog.json'
  @loaded_data = {}

  return unless File.exist?(@file)

  @loaded_data = JSON.parse(File.read(@file), symbolize_names: true)
end

Public Instance Methods

default_format() click to toggle source
# File lib/pr_changelog/config.rb, line 49
def default_format
  loaded_data[:format] || DEFAULTS[:format]
end
default_strategy() click to toggle source
# File lib/pr_changelog/config.rb, line 53
def default_strategy
  loaded_data[:strategy] || DEFAULTS[:strategy]
end
tags() click to toggle source
# File lib/pr_changelog/config.rb, line 57
def tags
  loaded_data[:tags] || DEFAULTS[:tags]
end