web/metadata/config.ru in wakame-vdc-dcmgr-10.12.0 vs web/metadata/config.ru in wakame-vdc-dcmgr-11.06.0
- old
+ new
@@ -1,20 +1,17 @@
# -*- coding: utf-8 -*-
-begin
- require 'rubygems'
- require 'bundler'
- Bundler.setup(:default, :dcmgr)
-rescue ::Exception => e
-end
-$:.unshift "#{File.dirname(__FILE__)}/../../lib"
+$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../lib"
+require 'dcmgr/rubygems'
require 'dcmgr'
-if File.exists?('../../config/dcmgr.conf')
- Dcmgr.configure('../../config/dcmgr.conf')
-else
- raise "Could not find the config/dcmgr.conf configuration file."
-end
-Dcmgr.run_initializers
+Dcmgr.configure(File.expand_path('../../../config/dcmgr.conf', __FILE__))
+
+use Dcmgr::Rack::RunInitializer, lambda {
+ Dcmgr.run_initializers
+}, lambda {
+ next if Isono::NodeModules::DataStore.disconnected? == false
+ Dcmgr.run_initializers('sequel')
+}
run Dcmgr::Endpoints::Metadata.new