Sha256: 5e3c91b2aaf5d3c00bb30f7922de004c0ae01d3c6fd437cccaa3c557d01af636
Contents?: true
Size: 581 Bytes
Versions: 11
Compression:
Stored size: 581 Bytes
Contents
module Retest class Setup def type @type ||= begin return :ruby unless has_lock_file? if rspec? then :rspec elsif rails? then :rails elsif rake? then :rake else :ruby end end end private def has_lock_file? File.exist? 'Gemfile.lock' end def rspec? has_gem? 'rspec' end def rails? has_gem? 'rails' end def rake? has_gem? 'rake' end def has_gem?(gem_name) !`cat Gemfile.lock | grep #{gem_name}`.empty? end end end
Version data entries
11 entries across 11 versions & 1 rubygems