diff --git a/sunspot/lib/sunspot/java.rb b/sunspot/lib/sunspot/java.rb deleted file mode 100644 index b3db31c8a..000000000 --- a/sunspot/lib/sunspot/java.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Sunspot - module Java - def self.installed? - `java -version &> /dev/null` - $?.success? - end - end -end diff --git a/sunspot_solr/lib/sunspot/solr/java.rb b/sunspot_solr/lib/sunspot/solr/java.rb new file mode 100644 index 000000000..5eaf82fda --- /dev/null +++ b/sunspot_solr/lib/sunspot/solr/java.rb @@ -0,0 +1,10 @@ +module Sunspot + module Solr + module Java + def self.installed? + `java -version &> /dev/null` + $?.success? + end + end + end +end diff --git a/sunspot_solr/lib/sunspot/solr/server.rb b/sunspot_solr/lib/sunspot/solr/server.rb index cc807b3b7..92b0a7bd8 100644 --- a/sunspot_solr/lib/sunspot/solr/server.rb +++ b/sunspot_solr/lib/sunspot/solr/server.rb @@ -1,7 +1,7 @@ require 'escape' require 'set' require 'tempfile' -require 'sunspot/java' +require 'sunspot/solr/java' module Sunspot module Solr @@ -144,7 +144,7 @@ def solr_jar def ensure_java_installed unless defined?(@java_installed) - @java_installed = Sunspot::Java.installed? + @java_installed = Sunspot::Solr::Java.installed? unless @java_installed raise JavaMissing.new("You need a Java Runtime Environment to run the Solr server") end diff --git a/sunspot_solr/spec/server_spec.rb b/sunspot_solr/spec/server_spec.rb index 058ea1442..1c0056860 100644 --- a/sunspot_solr/spec/server_spec.rb +++ b/sunspot_solr/spec/server_spec.rb @@ -53,7 +53,7 @@ end it 'raises an error if java is missing' do - Sunspot::Java.stub(:installed? => false) + Sunspot::Solr::Java.stub(:installed? => false) expect { Sunspot::Solr::Server.new }.to raise_error(Sunspot::Solr::Server::JavaMissing)