Sha256: 11a022d18c4a42b763440a417cce1b16b98607d0d42dfcf8b5754d5af7abc7cc
Contents?: true
Size: 584 Bytes
Versions: 9
Compression:
Stored size: 584 Bytes
Contents
require "rbconfig" module Sunspot module Solr module Java class << self def ensure_install! if installed? true else raise Sunspot::Solr::Server::JavaMissing, "You need a Java Runtime Environment to run the Solr server" end end def installed? system("java", "-version", [:out, :err] => null_device) $?.exitstatus.zero? end def null_device RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ ? "NUL" : "/dev/null" end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems