Permalink
Browse files

Added in a rake task for refreshing/populating the OLS cache

  • Loading branch information...
1 parent 3a04991 commit a1864db25aaa787e18fef6b5e6e74c1550a9f115 @dazoakley dazoakley committed Nov 9, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 tasks/ols.task
View
20 tasks/ols.task
@@ -0,0 +1,20 @@
+# encoding: utf-8
+
+begin
+ require 'martsearch'
+
+ @ms = MartSearch::Controller.instance()
+
+ namespace :ols do
+ desc 'Rebuilds the OLS gems on-disk cache'
+ task :rebuild_cache do
+ ['GO','EMAP','MP','MA','MPATH'].each do |ontology|
+ puts "Refreshing OLS data for the '#{ontology}' ontology..."
+ OLS.refresh_ontology_in_cache(ontology)
+ end
+ end
+ end
+
+rescue LoadError
+ puts "[ERROR] Unable to load 'ols' tasks - please run 'bundle install'"
+end

0 comments on commit a1864db

Please sign in to comment.