lib/dyndoc-html-servers.rb in dyndoc-ruby-1.4.1 vs lib/dyndoc-html-servers.rb in dyndoc-ruby-1.4.2

- old
+ new

@@ -1,9 +1,10 @@ require 'dyndoc/init/home' require 'pathname' require 'yaml' require 'filewatcher' +require 'dyndoc-servers-cfg' #if RUBY_VERSION >= "2.4" class FileWatcher < Filewatcher end #end @@ -234,11 +235,11 @@ arg=["-R",dyn_html_srv_ru] if HtmlServers.cfg["html-srv-port"] arg += ["-p",HtmlServers.cfg["html-srv-port"].to_s] else - arg += ["-p",port || "9294"] + arg += ["-p",(port || DyndocServers.dyn_http_port? || 9294).to_s] end if host arg += ["-a",host] elsif HtmlServers.cfg["html-srv-host"] arg += ["-a",HtmlServers.cfg["html-srv-host"].to_s] @@ -279,10 +280,10 @@ public_root = cfg["public_root"] || HtmlServers.cfg["public_root"] || File.join(root ,"public") dyn_public_edit_root = File.join(public_root,"users","*",".edit","**","*.dyn") pages_root = File.join(public_root ,"pages") current_email = cfg["email"] || HtmlServers.cfg["email"] || "rdrouilh@gmail.com" #default email user can be overriden by -u option host=(cfg["html-srv-host"] || HtmlServers.cfg["html-srv-host"] || "http://localhost").to_s - port=(cfg["html-srv-port"] || HtmlServers.cfg["html-srv-port"] || "9294").to_s + port=(cfg["html-srv-port"] || HtmlServers.cfg["html-srv-port"] || DyndocServers.dyn_http_port? || "9294").to_s base_url= host+":"+port opts = { dyn_root: dyn_root, html_root: pages_root,