Rakefile in tika-client-0.1.1 vs Rakefile in tika-client-0.2.0
- old
+ new
@@ -1,6 +1,7 @@
require "bundler/gem_tasks"
+require "rspec/core/rake_task"
require "openssl"
require "net/http"
TEMP_DIR = File.absolute_path("tmp")
DOWNLOAD_DIR = TEMP_DIR
@@ -34,11 +35,14 @@
end
end
desc "Start Tika server"
task :start do
- if File.exists?(tika_path)
+ if File.exists?(PID_FILE)
+ pid = File.read(PID_FILE).strip
+ puts "Tika server is already running (PID #{pid})"
+ elsif File.exists?(tika_path)
puts "Starting Tika server ..."
File.open(PID_FILE, "w") do |pid_file|
pid = fork { exec "java -jar #{tika_path}" }
Process.detach(pid)
pid_file.write(pid)
@@ -72,5 +76,10 @@
end
task :download_dir do
FileUtils.mkdir(DOWNLOAD_DIR) unless Dir.exists?(DOWNLOAD_DIR)
end
+
+desc "Run all specs in spec directory"
+RSpec::Core::RakeTask.new(:spec)
+
+task default: :spec