Class: Piggly::Reporter::Index
- Defined in:
- lib/piggly/reporter/index.rb
Constant Summary
Constants included from HtmlDsl
HtmlDsl::HTML_PATTERN, HtmlDsl::HTML_REPLACE
Instance Method Summary collapse
-
#initialize(config, profile) ⇒ Index
constructor
A new instance of Index.
- #report(procedures, index) ⇒ Object
Methods inherited from Base
Methods included from HtmlDsl
Constructor Details
#initialize(config, profile) ⇒ Index
Returns a new instance of Index.
6 7 8 |
# File 'lib/piggly/reporter/index.rb', line 6 def initialize(config, profile) @config, @profile = config, profile end |
Instance Method Details
#report(procedures, index) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/piggly/reporter/index.rb', line 10 def report(procedures, index) io = File.open("#{report_path}/index.html", "w") html(io) do tag :html do tag :head do tag :title, "Piggly PL/pgSQL Code Coverage" tag :link, :rel => "stylesheet", :type => "text/css", :href => "piggly.css" tag :script, "<!-- -->", :type => "text/javascript", :src => "sortable.js" end tag :body do aggregate("PL/pgSQL Coverage Summary", @profile.summary) table(procedures.sort_by{|p| index.label(p) }, index) end end end ensure io.close end |