From 010cf0268bb8c9b5a051b5a370e0d6f23d6796b7 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 18 Aug 2010 17:52:52 +0200 Subject: obsolete rakefiles removed --- Rakefile | 10 ---------- application.rb | 7 +------ 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 Rakefile diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 21e8bdf..0000000 --- a/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rubygems' -require 'rake' -require 'tasks/opentox' - -@gems = "sinatra emk-sinatra-url-for opentox-ruby-api-wrapper" - -desc "Run local tests" -task :test do - load 'test/test.rb' -end diff --git a/application.rb b/application.rb index 7494748..f75ad73 100755 --- a/application.rb +++ b/application.rb @@ -6,7 +6,6 @@ class Dataset include DataMapper::Resource property :id, Serial property :uri, String, :length => 255 - #property :file, String, :length => 255 property :yaml, Text, :length => 2**32-1 property :owl, Text, :length => 2**32-1 property :created_at, DateTime @@ -58,7 +57,7 @@ get '/:id' do raise e.message + e.backtrace halt 404, "Dataset #{params[:id]} not found." end - halt 404, "Dataset #{params[:id]} not found." if dataset.nil? # not sure how an empty cataset can be returned, but if this happens stale processes keep runing at 100% cpo + halt 404, "Dataset #{params[:id]} not found." if dataset.nil? # not sure how an empty cataset can be returned, but if this happens stale processes keep runing at 100% cpu case accept when /rdf/ # redland sends text/rdf instead of application/rdf+xml response['Content-Type'] = 'application/rdf+xml' @@ -126,16 +125,12 @@ post '/?' do case request.content_type when /yaml/ dataset.yaml = request.env["rack.input"].read -# when /csv/ -# dataset.yaml = csv2yaml request.env["rack.input"].read when "application/rdf+xml" dataset.yaml = OpenTox::Dataset.owl_to_yaml(request.env["rack.input"].read,dataset.uri) else halt 404, "MIME type \"#{request.content_type}\" not supported." end begin - #dataset.owl = d.rdf - #dataset.uri = uri raise "saving failed: "+dataset.errors.inspect unless dataset.save rescue => e LOGGER.error e.message -- cgit v1.2.3