summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-03-09 21:45:12 +0000
committerChristoph Helma <helma@in-silico.ch>2012-03-09 21:45:12 +0000
commit0430ae07ffb1e94b7e38c3f69136a26229a680e0 (patch)
tree264e26aae1e6d5cf49e19b924965faaa51df36d8
parent99691a04485b409ede5b4a1c6657ba6e59abc7de (diff)
READE updated, Sinatra::Reloader added
-rw-r--r--README34
-rw-r--r--lib/environment.rb4
-rw-r--r--lib/opentox.rb5
-rw-r--r--opentox-server.gemspec3
4 files changed, 42 insertions, 4 deletions
diff --git a/README b/README
index 11d3b61..4b5783b 100644
--- a/README
+++ b/README
@@ -1,4 +1,32 @@
-opentox-server
-=============
+opentox-server: Common part for OpenTox webservices
-Common part for Opentox webservices
+Installation:
+
+ gem install opentox-service
+
+Development:
+
+ git clone git@github.com:<my-opentox-service>.git
+ cd <my-opentox-service>
+ bundle install
+ ./bin/toxbank-investigation-install # if not already installed, do not start webserver
+ export RACK_ENV=development
+ # if you are working on opentox-server|client gems as well edit Gemfile e.g.
+ # gem 'opentox-server', :path => "~/opentox-server"
+ # gem "opentox-client", :path => "~/opentox-client"
+ # start webserver in development mode (runs at port 8080, should reload changes from source files)
+ unicorn
+ # open new terminal
+ git flow init
+ git flow feature start <your feature>
+ # code, test, code, ...
+ git flow feature finish <your feature>
+ # test
+ # create release branch
+ # increase version (in toxbank-investigation.gemspec)
+ # install into system gems
+ rake install
+ # test
+ # create master
+ # release
+ rake release
diff --git a/lib/environment.rb b/lib/environment.rb
index 1af76f8..3889dfb 100644
--- a/lib/environment.rb
+++ b/lib/environment.rb
@@ -9,6 +9,7 @@ config_file = File.join(config_dir, "#{ENV['RACK_ENV']}.yaml")
TMP_DIR = File.join(basedir, "tmp")
LOG_DIR = File.join(basedir, "log")
+=begin
if File.exist?(config_file)
CONFIG = YAML.load_file(config_file)
not_found_error "Could not load configuration from \"#{config_file.to_s}\"" unless CONFIG
@@ -19,10 +20,12 @@ else
puts "Please edit #{config_file} and restart your application."
exit
end
+=end
logfile = "#{LOG_DIR}/#{ENV["RACK_ENV"]}.log"
$logger = OTLogger.new(logfile)
+=begin
if CONFIG[:logger] and CONFIG[:logger] == "debug"
$logger.level = Logger::DEBUG
else
@@ -34,4 +37,5 @@ AA_SERVER = CONFIG[:authorization] ? (CONFIG[:authorization][:server] ? CONFIG[:
CONFIG[:authorization][:authenticate_request] = [""] unless CONFIG[:authorization][:authenticate_request]
CONFIG[:authorization][:authorize_request] = [""] unless CONFIG[:authorization][:authorize_request]
CONFIG[:authorization][:free_request] = [""] unless CONFIG[:authorization][:free_request]
+=end
diff --git a/lib/opentox.rb b/lib/opentox.rb
index 4ca154c..05a8a08 100644
--- a/lib/opentox.rb
+++ b/lib/opentox.rb
@@ -1,4 +1,5 @@
require 'sinatra/base'
+require "sinatra/reloader"
module OpenTox
# Base class for OpenTox services
@@ -12,6 +13,10 @@ module OpenTox
set :show_exceptions, false
set :static, false
+ configure :development do
+ register Sinatra::Reloader
+ end
+
error do
# TODO: set actor, calling OT::Error with uri parameter does not work
error = request.env['sinatra.error']
diff --git a/opentox-server.gemspec b/opentox-server.gemspec
index 66d4852..d365a49 100644
--- a/opentox-server.gemspec
+++ b/opentox-server.gemspec
@@ -23,7 +23,8 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'rack'
s.add_runtime_dependency 'rack-contrib'
s.add_runtime_dependency 'sinatra'
+ s.add_runtime_dependency 'sinatra-contrib'
s.add_runtime_dependency 'emk-sinatra-url-for'
- s.add_runtime_dependency 'spreadsheet'
s.add_runtime_dependency 'roo'
+ s.add_runtime_dependency 'unicorn'
end