Sha256: e1498ebbc94107e7bcd46cf07c06f95f3f2b968f2bdc0603a27bdf2d05f1c741

Contents?: true

Size: 736 Bytes

Versions: 6

Compression:

Stored size: 736 Bytes

Contents

require 'benchmark'

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
  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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
qa-3.1.0 lib/tasks/mesh.rake
qa-2.3.0 lib/tasks/mesh.rake
qa-3.0.0 lib/tasks/mesh.rake
qa-2.2.0 lib/tasks/mesh.rake
qa-2.1.2 lib/tasks/mesh.rake
qa-2.1.1 lib/tasks/mesh.rake