Sha256: ecc1073bbc1b19604e691ca684db836db2723523d5fc4c2cbd3a8673bd7a80bd

Contents?: true

Size: 1.43 KB

Versions: 4

Compression:

Stored size: 1.43 KB

Contents

namespace :fcrepo_admin do
    desc "CI Build"
    task :ci do
		ENV['environment'] = "test"
		Rake::Task["jetty:clean"].invoke
  		jetty_params = Jettywrapper.load_config
  		jetty_params[:startup_wait] = 60
		jetty_params[:jetty_home] = File.expand_path(File.dirname(__FILE__) + '/../jetty')
  		Jettywrapper.wrap(jetty_params) do
    	    Rake::Task['spec'].invoke
  		end
	end
    namespace :solr do
        desc "Deletes everything from the Solr index"
        task :clean => :environment do
          Blacklight.solr.delete_by_query("*:*")
          Blacklight.solr.commit
        end
        desc "Index a single object in solr specified by PID="
        task :index => :environment do
          raise "Must specify a pid. Ex: PID=changeme:12" unless ENV['PID']
          ActiveFedora::Base.connection_for_pid('foo:1') # Loads Rubydora connection with fake object
          ActiveFedora::Base.find(ENV['PID'], cast: true).update_index
        end
        desc 'Index all objects in the repository (except fedora-system: objects).'
        task :index_all => :environment do
          ActiveFedora::Base.connection_for_pid('foo:1') # Loads Rubydora connection with fake object
          ActiveFedora::Base.fedora_connection[0].connection.search(nil) do |object|
            if !object.pid.starts_with?('fedora-system:')
                ActiveFedora::Base.find(object.pid, cast: true).update_index
            end
          end
        end        
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fcrepo_admin-0.6.1 tasks/fcrepo_admin.rake
fcrepo_admin-0.6.0 tasks/fcrepo_admin.rake
fcrepo_admin-0.5.5 tasks/fcrepo_admin.rake
fcrepo_admin-0.5.5.pre tasks/fcrepo_admin.rake