sass-prof 0.3.0 → 0.3.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: 082e6bb8340e42960e64ca08611143d7674c3eb9
4
- data.tar.gz: d09299a30a5afa8c6135a2720ce555f80f427663
3
+ metadata.gz: 6b2ed24aefa1059cfcfd31ed8f8982a2ab152756
4
+ data.tar.gz: 3860e3bab2ade75dc3eed9a4015912d0a9ecc0d4
5
5
  SHA512:
6
- metadata.gz: 493f298da828e6533cd86bbe7a24b9b5667ecfca8a1e7760f764b424dd69daf7dd055bb64caca7778a54d5292e2070e9828a6e0221162f00c93aa36c3c9a69eb
7
- data.tar.gz: 74a7821bd4ac37cbcc0789884bf534034ad7cf3aac55247173f0257f98d73e804ede70888072eba9e6f86f9485f991fdc3f2d69463505519eb407ad2100e586b
6
+ metadata.gz: 42efddb28f559764c8893ae5f34b8cd1d2c054b7b4145c237b99bbfed7c9e48d5fadd8a3e339f5a347ee35501f2dd769a01c79aed722a6761578f23b1bcb9dec
7
+ data.tar.gz: f9edf05b517c9612a4ea35fb73e3a7e7c296db6f3c4ab56a43a2dc631d9f8692f529075806b243e9b4b9b6ba62fbed7bf9f7941da678333dba82504ed41a64fb
data/README.md CHANGED
@@ -52,7 +52,7 @@ prof.max_execution_time = 15
52
52
  # Default is `true`
53
53
  prof.color = true
54
54
 
55
- # Execution time precision
55
+ # Execution time integer precision
56
56
  # Default is `15`
57
57
  prof.precision = 5
58
58
  ```
data/lib/sass-prof.rb CHANGED
@@ -75,12 +75,19 @@ module Sass
75
75
  end
76
76
 
77
77
  def to_table(rows)
78
- t_total_in_seconds = rows.map { |c|
79
- c[1].gsub(/\e\[(\d+)(;\d+)*m/, "").to_f }.reduce(:+) / 1000 % 60
78
+ t_ms = rows.map { |c|
79
+ c[1].gsub(/\e\[(\d+)(;\d+)*m/, "").to_f }.reduce(:+)
80
+
81
+ if t_ms > 1000
82
+ t_sec = t_ms / 1000 % 60
83
+ t = "#{t_sec.round(Prof::Config.precision - 1)}s"
84
+ else
85
+ t = "#{t_ms.round(Prof::Config.precision - 2)}ms"
86
+ end
80
87
 
81
88
  # Add total execution time footer
82
89
  rows << :separator
83
- rows << ["Total Execution Time", t_total_in_seconds]
90
+ rows << ["Total", t]
84
91
 
85
92
  table = Terminal::Table.new({
86
93
  :headings => ["File", "Execution Time", "Action", "Signature"],
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  module Prof
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
7
7
  end
data/screenshot.jpg CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezekg