Sha256: 46129fdd57693f63ad8808d9ebadc359031a604a9bf69952d6aca437dbffff37

Contents?: true

Size: 765 Bytes

Versions: 31

Compression:

Stored size: 765 Bytes

Contents

require 'benchmark'

namespace :qa do
  namespace :mesh do
    desc "Import MeSH terms from the file $MESH_FILE, it will update any terms which are already in the database"
    task import: :environment do
      fname = ENV['MESH_FILE']
      if fname.nil?
        puts "Need to set $MESH_FILE with path to file to ingest"
        next # transfers control out of this block
      end
      Benchmark.bm(30) do |bm|
        bm.report("Importing #{fname}") do
          m = Qa::Authorities::MeshTools::MeshImporter.new
          File.open(fname) do |f|
            m.import_from_file(f)
          end
        end
      end
    end

    desc "Delete all mesh terms from the database---not implemented"
    task :clear do
      puts "Not implemented"
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
qa-5.14.0 lib/tasks/mesh.rake
qa-5.13.0 lib/tasks/mesh.rake
qa-5.12.0 lib/tasks/mesh.rake
qa-5.11.0 lib/tasks/mesh.rake
qa-5.10.0 lib/tasks/mesh.rake
qa-5.9.0 lib/tasks/mesh.rake
qa-5.8.1 lib/tasks/mesh.rake
qa-5.8.0 lib/tasks/mesh.rake
qa-5.7.0 lib/tasks/mesh.rake
qa-5.6.0 lib/tasks/mesh.rake
qa-5.5.2 lib/tasks/mesh.rake
qa-4.3.0 lib/tasks/mesh.rake
qa-5.5.1 lib/tasks/mesh.rake
qa-5.5.0 lib/tasks/mesh.rake
qa-5.4.0 lib/tasks/mesh.rake
qa-5.3.1 lib/tasks/mesh.rake
qa-5.3.0 lib/tasks/mesh.rake
qa-5.2.0 lib/tasks/mesh.rake
qa-5.1.0 lib/tasks/mesh.rake
qa-5.0.0 lib/tasks/mesh.rake