Skip to content

Commit

Permalink
Merge pull request sunspot#79 from jmileham/java_dep_in_sunspot_solr
Browse files Browse the repository at this point in the history
Java dependency belongs in sunspot_solr
  • Loading branch information
nz committed Sep 9, 2011
2 parents f4e2110 + afb5203 commit 260ed06
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
8 changes: 0 additions & 8 deletions sunspot/lib/sunspot/java.rb

This file was deleted.

10 changes: 10 additions & 0 deletions sunspot_solr/lib/sunspot/solr/java.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Sunspot
module Solr
module Java
def self.installed?
`java -version &> /dev/null`
$?.success?
end
end
end
end
4 changes: 2 additions & 2 deletions sunspot_solr/lib/sunspot/solr/server.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'escape'
require 'set'
require 'tempfile'
require 'sunspot/java'
require 'sunspot/solr/java'

module Sunspot
module Solr
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sunspot_solr/spec/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 260ed06

Please sign in to comment.