Sha256: 4c0ae1e86f0455cbc9a454602e10baa05c61534a98ac17d0acdfee5daa1bc969

Contents?: true

Size: 976 Bytes

Versions: 7

Compression:

Stored size: 976 Bytes

Contents

require 'rails/generators'
require 'generators/geoblacklight/install_generator'

namespace :geoblacklight do
  namespace :solr do
    desc "Put sample data into solr"
    task :seed => :environment do
      docs = Dir['spec/fixtures/solr_documents/*.json'].map { |f| JSON.parse File.read(f) }.flatten
      Blacklight.solr.add docs
      Blacklight.solr.commit
    end

    desc "Ingests a GeoHydra transformed.json"
    task :ingest_all => :environment do
      docs = JSON::parse(File.read("#{Rails.root}/tmp/transformed.json"))
      docs.each do |doc|
        Blacklight.solr.add doc
        Blacklight.solr.commit
      end
    end
  end
  namespace :downloads do
    desc 'Delete all cached downloads'
    task delete: :environment do
      FileUtils.rm_rf Dir.glob("#{Rails.root}/tmp/cache/downloads/*")
    end
    desc 'Create download directory'
    task mkdir: :environment do
      FileUtils.mkdir_p Dir.glob("#{Rails.root}/tmp/cache/downloads")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
geoblacklight-0.8.0 lib/tasks/geoblacklight.rake
geoblacklight-0.7.1 lib/tasks/geoblacklight.rake
geoblacklight-0.5.1 lib/tasks/geoblacklight.rake
geoblacklight-0.5.0 lib/tasks/geoblacklight.rake
geoblacklight-0.4.2 lib/tasks/geoblacklight.rake
geoblacklight-0.4.1 lib/tasks/geoblacklight.rake
geoblacklight-0.4.0 lib/tasks/geoblacklight.rake