From d87c4b9c0d3aed4a23d74f340ece2c4bff83101b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 16 Nov 2016 02:08:50 +0200 Subject: use String.end_with? instead of regexp --- lib/gitlab_custom_hook.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gitlab_custom_hook.rb') diff --git a/lib/gitlab_custom_hook.rb b/lib/gitlab_custom_hook.rb index 451d5b4..6265ec1 100644 --- a/lib/gitlab_custom_hook.rb +++ b/lib/gitlab_custom_hook.rb @@ -92,7 +92,7 @@ class GitlabCustomHook # the resulting list is sorted def match_hook_files(path) Dir["#{path}/*"].select do |f| - !f[/~$/] && File.executable?(f) + !f.end_with?('~') && File.executable?(f) end.sort end end -- cgit v1.2.1