Module: HttpStub::Server::ApplicationHelpers

Defined in:
lib/http_stub/server/application_helpers.rb

Instance Method Summary collapse

Instance Method Details

#h(text) ⇒ Object



6
7
8
# File 'lib/http_stub/server/application_helpers.rb', line 6

def h(text)
  Rack::Utils.escape_html(text)
end

#pp(text) ⇒ Object



10
11
12
13
14
# File 'lib/http_stub/server/application_helpers.rb', line 10

def pp(text)
  text ? JSON.pretty_generate(JSON.parse(text)) : ""
rescue JSON::ParserError
  text
end