diff options
author | Christoph Helma <helma@in-silico.de> | 2010-01-22 13:14:44 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2010-01-22 13:14:44 +0100 |
commit | 1e9ad58f920ac9c8a07e59d76cfce057e6bbb5e0 (patch) | |
tree | 6ef965bc5741a2cf6506654f4d020dab87440343 | |
parent | 861d7140fb4c19a0c77f91fb760361e85f33e3fc (diff) |
central config.ru, logger instead of puts
-rw-r--r-- | application.rb | 5 | ||||
-rw-r--r-- | config.ru | 25 |
2 files changed, 5 insertions, 25 deletions
diff --git a/application.rb b/application.rb index 5fa96d2..3ae8699 100644 --- a/application.rb +++ b/application.rb @@ -1,6 +1,7 @@ require 'rubygems' gem 'opentox-ruby-api-wrapper', '~>1.2' require 'opentox-ruby-api-wrapper' +require 'do_sqlite3' require 'dm-core' require 'dm-serializer' require 'dm-timestamps' @@ -12,7 +13,8 @@ class Dataset include DataMapper::Resource property :id, Serial property :uri, String, :length => 100 - property :owl, Text + property :file, String + property :owl, Text, :length => 1000000 property :created_at, DateTime end @@ -66,7 +68,6 @@ post '/?' do dataset.uri = uri dataset.save print dataset.uri - puts "saved" uri end @@ -1,25 +1,4 @@ require 'rubygems' -require 'sinatra' -require 'application.rb' -require 'rack' -require 'rack/contrib' - -FileUtils.mkdir_p 'log' unless File.exists?('log') -FileUtils.mkdir_p 'datasets' unless File.exists?('datasets') -log = File.new("log/#{ENV["RACK_ENV"]}.log", "a") -$stdout.reopen(log) -$stderr.reopen(log) - -if ENV['RACK_ENV'] == 'production' - use Rack::MailExceptions do |mail| - mail.to 'helma@in-silico.ch' - mail.subject '[ERROR] %s' - end - -elsif ENV['RACK_ENV'] == 'development' - use Rack::Reloader - use Rack::ShowExceptions -end - +require 'opentox-ruby-api-wrapper' +require 'tasks/config' run Sinatra::Application - |