lib/envoy/client/command.rb in envoy-proxy-0.1.4 vs lib/envoy/client/command.rb in envoy-proxy-0.1.5
- old
+ new
@@ -16,10 +16,23 @@
end
def load_config
if path = find_config
conf = YAML.load(File.read(path))
- conf.is_a?(Array) ? conf : [conf]
+ Array(conf).each do |conf|
+ if conf["rails"]
+ conf["dir"] = conf["rails"]
+ conf["pidfile"] = "tmp/pids/server.pid"
+ conf["command"] = "rails s -p %{local_port}"
+ conf["delay"] = 10
+ elsif conf["rackup"]
+ conf["dir"] = conf["rackup"]
+ conf["command"] = "rackup -p %{local_port}"
+ conf["delay"] = 10
+ end
+ conf["host"] ||= conf["dir"].split("/")[-1] if conf["dir"]
+ conf["dir"] = File.expand_path(conf["dir"], path + "/..") if conf["dir"]
+ end
else
[{"local_port" => "80"}]
end
end
\ No newline at end of file