module Guard

def locate_guard(name)

Returns:
  • (String) - the full path to the Guard gem

Parameters:
  • name (String) -- the name of the Guard without the prefix `guard-`
def locate_guard(name)
  if Gem::Version.create(Gem::VERSION) >= Gem::Version.create('1.8.0')
    Gem::Specification.find_by_name("guard-#{ name }").full_gem_path
  else
    Gem.source_index.find_name("guard-#{ name }").last.full_gem_path
  end
rescue
  UI.error "Could not find 'guard-#{ name }' gem path."
end