diff --git a/lib/github_changelog_generator/parser_file.rb b/lib/github_changelog_generator/parser_file.rb index 0fc58e9..da50af1 100644 --- a/lib/github_changelog_generator/parser_file.rb +++ b/lib/github_changelog_generator/parser_file.rb @@ -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.