Module: Admin::DashboardHelper

Defined in:
app/helpers/admin/dashboard_helper.rb

Instance Method Summary collapse

Instance Method Details

#highlight_app(t) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/admin/dashboard_helper.rb', line 3

def highlight_app(t)
  op = []
  return "" unless t
  t.split("\n").each do |line|
    opentag = nil
    closetag = nil
    if line =~ /^\//
      unless line =~ /\/vendor\// || line =~ /\/gems\/passenger/
        opentag = "<span style='background-color: #FFFFDD'>"
        closetag = "</span>"
      end
    end

    op << opentag if opentag
    op << line
    op << closetag if closetag
    op << "<br/>"
  end
 
  op.join("\n").html_safe
end