Add default options filename as constant
This commit is contained in:
parent
179f110b8a
commit
4e6906dccf
|
@ -4,20 +4,21 @@ module GitHubChangelogGenerator
|
|||
ParserError = Class.new(StandardError)
|
||||
|
||||
class ParserFile
|
||||
FILENAME = ".github_changelog_generator"
|
||||
|
||||
def initialize(options)
|
||||
@options = options
|
||||
end
|
||||
|
||||
# Destructively change @options using data in configured options file.
|
||||
def parse!
|
||||
return unless file.exist?
|
||||
|
||||
file.each_line { |line| parse_line!(line) }
|
||||
file.each_line { |line| parse_line!(line) } if file.exist?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def file
|
||||
@file ||= Pathname(File.expand_path(@options[:params_file] || ".github_changelog_generator"))
|
||||
@file ||= Pathname(File.expand_path(@options[:params_file] || FILENAME))
|
||||
end
|
||||
|
||||
def parse_line!(line)
|
||||
|
|
Loading…
Reference in New Issue
Block a user