summaryrefslogtreecommitdiff
path: root/application.rb
blob: 9f1f12f619953caeb6534336ce5cf4f9fc00e75b (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
34
35
36
37
38
39
40
41
42
43
# application.rb
# Loads sub-repositories, library code, and webapps.
# Author: Andreas Maunz
require 'statsample'

# Require sub-Repositories
require_relative 'libfminer/libbbrc/bbrc' # include before openbabel
require_relative 'libfminer/liblast/last' # 
require_relative 'last-utils/lu.rb'

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

[
"descriptor.rb",
"feature-selection.rb",
"fminer.rb",
"lazar.rb",
"test.rb"
].each do |f|
    require_relative f
    also_reload f  # Webapps
end

# Entry point
module OpenTox
  class Application < Service
  
    # for service check
    head '/?' do
      #$logger.debug "Algorithm service is running."
    end
    
    get '/?' do
      render [ to('/lazar', :full), 
               to('/fminer/bbrc', :full), 
               to('/fminer/last', :full), 
               #to('/feature-selection/recursive-feature-elimination', :full), 
               to('/descriptor') ].join("\n") + "\n"
    end
  end
end