2 SafeYAML::OPTIONS[:default_mode] = :safe
4 SUBSCRIPTIONS_ROOT = 'Membres'
6 def is_valid_subscription?(content)
7 return false if content.length == 0
8 return false unless content.start_with?("---\n")
10 data = YAML.load(content)
15 ['name', 'email'].each do |key|
16 return false unless data.include?(key)
21 def is_valid_subscription_file?(ref, file)
22 IO.popen(['git', 'show', "#{ref}:#{file}"]) do |f|
23 is_valid_subscription?(f.read)