Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

this doesnt belong here

  • Loading branch information...
commit 1dfb98e71e85de1463946256e3bc2b70901e6e9f 1 parent 05eb741
@ddollar authored
Showing with 0 additions and 34 deletions.
  1. +0 −34 bin/development_server
View
34 bin/development_server
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.