Sha256: 855f63da7d1de157f49d2f081762ff850f85db5e75f2b86a5d7c88efd83ede29
Contents?: true
Size: 619 Bytes
Versions: 11
Compression:
Stored size: 619 Bytes
Contents
module PrePush class Validator def self.validate runner if !Dir.exists?('.git') puts "Couldn't find a git repository" return false end if !Dir.exists?('.git/hooks') puts "Couldn't find the git hooks dir" return false end bin = File.dirname(__FILE__) runners_dir = "#{bin}/../lib/runners" found = Dir.entries(runners_dir).any?{|file| file == "#{runner}"} unless found all = Dir.entries(runners_dir).select{|f| !File.directory? f}.join(', ') puts "Couldn't find test runner #{runner} in #{all}" return false end return true end end end
Version data entries
11 entries across 11 versions & 1 rubygems