projects
/
gestion-adh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Next step in pre-commit hook implementation
[gestion-adh.git]
/
bin
/
pre-commit-hook
diff --git
a/bin/pre-commit-hook
b/bin/pre-commit-hook
index 7d3d0e8f4c8fdbf30c3090afb9944b3191c190fd..fcfb3e91a8fd981c7e970027b5b9507244bd093f 100755
(executable)
--- a/
bin/pre-commit-hook
+++ b/
bin/pre-commit-hook
@@
-19,12
+19,15
@@
def is_valid_subscription?(content)
return false if content.length == 0
return false unless content.start_with?("---\n")
begin
return false if content.length == 0
return false unless content.start_with?("---\n")
begin
- YAML.load(content)
- true
+ data = YAML.load(content)
rescue ArgumentError
# Parse error
rescue ArgumentError
# Parse error
- false
+
return
false
end
end
+ ['name', 'email'].each do |key|
+ return false unless data.include?(key)
+ end
+ true
end
def is_valid_subscription_file?(file)
end
def is_valid_subscription_file?(file)