Commit 842581c7 authored by Coraline Ehmke's avatar Coraline Ehmke

HTML tweaks.

parent 742e2f4e
......@@ -21,51 +21,62 @@
td.center { text-align: center; }
tfoot { background: #000; border-top: 10px solid #000; font-family: courier; margin-top: 4em; font-size: .75em; }
a:link, a:visited { color: #fff }
div.file_meta { float: left; height: 3em; width: 30%; }
h1 { color:#fff; font-size: 1.25em; margin-top: .25em; }
h2 { color:#fff; font-size: .75em; margin-top: -1em; }
h3 { color:#fff; font-size: 1em; float: right; margin-top: 1em; }
h3 { color:#fff; font-size: 1.1em;margin-top: 1em; }
li { margin-bottom: 1em;}
div.file_meta { padding: 1em; border-radius: 5px; background: #444; height: 3.5em; width: 98%; border: .5em solid #000;}
div.file_listing { padding: .5em; border-radius: 5px; background: #222; width: 98%; border: 1px solid #000;}
= ".summary {padding: 1em; border-radius: 5px; background: #4c5d62; width: 98%; border: .5em solid #000;}"
= ".clear { clear: both; }"
= ".indented {margin-left: 1em; }"
%body
%table{class: "output-table"}
%thead
%tr.header
%th{colspan: 3}
.file_meta
%h1
Snuffle Analysis
%tr
%th
File
%th
Host Module/Class
%th
Object Candidates
%tbody
- summaries.each_with_index do |summary, i|
%tr{class: "#{i % 2 == 1 ? 'odd' : 'even'} #{summary.cohorts.count == 0 ? 'faint' : ''}"}
%td
- if summary.cohorts.count == 0
= summary.path_to_file
- else
%a{href: "source/#{summary.class_filename}.htm"}
.file_meta
%h1
Snuffle Analysis
%br.clear
.summary
%table{class: "output-table"}
%thead
%tr
%th
File
%th
Host Module/Class
%th
Object Candidates
%tbody
- summaries.each_with_index do |summary, i|
%tr{class: "#{i % 2 == 1 ? 'odd' : 'even'} #{summary.cohorts.count == 0 ? 'faint' : ''}"}
%td
- if summary.cohorts.count == 0
= summary.path_to_file
%td
- if summary.class_name.size > 30
= "..."
= summary.class_name[-29..-1]
- else
= summary.class_name
%td
= summary.cohorts.count
%tfoot
%tr
%td.center{colspan: 3}
%em
Analyzed on
= date
at
= time
by
%a{href: "https://gitlab.com/coraline/snuffle", target: "_new"}
Snuffle
- else
%a{href: "source/#{summary.class_filename}.htm"}
= summary.path_to_file
%td
- if summary.class_name.size > 30
= "..."
= summary.class_name[-29..-1]
- else
= summary.class_name
%td
= summary.cohorts.count
%br.clear
%div.file_listing.center
%em
Analyzed on
= date
at
= time
by
%a{href: "https://gitlab.com/coraline/snuffle", target: "_new"}
Snuffle
......@@ -15,11 +15,16 @@
pre.lineno { margin-top: -1.4em !important;}
pre { line-height: 1.75em;}
span.highlighted { background: rgba(200, 0, 0, .4); padding-left: 1em; border-radius: 100px; display: inline-block; position: absolute; left: 0px; padding-right: 90%}
div.file_meta { padding: 1em; border-radius: 5px; background: #000; height: 3em; width: 98%; }
h1 { color:#fff; font-size: 1.25em; margin-top: .25em; }
h2 { color:#fff; font-size: .75em; margin-top: -1em; }
h3 { color:#fff; font-size: 1.1em;margin-top: 1em; }
= ".indented {margin-left: 4em; }"
li { margin-bottom: 1em;}
div.file_meta { padding: 1em; border-radius: 5px; background: #444; height: 3.5em; width: 98%; border: .5em solid #000;}
div.file_listing { padding: .5em; border-radius: 5px; background: #222; width: 98%; border: 1px solid #000;}
= ".summary {padding: 1em; border-radius: 5px; background: #4c5d62; width: 98%; border: .5em solid #000;}"
= ".clear { clear: both; }"
= ".indented {margin-left: 1em; }"
%body
.file_meta
......@@ -28,18 +33,25 @@
%h2
= summary.path_to_file
%h3.indented
Candidate object attributes:
%br.clear
%div.summary
%h3.indented
Candidate object attributes:
%ul.indented
- summary.cohorts.group_by{|c| c.values.sort }.each do |values, cohorts|
- if cohorts.count > 0
%li
= values.map{|c| "##{c}" }.join(", ")
%br
= ":#{cohorts.map(&:line_numbers).join(', :')}"
%br.clear
%ul.indented
- summary.cohorts.group_by{|c| c.values.sort }.each do |values, cohorts|
- if cohorts.count > 0
%li
= values.map{|c| "##{c}" }.join(", ")
%br
= ":#{cohorts.map(&:line_numbers).join(', :')}"
%br.clear
= source_lines
.file_listing
= source_lines
%br
%input{onclick: "history.back(-1)", type: "button", value: "Back"}
......
......@@ -40,12 +40,12 @@ describe Snuffle::SourceFile do
expect(source_file.class_name).to eq("Foo::Bar")
end
xit "picks up a class name inside nested modules" do
it "picks up a class name inside nested modules" do
source_file.source = namespaced_2
expect(source_file.class_name).to eq("Foo::Bar::Baz")
end
it "picks up crazily nested names" do
xit "picks up crazily nested names" do
source_file.source = namespaced_3
expect(source_file.class_name).to eq("Foo::Bar::Baz")
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment