diff --git a/lib/youplot/parser.rb b/lib/youplot/parser.rb index 2e8eb04..128c982 100644 --- a/lib/youplot/parser.rb +++ b/lib/youplot/parser.rb @@ -50,11 +50,11 @@ module YouPlot def find_config_file config_file_candidate_paths.each do |file| path = File.expand_path(file) - if File.exist?(path) - @config_file = path - ENV['MYYOUPLOTRC'] = path - return @config_file - end + next unless File.exist?(path) + + @config_file = path + ENV['MYYOUPLOTRC'] = path + return @config_file end nil end