diff --git bin/shoed bin/shoed index da4738a..8de2645 100755 --- bin/shoed +++ bin/shoed @@ -12,7 +12,13 @@ ODBA.cache.setup ODBA.cache.clean_prefetched $shoe = SHOE::App.new -$0 = "Shoe (ShoeApp)" +if (opt = ARGV.first and opt == 'crawler') + server_uri = SHOE::SERVER_URI_FOR_CRAWLER + $0 = "Shoe (ShoeApp:Crawler)" +else + server_uri = SHOE::SERVER_URI + $0 = "Shoe (ShoeApp)" +end -DRb.start_service(SHOE::SERVER_URI, $shoe) +DRb.start_service(server_uri, $shoe) DRb.thread.join diff --git doc/index.rbx doc/index.rbx index 24ff23b..51707aa 100755 --- doc/index.rbx +++ doc/index.rbx @@ -6,7 +6,13 @@ require 'util/shoeconfig' DRb.start_service('druby://localhost:0') begin - SBSM::Request.new(SHOE::SERVER_URI).process + request = SBSM::Request.new(nil) + if (request.is_crawler?) + server_uri = SHOE::SERVER_URI_FOR_CRAWLER + else + server_uri = SHOE::SERVER_URI + end + SBSM::Request.new(server_uri).process rescue Exception => e $stderr << "Shoe-Error: " << e.message << "\n" $stderr << e.class << "\n" diff --git src/util/shoeconfig.rb src/util/shoeconfig.rb index 884e9fa..b1cb82a 100644 --- src/util/shoeconfig.rb +++ src/util/shoeconfig.rb @@ -4,6 +4,7 @@ module SHOE SERVER_NAME = 'shoe.localhost' SERVER_URI = "druby://localhost:22222" + SERVER_URI_FOR_CRAWLER = "druby://localhost:33333" PROJECT_ROOT = File.expand_path('../..', File.dirname(__FILE__)) ENCODING = 'UTF-8' end