Permalink
Browse files

'rake run:webrickrhologserver' fixed

  • Loading branch information...
1 parent 46d48f6 commit 024a8bbae2c32305310ea3c43192c5ccba174609 @timashev timashev committed Nov 28, 2012
Showing with 47 additions and 48 deletions.
  1. +46 −0 Rakefile
  2. +1 −2 lib/build/jake.rb
  3. +0 −46 lib/build/webrickrholog.rake
View
@@ -1735,6 +1735,52 @@ namespace "build" do
end
end
+namespace :run do
+ desc "start rholog(webrick) server"
+ task :webrickrhologserver, :app_path do |t, args|
+ puts "Args were: #{args}"
+ $app_path = args[:app_path]
+
+ Rake::Task["config:wm"].invoke
+
+ $rhologserver = WEBrick::HTTPServer.new :Port => $rhologhostport
+
+ puts "LOCAL SERVER STARTED ON #{$rhologhostaddr}:#{$rhologhostport}"
+ started = File.open($app_path + "/started", "w+")
+ started.close
+
+ #write host and port 4 log server
+ $rhologfile = File.open(getLogPath, "w+")
+
+ $rhologserver.mount_proc '/' do |req,res|
+ if ( req.body == "RHOLOG_GET_APP_NAME" )
+ res.status = 200
+ res.chunked = true
+ res.body = $app_path
+ elsif ( req.body == "RHOLOG_CLOSE" )
+ res.status = 200
+ res.chunked = true
+ res.body = ""
+
+ $rhologserver.shutdown
+ else
+ $rhologfile.puts req.body
+ $rhologfile.flush
+ res.status = 200
+ res.chunked = true
+ res.body = ""
+ end
+ end
+
+ ['INT', 'TERM'].each {|signal|
+ trap(signal) {$rhologserver.shutdown}
+ }
+
+ $rhologserver.start
+ $rhologfile.close
+
+ end
+end
at_exit do
if $app_config && !$app_config["sdk"].nil?
View
@@ -641,8 +641,7 @@ def self.run_rho_log_server(app_path)
puts "EXC: #{e}"
end
- webrickrholog_rake = File.join(File.dirname(__FILE__), 'webrickrholog.rake')
- system("rake -f #{webrickrholog_rake} run:webrickrhologserver[\"#{app_path}\"]")
+ system("START rake run:webrickrhologserver[\"#{app_path}\"]")
end
end
@@ -1,46 +0,0 @@
-namespace :run do
- desc "start rholog(webrick) server"
- task :webrickrhologserver, :app_path do |t, args|
- puts "Args were: #{args}"
- $app_path = args[:app_path]
-
- Rake::Task["config:wm"].invoke
-
- $rhologserver = WEBrick::HTTPServer.new :Port => $rhologhostport
-
- puts "LOCAL SERVER STARTED ON #{$rhologhostaddr}:#{$rhologhostport}"
- started = File.open($app_path + "/started", "w+")
- started.close
-
- #write host and port 4 log server
- $rhologfile = File.open(getLogPath, "w+")
-
- $rhologserver.mount_proc '/' do |req,res|
- if ( req.body == "RHOLOG_GET_APP_NAME" )
- res.status = 200
- res.chunked = true
- res.body = $app_path
- elsif ( req.body == "RHOLOG_CLOSE" )
- res.status = 200
- res.chunked = true
- res.body = ""
-
- $rhologserver.shutdown
- else
- $rhologfile.puts req.body
- $rhologfile.flush
- res.status = 200
- res.chunked = true
- res.body = ""
- end
- end
-
- ['INT', 'TERM'].each {|signal|
- trap(signal) {$rhologserver.shutdown}
- }
-
- $rhologserver.start
- $rhologfile.close
-
- end
-end

0 comments on commit 024a8bb

Please sign in to comment.