snuffle 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 713df3341f2c79b81034496b2845cc99ec213f9c
4
- data.tar.gz: 0c144dbb4a4ff8964c4f5feeee4be48a4fbcd878
3
+ metadata.gz: 247a7c56eb718a7a9b4e5b8a4a2d22ba5a0bdf66
4
+ data.tar.gz: 169c0a12c52adabb7b5cc16967e987db1f19bb16
5
5
  SHA512:
6
- metadata.gz: e2bb6fd2b0893572c1b00150fad69f92bedacadc1bc97fc2413957823c76f7208e701acd1a0b244b17d84845497e0fe8cfea57657b466d0c13cacc195d7f5fc4
7
- data.tar.gz: 69019538ede79b29ce12ac91879994b2ed0d8feec6ec6efcd4e401d64dfb3636c2b46876985e64f7f491c60c25c48dba639f842d9ee26f8d0294bea489e190f3
6
+ metadata.gz: dcabd09d081af6ef0d3f14c4552979092d55e726d93607b7005a9567d342d45f8dc93fef664817de7876720f65636e39deb5dc7a3bd9f49b2efaced8d3367096
7
+ data.tar.gz: e3ea47fb0e09a2509e4289e2bfd93389ae77a9124b97551851760692278c100df885004c3285115f112abc614c1e8af23e785916d03e8f2352bd52d1deeecdb1
data/lib/snuffle/cli.rb CHANGED
@@ -10,6 +10,7 @@ module Snuffle
10
10
  summaries = []
11
11
  file_list(path).each do |path_to_file|
12
12
  puts "Checking #{path_to_file}..."
13
+ Snuffle::Node.delete_all
13
14
  summary = Snuffle::SourceFile.new(path_to_file: path_to_file).summary
14
15
  html_report(summary, summary.source)
15
16
  summaries << summary
@@ -27,8 +27,11 @@ module Snuffle
27
27
  end
28
28
 
29
29
  def output_path
30
- FileUtils.mkpath(root_path)
31
- root_path
30
+ return @output_path if @output_path
31
+ path = root_path
32
+ path << "/" + summary.path_to_results if summary
33
+ FileUtils.mkpath(path)
34
+ @output_path = root_path
32
35
  end
33
36
 
34
37
  def path_to_results
@@ -36,7 +39,7 @@ module Snuffle
36
39
  end
37
40
 
38
41
  def filename
39
- base = summary.class_filename
42
+ base = "#{summary.filename}"
40
43
  base + file_extension
41
44
  end
42
45
 
@@ -33,14 +33,12 @@
33
33
  td { text-align: left; padding: .5em; padding-left: 1.25em !important;}
34
34
  td.center { text-align: center; }
35
35
  td.sorting_1 { background: none !important; padding-left: 1.25em !important; }
36
- th.sorting_asc, th.sorting_desc { text-transform: uppercase !important; font-size: .8em !important; background-image: none !important; background: rgba(64, 41, 41, .5) !important;}
37
- th.sorting { background-position: left !important; border-right: 1px solid #222; text-transform: uppercase !important; font-size: .8em !important}
36
+ th.sorting { background-position: left !important; border-right: 1px solid #222; text-transform: uppercase !important; font-size: .8em !important; font-weight: normal; background-color: #000 !important;}
38
37
  tr.faint td { opacity: 0.5; font-style: italic; }
39
- tr.header { background-color: #222; }
40
38
  tr.header th:first-child { border-radius: 6px 0 0 0; }
41
39
  tr.header th:last-child { border-radius: 0 6px 0 0; }
42
40
  tr.header th:only-child { border-radius: 6px 6px 0 0; }
43
- tr.header { background-color: #222; }
41
+ th.sorting_asc, th.sorting_desc { text-transform: uppercase !important; font-size: .8em !important; font-weight: bold; background-image: none !important; background: rgba(64, 41, 41, .5) !important;}
44
42
  tr.even { background: rgba(128, 128, 128, 0.5) !important;}
45
43
  tr.odd { background: rgba(128, 128, 128, 0.25) !important}
46
44
  tr.even:hover, tr.odd:hover { background: rgba(128, 128, 128, 0.75) !important;}
@@ -95,7 +93,7 @@
95
93
  %tr{class: "#{i % 2 == 1 ? 'odd' : 'even'} #{summary.has_results? ? '' : 'faint'}"}
96
94
  %td
97
95
  - if summary.has_results?
98
- %a{href: "source/#{summary.class_filename}.htm"}
96
+ %a{href: "source/#{summary.path_to_results}/#{summary.filename}.htm"}
99
97
  = summary.path_to_file
100
98
  - else
101
99
  = summary.path_to_file
@@ -12,7 +12,7 @@
12
12
  #{Rouge::Theme.find('thankful_eyes').render(scope: '.highlight')}
13
13
  a:link, a:visited { color: #fff }
14
14
  body { line-height: 1.5em; background: #49525a; color: #fff; font-family: arial, sans-serif; font-size: 14px; padding: 2em; }
15
- div.column { float: left; width: 45%; }
15
+ div.column { float: left; width: 45%; margin-left: 4%; }
16
16
  div.file_listing { padding: .1em; border-radius: 5px; background: #000; width: 100%; border: 1px solid #000;}
17
17
  div.file_meta { padding: 1em; border-radius: 5px; background: #440013; width: 98%; border: .5em solid #000;}
18
18
  h1 { color:#fff; font-size: 1.25em; margin-top: .25em; }
@@ -26,6 +26,7 @@
26
26
  span.highlighted { padding-left: 1em; display: inline-block; position: absolute; left: 0px; padding-right: 90%}
27
27
  table { width: 100%; box-shadow: 0 5px 0 rgba(0,0,0,.8); border-spacing: 0; border: 5px solid #000; border-radius: 5px; border-collapse: collapse; min-width: 50%; }
28
28
  td { text-align: left; padding: .5em; padding-left: 1.25em !important;}
29
+ td.gutter { background-color: rgb(41, 80, 109) !important; }
29
30
  tfoot { background: #000; border-top: 10px solid #000; font-family: courier; margin-top: 4em; font-size: .75em; }
30
31
  th { background: #000; text-align: left; padding: .5em; }
31
32
  tr.even { background: rgba(128, 128, 128, 0.5) !important;}
@@ -41,7 +42,7 @@
41
42
  .clear { clear: both; }
42
43
  .highlighted { background: rgba(170, 161, 57, .6); border-radius: 100px; }
43
44
  .highlighted-method { background: rgba(153, 51, 80, .6); padding: .25em; border-radius: 100px; color: #fff; }
44
- .indented {margin-left: 1em; }
45
+ p.indented {margin-left: 2em; }
45
46
  .summary {padding: 1em; border-radius: 5px; background: rgb(41, 80, 109); width: 98%; border: .5em solid #000;}
46
47
  .btn {
47
48
  -webkit-border-radius: 28;
@@ -74,7 +75,8 @@
74
75
  %h3.indented.highlighted
75
76
  Data Clumps:
76
77
  - if summary.cohorts.count == 0
77
- %em.indented None
78
+ %p.indented
79
+ %em None
78
80
  - else
79
81
  %ul.indented
80
82
  - summary.cohorts.group_by{|c| c.values.sort }.each do |values, cohorts|
@@ -89,7 +91,8 @@
89
91
  %h3.indented.highlighted-method
90
92
  Possible Latent Objects:
91
93
  - if summary.latent_objects.count == 0
92
- %em.indented None
94
+ %p.indented
95
+ %em None
93
96
  - else
94
97
  %ul.indented
95
98
  - summary.latent_objects.each do |latent_object|
@@ -4,12 +4,16 @@ module Snuffle
4
4
  include PoroPlus
5
5
  attr_accessor :class_name, :path_to_file, :cohorts, :latent_objects, :source
6
6
 
7
- def class_filename
8
- self.class_name.downcase.gsub(' ', '_')
7
+ def has_results?
8
+ self.cohorts.count != 0 || self.latent_objects.count != 0
9
9
  end
10
10
 
11
- def has_results?
12
- self.cohorts.count != 0 || self.latent_objects.count != 0
11
+ def path_to_results
12
+ self.path_to_file.split("/")[0..-2].join('/')
13
+ end
14
+
15
+ def filename
16
+ path_to_file.split("/")[-1]
13
17
  end
14
18
 
15
19
  end
@@ -1,3 +1,3 @@
1
1
  module Snuffle
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snuffle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coraline Ada Ehmke