diff options
author | martin <martin@virtual-machine.(none)> | 2012-12-06 17:22:06 +0100 |
---|---|---|
committer | martin <martin@virtual-machine.(none)> | 2012-12-06 17:22:06 +0100 |
commit | 46761d137dc470c6a4ab6b573bd99713a95103d2 (patch) | |
tree | e50e09daa2b9dd3b12d63b98c32426d6ffb471ed /application.rb | |
parent | e4f366398bfbeb8c961183412a15f92923a4e0ae (diff) |
first step towards new architecture (4store)
Diffstat (limited to 'application.rb')
-rwxr-xr-x | application.rb | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/application.rb b/application.rb index 10c8fe6..67771f9 100755 --- a/application.rb +++ b/application.rb @@ -1,53 +1,22 @@ require 'rubygems' -gem "opentox-ruby" -[ 'sinatra', 'sinatra/url_for', 'opentox-ruby', 'benchmark' ].each do |lib| +#gem "opentox-ruby" +[ 'sinatra', 'sinatra/url_for', 'ohm', 'benchmark' ].each do |lib| require lib end +class Sinatra::Base + helpers Sinatra::UrlForHelper +end + #unless(defined? LOGGER) #LOGGER = Logger.new(STDOUT) #LOGGER.datetime_format = "%Y-%m-%d %H:%M:%S " #end -#require "error_application.rb" - -require "example.rb" - - -get '/examples/?' do - LOGGER.info "list examples" - - if request.env['HTTP_ACCEPT'] =~ /text\/html/ - content_type "text/html" - OpenTox.text_to_html Example.transform_example,@subjectid - else - content_type "text/plain" - Example.transform_example - end -end - -get '/prepare_examples/?' do - LOGGER.info "prepare examples" - content_type "text/plain" - return_task(Example.prepare_example_resources) -end - -post '/test_examples/?' do - examples = params[:examples] - LOGGER.info "test examples "+examples.to_s - content_type "text/plain" - Example.test_examples(examples) -end - -require "test/test_application.rb" -require "nightly/nightly_application.rb" - -# order is important, first add example methods and reports, than validation -# (otherwise sinatra will try to locate a validation with name examples or report) - -require "report/report_application.rb" -require "reach_reports/reach_application.rb" -require "validation/validation_application.rb" +require "./test/test_application.rb" +require "./report/report_application.rb" +#require "./reach_reports/reach_application.rb" +require "./validation/validation_application.rb" |