ParserFile: removed public method

This commit is contained in:
Olle Jonsson 2016-03-19 15:13:12 +01:00
parent 15d92cea45
commit 2e8e2a62e1

View File

@ -6,8 +6,6 @@ module GitHubChangelogGenerator
class ParserFile
FILENAME = ".github_changelog_generator"
attr_reader :file
# @param options [Hash]
# @param file [nil,IO]
def initialize(options, file = read_default_file)
@ -22,9 +20,9 @@ module GitHubChangelogGenerator
# Set @options using configuration file lines.
def parse!
return unless file
file.each_line { |line| parse_line!(line) }
file.close
return unless @file
@file.each_line { |line| parse_line!(line) }
@file.close
end
private
@ -33,7 +31,7 @@ module GitHubChangelogGenerator
option_name, value = extract_pair(line)
@options[option_key_for(option_name)] = convert_value(value, option_name)
rescue
raise ParserError, "Config file #{file} is incorrect in line \"#{line.gsub(/[\n\r]+/, '')}\""
raise ParserError, "Config file problem on line \"#{line.gsub(/[\n\r]+/, '')}\""
end
# Returns a the option name as a symbol and its string value sans newlines.