page titles

This commit is contained in:
jomo
2014-06-16 00:05:09 +02:00
parent 19eb868a50
commit 03efb744d1
29 changed files with 60 additions and 19 deletions

View File

@@ -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)