Permalink
Browse files

this doesnt belong here

  • Loading branch information...
ddollar committed Sep 8, 2012
1 parent 05eb741 commit 1dfb98e71e85de1463946256e3bc2b70901e6e9f
Showing with 0 additions and 34 deletions.
  1. +0 −34 bin/development_server
View
@@ -1,34 +0,0 @@
-#!/usr/bin/env ruby
-
-require "distributor/server"
-require "thread"
-
-`stty -echo raw`
-
-server = Distributor::Server.new($stdin.dup, $stdout.dup)
-$stdout.reopen($stderr)
-
-begin
- server.on_command do |command, data|
- Thread.new do
- case command
- when "file.download" then
- file = File.expand_path(File.join("/app/work", data["name"]))
- FileUtils.mkdir_p File.dirname(file)
- %x{ curl -s #{ENV["ANVIL_HOST"]}/file/#{data["hash"]} -o #{file} 2>&1 }
- server.command command, data.merge("ack" => Time.now.to_f)
- when "file.delete" then
- file = File.expand_path(File.join("/app/work", data["name"]))
- FileUtils.rm_f file
- server.command command, data.merge("ack" => Time.now.to_f)
- end
- end
- end
-
- server.start
-rescue Exception => ex
- $stderr.puts ex.message
- $stderr.puts ex.backtrace
- server.command "error", "message" => ex.message
- retry
-end

0 comments on commit 1dfb98e

Please sign in to comment.