piggly 2.2.4 → 2.3.0

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: 4f39e49434ecf4d819d325d757fa35296b0ef57d
4
- data.tar.gz: 893b9a44543b794fb421ced51ccc82b0e3bf0b55
3
+ metadata.gz: 175262d0310c2392a9dbff13eb183eeddd5c647b
4
+ data.tar.gz: 2acb41d50d60c228d3ed37007b195f07ed414aa4
5
5
  SHA512:
6
- metadata.gz: 70dec8fb3d903f549acb6589e53990cf8cee42433de404dfe05cfcd06157d7f678b68e4d910e4ffc9cd8bc7a08336fc16ad251365aeacab40d08e6dcd2315991
7
- data.tar.gz: e2936119f128db3bce6564a2edd02f5a8be06bab473d2b97c50481c9b5597effe2a8105c490f0f7015a5c7c40e8c5320f6e708ed5b352f07c07541f7aa7d374d
6
+ metadata.gz: d7c256d66313af55b98d2f1068ed12165dd7a0b4f2decefabb21d775d23299a614a2ca58e3c4eb40733b1c72068b66b33e088b42428b23699566585db940e107
7
+ data.tar.gz: 8fb2c3751afebf4f5bfe4e6fa8dbedb849d72c1557e236a1da6724779a1901dead7b708775c335197431727b3d8a20e7d988bf52a05c4f4efa2dcfd60cdaf435
@@ -28,7 +28,7 @@ module Piggly
28
28
  if rest.to_s == ""
29
29
  schema = nil
30
30
  else
31
- schema = name
31
+ schema = unquote(name)
32
32
  name = rest
33
33
  end
34
34
 
@@ -43,15 +43,19 @@ module Piggly
43
43
  if schema.to_s == ""
44
44
  fst, snd = name.split(".", 2)
45
45
  if snd.nil?
46
- new(nil, fst, array)
46
+ new(nil, unquote(fst), array)
47
47
  else
48
- new(fst, snd, array)
48
+ new(unquote(fst), unquote(snd), array)
49
49
  end
50
50
  else
51
- new(schema, name, array)
51
+ new(schema, unquote(name), array)
52
52
  end
53
53
  end
54
54
 
55
+ def self.unquote(s)
56
+ s[/^"(.*)"$/, 1] || s
57
+ end
58
+
55
59
  def initialize(schema, name, array)
56
60
  @schema, @name, @array = schema, name, array
57
61
  end
@@ -14,6 +14,7 @@ module Piggly
14
14
  tag :html do
15
15
  tag :head do
16
16
  tag :title, "Piggly PL/pgSQL Code Coverage"
17
+ tag :meta, :charset => "utf-8"
17
18
  tag :link, :rel => "stylesheet", :type => "text/css", :href => "piggly.css"
18
19
  tag :script, "<!-- -->", :type => "text/javascript", :src => "sortable.js"
19
20
  end
@@ -18,30 +18,37 @@ module Piggly
18
18
  tag :html, :xmlns => "http://www.w3.org/1999/xhtml" do
19
19
  tag :head do
20
20
  tag :title, "Code Coverage: #{procedure.name}"
21
+ tag :meta, :charset => "utf-8"
21
22
  tag :link, :rel => "stylesheet", :type => "text/css", :href => "piggly.css"
22
23
  tag :script, "<!-- -->", :type => "text/javascript", :src => "highlight.js"
23
24
  end
24
25
 
25
26
  tag :body do
26
- aggregate(procedure.name, @profile.summary(procedure))
27
-
28
- tag :div, :class => "listing" do
29
- tag :table do
30
- tag :tr do
31
- tag :td, "&nbsp;", :class => "signature"
32
- tag :td, signature(procedure), :class => "signature"
33
- end
27
+ tag :div, :class => "header" do
28
+ aggregate(procedure.name, @profile.summary(procedure))
29
+ end
34
30
 
35
- tag :tr do
36
- tag :td, data[:lines].to_a.map{|n| %[<a href="#L#{n}" id="L#{n}">#{n}</a>] }.join("\n"), :class => "lines"
37
- tag :td, data[:html], :class => "code"
31
+ tag :div, :class => "container" do
32
+ tag :div, :class => "listing" do
33
+ tag :table do
34
+ tag :tr do
35
+ tag :td, "&nbsp;", :class => "signature"
36
+ tag :td, signature(procedure), :class => "signature"
37
+ end
38
+
39
+ tag :tr do
40
+ tag :td, data[:lines].to_a.map{|n| %[<a href="#L#{n}" id="L#{n}">#{n}</a>] }.join("\n"), :class => "lines"
41
+ tag :td, data[:html], :class => "code"
42
+ end
38
43
  end
39
44
  end
40
- end
41
45
 
42
- toc(@profile[procedure])
46
+ toc(@profile[procedure])
47
+ end
43
48
 
44
49
  timestamp
50
+
51
+ tag :a, "Return to index", :href => "index.html", :class => "return"
45
52
  end
46
53
  end
47
54
  end
@@ -95,9 +102,9 @@ module Piggly
95
102
 
96
103
  def toc(tags)
97
104
  todo = tags.reject{|t| t.complete? }
98
-
105
+
99
106
  tag :div, :class => 'toc' do
100
- tag :a, 'Index', :href => 'index.html'
107
+ tag :strong, 'Notes'
101
108
 
102
109
  tag :ol do
103
110
  todo.each do |t|
@@ -19,3 +19,20 @@ function unhighlight(id, bg) {
19
19
  var el = document.getElementById(id);
20
20
  if (el) { el.style.backgroundColor = bg; }
21
21
  }
22
+
23
+ document.addEventListener('DOMContentLoaded', function() {
24
+ var toc = document.getElementsByClassName('toc');
25
+ var lis = document.getElementsByClassName('listing');
26
+ if (toc.length != 1 || lis.length != 1)
27
+ return;
28
+
29
+ window.onscroll = function() {
30
+ if (lis[0].getBoundingClientRect().y <= 0) {
31
+ toc[0].classList.add('toc-fixed');
32
+ lis[0].classList.add('listing-fixed');
33
+ } else {
34
+ toc[0].classList.remove('toc-fixed');
35
+ lis[0].classList.remove('listing-fixed');
36
+ }
37
+ }
38
+ });
@@ -6,50 +6,84 @@ body
6
6
  {
7
7
  color: #000;
8
8
  background-color: #fff;
9
- padding: 50px;
9
+ margin: 50px;
10
10
  }
11
11
 
12
12
  a img { border: 0; }
13
13
 
14
- div.timestamp
14
+ .timestamp
15
15
  {
16
16
  clear: both;
17
17
  font-family: "Consolas", "DejaVu Sans Mono", "Monaco", "Nimbus Mono L", "Courier New";
18
18
  font-style: italic;
19
19
  font-size: 9pt;
20
+ display: inline-block;
20
21
  }
21
22
 
22
- div.toc
23
+ .return {
24
+ font-family: "Tahoma", "Trebuchet MS", "Arial", sans-serif;
25
+ font-size: 9pt;
26
+ font-weight: bold;
27
+ display: inline-block;
28
+ margin-left: 10px;
29
+ }
30
+
31
+
32
+ .container {
33
+ display: flex;
34
+ flex-direction: row;
35
+ flex-wrap: nowrap;
36
+ justify-content: space-between;
37
+ align-items: flex-start;
38
+ align-content: flex-start;
39
+ padding-bottom: 1rem;
40
+ }
41
+
42
+ .toc
23
43
  {
24
- width: 200px;
25
- height: 150px;
26
- border: 1px solid #c00;
27
- background-color: #fdd;
28
- padding: 5px;
29
- position: fixed;
30
- overflow: auto;
31
- bottom: 10px;
32
- right: 10px;
33
44
  font-family: "Tahoma", "Trebuchet MS", "Arial", sans-serif;
45
+ order: 2;
46
+ flex-grow: 0;
47
+ flex-shrink: 0;
48
+ flex-basis: 180px;
49
+ padding-top: 10px;
50
+ padding-left: 10px;
51
+ }
52
+
53
+ .toc-fixed {
54
+ position: fixed;
55
+ width: 180px;
56
+ max-width: 180px;
57
+ top: 0;
58
+ right: 50px;
59
+ max-height: 100vh;
60
+ overflow-y: scroll;
34
61
  }
35
- div.toc ol { margin-left: 1.6em; }
36
- div.toc a { color: #c00; }
37
- div.toc li { font-size: 75%; }
38
- div.toc li.branch { }
39
- div.toc li.block { }
40
- div.toc li.loop { }
62
+ .toc-fixed ol { padding-bottom: 2rem; }
63
+ .toc ol { margin-left: 1.6em; }
64
+ .toc a { color: #c00; }
65
+ .toc li { font-size: 90%; margin-bottom: 0.5rem; line-height: 1.0; }
66
+ /*
67
+ .toc li.branch { }
68
+ .toc li.block { }
69
+ .toc li.loop { }
70
+ */
41
71
 
42
72
  /* main container for line numbers and code */
43
- div.listing
73
+ .listing
44
74
  {
45
75
  background-color: #f9f9f9;
46
76
  border: 1px solid silver;
47
- margin: 0 0 1.5em 0;
48
- overflow: auto;
77
+ overflow-x: auto;
78
+ order: 1;
79
+ flex-grow: 1;
80
+ flex-shrink: 1;
81
+ flex-basis: 100%;
49
82
  }
83
+ .listing-fixed { margin-right: 190px; }
50
84
 
51
- div.listing table { border-collapse: collapse; }
52
- div.listing td.signature
85
+ .listing table { border-collapse: collapse; }
86
+ .listing td.signature
53
87
  {
54
88
  vertical-align: top;
55
89
  padding: 2px 4px;
@@ -1,10 +1,10 @@
1
1
  module Piggly
2
2
  module VERSION
3
3
  MAJOR = 2
4
- MINOR = 2
5
- TINY = 4
4
+ MINOR = 3
5
+ TINY = 0
6
6
 
7
- RELEASE_DATE = "2017-11-01"
7
+ RELEASE_DATE = "2018-04-20"
8
8
  end
9
9
 
10
10
  class << VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piggly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kvle Putnam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-01 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop