
1 Mar
2021
1 Mar
'21
11:45 a.m.
+++ b/lib/parse_mail_list.rb @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: MulanPSL-2.0+ +# frozen_string_literal: true + +require 'yaml' + +def parse_mail_list(type) + content = {} + mail_list_yaml = './mail_list.yaml'
no need add './' if in the same dir
+ content = YAML.safe_load(File.open(mail_list_yaml)) if FileTest.exists?(mail_list_yaml) + return {} unless content[type] + + return content[type] +end
def parse_mail_list(type) content = YAML.load_file('mail_list.yaml') || {} return content[type] || {} end
-- 2.23.0