sass-prof 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sass-prof/version.rb +1 -1
- data/lib/sass-prof.rb +17 -21
- data/screenshot.jpg +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5345f6abae1c649f21788c725c6496a1c0efd79
|
4
|
+
data.tar.gz: 80fa3bb09cc6b0dad48e0fe46d3bfa98732a2b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed069921056fb469fb3e699a759a0ab1d79ab6ef96672e683997954de4bad7bcdb0c6749c5a1f75e23cc2286bd064ec310ab22b7442e6a87bb3ffbb229b53ba
|
7
|
+
data.tar.gz: 2aecdde2cdba349f5594fe12cc769a0e7f3f79be616636694e2d604adf3e74dbe3458eb035e0a35b2668853e18f1eb14da4235f4e132b14412b189afcd424554
|
data/lib/sass-prof/version.rb
CHANGED
data/lib/sass-prof.rb
CHANGED
@@ -57,39 +57,35 @@ module Sass
|
|
57
57
|
|
58
58
|
module Formatter
|
59
59
|
|
60
|
+
COLORS = Hash.new("37").merge({
|
61
|
+
:black => "30",
|
62
|
+
:red => "31",
|
63
|
+
:green => "32",
|
64
|
+
:yellow => "33",
|
65
|
+
:blue => "34",
|
66
|
+
:purple => "35",
|
67
|
+
:cyan => "36",
|
68
|
+
:white => "37",
|
69
|
+
})
|
70
|
+
|
60
71
|
def colorize(string, color)
|
61
72
|
return string.to_s unless Prof::Config.color
|
62
73
|
|
63
|
-
|
64
|
-
:black => "30",
|
65
|
-
:red => "31",
|
66
|
-
:green => "32",
|
67
|
-
:yellow => "33",
|
68
|
-
:blue => "34",
|
69
|
-
:purple => "35",
|
70
|
-
:cyan => "36",
|
71
|
-
:white => "37",
|
72
|
-
})
|
73
|
-
|
74
|
-
"\e[0;#{colors.fetch(color)}m#{string}\e[0m"
|
74
|
+
"\e[0;#{COLORS.fetch(color)}m#{string}\e[0m"
|
75
75
|
end
|
76
76
|
|
77
77
|
def to_table(rows)
|
78
|
+
pr = Prof::Config.precision / 3 - 5 # 5 is to account for whitespace
|
78
79
|
t_ms = rows.map { |c|
|
79
80
|
c[1].gsub(/\e\[(\d+)(;\d+)*m/, "").to_f }.reduce :+
|
80
81
|
|
81
|
-
|
82
|
-
|
83
|
-
elsif t_ms > 1000
|
84
|
-
t_sec = t_ms / 1000 % 60
|
85
|
-
t = "%.#{Prof::Config.precision - 1}fs" % t_sec
|
86
|
-
else
|
87
|
-
t = "%.#{Prof::Config.precision - 2}fms" % t_ms
|
88
|
-
end
|
82
|
+
t_ss, t_ms = t_ms.divmod 1000
|
83
|
+
t_mm, t_ss = t_ss.divmod 60
|
89
84
|
|
90
85
|
# Add total execution time footer
|
91
86
|
rows << :separator
|
92
|
-
rows << ["Total",
|
87
|
+
rows << ["Total",
|
88
|
+
"%.#{pr}fm %.#{pr}fs %.#{pr}fms" % [t_mm, t_ss, t_ms]]
|
93
89
|
|
94
90
|
table = Terminal::Table.new({
|
95
91
|
:headings => ["File", "Execution Time", "Action", "Signature"],
|
data/screenshot.jpg
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ezekg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compass
|