]> nos-oignons.net Git - gestion-adh.git/blobdiff - lib/nos_oignons/member.rb
Correction du fichier sudoer
[gestion-adh.git] / lib / nos_oignons / member.rb
index 46fc41b3f7f89066de16b824f5d593064e1130ca..a67581c114ea6d06588e5442d8c8ffe53f676bf8 100644 (file)
@@ -21,7 +21,7 @@ module NosOignons
           if File.exists?(File.join(git_path, MEMBERS_DB_DIR))
             @db_path = File.join(git_path, MEMBERS_DB_DIR)
           else
-            @db_path = File.join(File.expand_path('../wiki-ca', path), MEMBERS_DB_DIR)
+            @db_path = File.join(File.expand_path('../wiki-ca', git_path), MEMBERS_DB_DIR)
           end
         end
         @db_path
@@ -59,7 +59,8 @@ module NosOignons
       unless page_content.start_with?("---\n")
         raise ArgumentError.new('content is not a proper YAML document')
       end
-      data = YAML.load(page_content)
+      yaml_content = /\A---\n(.*)\n---\n/m.match(page_content)[1]
+      data = YAML.load(yaml_content)
       MEMBER_FIELDS.each do |field|
         self[field] = data[field.to_s]
       end