From 2e8e2a62e18317b37a99c469c9322c8fabf9a885 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Sat, 19 Mar 2016 15:13:12 +0100 Subject: [PATCH] ParserFile: removed public method --- lib/github_changelog_generator/parser_file.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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.