summaryrefslogtreecommitdiff
path: root/application.rb
blob: 09b90f60611618807eddfafd70e340319090d32f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# application.rb
# Loads sub-repositories, library code, and webapps.
# Author: Andreas Maunz

require 'sinatra/url_for'

# Require sub-Repositories
require File.join(File.expand_path(File.dirname(__FILE__)), 'libfminer/libbbrc/bbrc') # include before openbabel
require File.join(File.expand_path(File.dirname(__FILE__)), 'libfminer/liblast/last') # 
require File.join(File.expand_path(File.dirname(__FILE__)), 'last-utils/lu.rb')

# Library Code
$logger.debug "Algorithm booting: #{$algorithm.collect{ |k,v| "#{k}: '#{v}'"} }"
Dir['./lib/algorithm/*.rb'].each { |f| require f } # Libs
Dir['./lib/*.rb'].each { |f| require f } # Libs
Dir['./webapp/*.rb'].each { |f| require f } # Webapps

# Entry point
module OpenTox
  class Application < Service
    get '/?' do
      list = [ url_for('/lazar', :full), 
               url_for('/fminer/bbrc', :full), 
               url_for('/fminer/bbrc/sample', :full), 
               url_for('/fminer/last', :full), 
               url_for('/fminer/bbrc/match', :full), 
               url_for('/fminer/last/match', :full), 
               url_for('/fs/rfe', :full), 
               url_for('/pc', :full) ].join("\n") + "\n"
      format_output (list)
    end
  end
end