forked from outoftime/sunspot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sunspot#102 from sunspot/nz-move-rake-solr-tasks-t…
…o-sunspot-solr Move the sunspot:solr rake tasks to the sunspot_solr gem.
- Loading branch information
Showing
4 changed files
with
78 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Sunspot | ||
module Solr | ||
class Railtie < ::Rails::Railtie | ||
|
||
rake_tasks do | ||
load 'sunspot/solr/tasks.rb' | ||
end | ||
|
||
# generators do | ||
# load "generators/sunspot_rails.rb" | ||
# end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace :sunspot do | ||
namespace :solr do | ||
|
||
desc 'Start the Solr instance' | ||
task :start => :environment do | ||
case RUBY_PLATFORM | ||
when /w(in)?32$/, /java$/ | ||
abort("This command is not supported on #{RUBY_PLATFORM}. " + | ||
"Use rake sunspot:solr:run to run Solr in the foreground.") | ||
end | ||
Sunspot::Rails::Server.new.start | ||
end | ||
|
||
desc 'Run the Solr instance in the foreground' | ||
task :run => :environment do | ||
Sunspot::Rails::Server.new.run | ||
end | ||
|
||
desc 'Stop the Solr instance' | ||
task :stop => :environment do | ||
case RUBY_PLATFORM | ||
when /w(in)?32$/, /java$/ | ||
abort("This command is not supported on #{RUBY_PLATFORM}. " + | ||
"Use rake sunspot:solr:run to run Solr in the foreground.") | ||
end | ||
Sunspot::Rails::Server.new.stop | ||
end | ||
|
||
# for backwards compatibility | ||
task :reindex => :"sunspot:reindex" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
require 'sunspot/solr/server' | ||
require 'sunspot/solr/server' | ||
|
||
if defined?(Rails) && Rails::VERSION::MAJOR == 3 | ||
require 'sunspot/solr/railtie' | ||
end |