page titles
This commit is contained in:
@@ -1,18 +1,8 @@
|
||||
module ApplicationHelper
|
||||
def port_open?(host, port)
|
||||
wait = 300/1000.0 #milliseconds, the .0 is required!!
|
||||
require 'timeout'
|
||||
require 'socket'
|
||||
isopen = false
|
||||
begin
|
||||
Timeout::timeout(wait) {
|
||||
TCPSocket.new host, port
|
||||
isopen = true
|
||||
}
|
||||
rescue Exception
|
||||
# could not connect to the server
|
||||
end
|
||||
return isopen
|
||||
|
||||
def title(site_title)
|
||||
content_for(:site_title, site_title.to_s.html_safe) # html_safe because it's escaped again later (yield?)
|
||||
site_title
|
||||
end
|
||||
|
||||
def render_md(content)
|
||||
|
||||
Reference in New Issue
Block a user