lib/githook/tasks.rb in git-hook-0.1.8 vs lib/githook/tasks.rb in git-hook-0.1.9
- old
+ new
@@ -2,21 +2,21 @@
# enable get task description
# you aslo can see it in Rake source code: lib/rake/application.rb#select_tasks_to_show
Rake::TaskManager.record_task_metadata = true
# load rake files from lib
-rake_files_pattern = File.dirname(__FILE__) + "/tasks/*.rake"
+rake_files_pattern = File.dirname(__FILE__) + '/tasks/*.rake'
# => gems/git-hook-0.1.1/lib/githook/tasks/*.rake
Dir.glob(rake_files_pattern).each { |r| load r }
# we must be very careful to load outside ruby code
# because they are out of our control
# only load outside "*.rake" when there are ".git" and ".githook" folder, and target task isn't "install"
-if Dir.exist?(".git") && Dir.exist?(".githook") && ARGV[0] != "install"
- Dir.glob(".githook/tasks/**/*.rake").each do |rake|
+if Dir.exist?('.git') && Dir.exist?('.githook') && ARGV[0] != 'install'
+ Dir.glob('.githook/tasks/**/*.rake').each do |rake|
begin
load rake
- rescue => e
+ rescue StandardError => e
puts "Error: #{e.message} in #{rake}"
exit 1
end
end
end