module Perus::Server::Helpers
Public Instance Methods
clean_arrows(text)
click to toggle source
# File lib/perus/server/helpers.rb, line 38 def clean_arrows(text) text.gsub('<', '<').gsub('>', '>') end
command_actions()
click to toggle source
# File lib/perus/server/helpers.rb, line 28 def command_actions commands = Perus::Pinger::Command.subclasses.reject(&:metric?) commands.reject(&:abstract?) end
command_metrics()
click to toggle source
# File lib/perus/server/helpers.rb, line 33 def command_metrics metrics = Perus::Pinger::Command.subclasses.select(&:metric?) metrics.reject(&:abstract?) end
escape_quotes(text)
click to toggle source
# File lib/perus/server/helpers.rb, line 42 def escape_quotes(text) text.to_s.gsub('"', '"') end
load_site_information()
click to toggle source
# File lib/perus/server/helpers.rb, line 3 def load_site_information @site_name = Server.options.site_name @groups = Group.all end
protected!()
click to toggle source
# File lib/perus/server/helpers.rb, line 50 def protected! return if authorised? headers['WWW-Authenticate'] = 'Basic realm="Restricted Area"' halt 401, "Not authorized\n" end
url_prefix()
click to toggle source
# File lib/perus/server/helpers.rb, line 46 def url_prefix Server.options.url_prefix end