Sha256: 698468b5f25a257f10d90e1a9d3a684f19861d85e3d62deadf7bc65cfcbbf3dc

Contents?: true

Size: 1.28 KB

Versions: 26

Compression:

Stored size: 1.28 KB

Contents

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

      if defined?(Sunspot::Rails::Server)
        Sunspot::Rails::Server.new.start
      else
        Sunspot::Solr::Server.new.start
      end

      puts "Successfully started Solr ..."
    end

    desc 'Run the Solr instance in the foreground'
    task :run => :environment do
      if defined?(Sunspot::Rails::Server)
        Sunspot::Rails::Server.new.run
      else
        Sunspot::Solr::Server.new.run
      end
    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

      if defined?(Sunspot::Rails::Server)
        Sunspot::Rails::Server.new.stop
      else
        Sunspot::Solr::Server.new.stop
      end

      puts "Successfully stopped Solr ..."
    end

    # for backwards compatibility
    task :reindex => :"sunspot:reindex"
  end
end

Version data entries

26 entries across 26 versions & 9 rubygems

Version Path
qiny_sunspot_solr-2.1.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.1.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.0.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.0.0.pre.130115 lib/sunspot/solr/tasks.rb
gojee-sunspot-solr-2.0.5 lib/sunspot/solr/tasks.rb
sunspot_solr-2.0.0.pre.120925 lib/sunspot/solr/tasks.rb
sunspot_solr-2.0.0.pre.120924 sunspot_solr/lib/sunspot/solr/tasks.rb
sunspot_rails-2.0.0.pre.120924 sunspot_solr/lib/sunspot/solr/tasks.rb
sunspot-2.0.0.pre.120924 sunspot_solr/lib/sunspot/solr/tasks.rb
gojee-sunspot-solr-2.0.4 lib/sunspot/solr/tasks.rb
gojee-sunspot-solr-2.0.2 lib/sunspot/solr/tasks.rb
sunspot_solr-2.0.0.pre.120720 lib/sunspot/solr/tasks.rb
culturecode-sunspot_solr-2.0.0.pre lib/sunspot/solr/tasks.rb
sunspot_solr-1.3.3 lib/sunspot/solr/tasks.rb
sunspot_solr-1.3.2 lib/sunspot/solr/tasks.rb
sunspot_solr-2.0.0.pre.120417 lib/sunspot/solr/tasks.rb
sunspot_solr-2.0.0.pre.120415 lib/sunspot/solr/tasks.rb
erichummel-sunspot_solr-2.0.0.pre.111215d lib/sunspot/solr/tasks.rb
sunspot_solr-1.3.1 lib/sunspot/solr/tasks.rb
erichummel-sunspot_solr-2.0.0.pre.111215 lib/sunspot/solr/tasks.rb