Sha256: 9f5e698d942b0dabace332af1a422212b2975a623567df36247c4f5a67258f5c
Contents?: true
Size: 800 Bytes
Versions: 2
Compression:
Stored size: 800 Bytes
Contents
require "rouge" module Audits1984 module ApplicationHelper def format_date(date) # <time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time> date.strftime("%Y-%m-%d") end def format_date_and_time(date) # <time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time> date.strftime("%Y-%m-%d at %I:%m %P") end def highlighted_code_from(commands) highlight_code commands.collect(&:statements).collect(&:strip).filter(&:present?).join("\n") end def highlight_code(source) formatter = Rouge::Formatters::HTMLLinewise.new(Rouge::Formatters::HTML.new) lexer = Rouge::Lexers::Ruby.new formatter.format(lexer.lex(source)).html_safe end def sensitive_session_decoration(session) "*" if session.sensitive? end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
audits1984-0.1.3 | app/helpers/audits1984/application_helper.rb |
audits1984-0.1.2 | app/helpers/audits1984/application_helper.rb |