From 22b50aa52fc3167415af08d0e6ee0cbbeb35e833 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 19 Mar 2012 19:51:44 +0000 Subject: split pre_commit and post_commit in separate file, and simplify the layout, by renaming commit_hook to hook directly --- modules/subversion/manifests/hook.pp | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'modules/subversion/manifests/hook.pp') diff --git a/modules/subversion/manifests/hook.pp b/modules/subversion/manifests/hook.pp index 5a347573..08b626ad 100644 --- a/modules/subversion/manifests/hook.pp +++ b/modules/subversion/manifests/hook.pp @@ -1,26 +1,9 @@ -class subversion { - class hook { - define post_commit($content) { - commit_hook { $name: - content => $content, - type => "post-commit", - } - } - define pre_commit($content) { - commit_hook { $name: - content => $content, - type => "pre-commit", - } - } - - define commit_hook($content, $type) { - $array = split($name,'\|') - $repo = $array[0] - $script = $array[1] - file { "$repo/hooks/$type.d/$script": - content => $content, - mode => 755, - } - } +define subversion::hook($content, $type) { + $array = split($name,'\|') + $repo = $array[0] + $script = $array[1] + file { "$repo/hooks/$type.d/$script": + content => $content, + mode => '0755', } } -- cgit v1.2.1