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 class ParserFile
FILENAME = ".github_changelog_generator" FILENAME = ".github_changelog_generator"
attr_reader :file
# @param options [Hash] # @param options [Hash]
# @param file [nil,IO] # @param file [nil,IO]
def initialize(options, file = read_default_file) def initialize(options, file = read_default_file)
@ -22,9 +20,9 @@ module GitHubChangelogGenerator
# Set @options using configuration file lines. # Set @options using configuration file lines.
def parse! def parse!
return unless file return unless @file
file.each_line { |line| parse_line!(line) } @file.each_line { |line| parse_line!(line) }
file.close @file.close
end end
private private
@ -33,7 +31,7 @@ module GitHubChangelogGenerator
option_name, value = extract_pair(line) option_name, value = extract_pair(line)
@options[option_key_for(option_name)] = convert_value(value, option_name) @options[option_key_for(option_name)] = convert_value(value, option_name)
rescue 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 end
# Returns a the option name as a symbol and its string value sans newlines. # Returns a the option name as a symbol and its string value sans newlines.