sass-prof 0.3.4 → 0.3.5

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: 7e7f80a6e5ebec2c14d044f9afce9c1f6659c076
4
- data.tar.gz: abc511967596f3188b8eb3b27c284d7dc7327a1e
3
+ metadata.gz: e37860473bfa73ead2c01c662024505ddf4bab29
4
+ data.tar.gz: cc7f27493822630a8c35fabb083151fafcd6d182
5
5
  SHA512:
6
- metadata.gz: ce60f6fc70fce46f77eaebda2e01c29d7152314089af493d9f21209402c6c739443819691916ac9b3d440b830a506a23593f1f88fbf035e66ade7d40e075741a
7
- data.tar.gz: 990bd07b6cf533554df75ed727efd911fc6b7198f51eafc988a369daaa37eee37bd1424321fa856fb94ba6608d62198a4829c7532ce12f672d6f4c09a5f024e4
6
+ metadata.gz: 4dd56d83f24ba3a906eaa9e979254c14552f33705e7731ebea0d4070d22d9f66d0901220b92350a664dffff45c2195445137001386c6162d18786ba245a34735
7
+ data.tar.gz: dc3cecbc78e426b8113e8d87d567c8eea4a0eee19cc2b2fedfed697f7c4a6b206e1868a31ef4c2d2b4c615f8759a9509e22c9c82cfff7939b48bacb0d6b06057
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  module Prof
5
- VERSION = "0.3.4"
5
+ VERSION = "0.3.5"
6
6
  end
7
7
  end
data/lib/sass-prof.rb CHANGED
@@ -123,25 +123,24 @@ module Sass
123
123
  class Profiler
124
124
  attr_accessor :function, :action, :args, :env
125
125
 
126
- @@t_total = 0
127
- @@t_then = 0
128
- @@t_now = 0
129
-
130
126
  def initialize(function, action, args = nil, env = nil)
131
127
  @function = function
132
128
  @action = action
133
129
  @args = args
134
130
  @env = env
131
+ @t_total = 0
132
+ @t_then = 0
133
+ @t_now = 0
135
134
  end
136
135
 
137
136
  def start
138
- @@t_then = Time.now
137
+ @t_then = Time.now
139
138
  end
140
139
 
141
140
  def stop
142
- @@t_now = Time.now
143
- t_delta = (@@t_now.to_f - @@t_then.to_f) * 1000.0
144
- @@t_then, @@t_total = @@t_now, t_delta
141
+ @t_now = Time.now
142
+ t_delta = (@t_now.to_f - @t_then.to_f) * 1000.0
143
+ @t_then, @t_total = @t_now, t_delta
145
144
 
146
145
  create_fn_report
147
146
  end
@@ -154,16 +153,16 @@ module Sass
154
153
 
155
154
  Prof::Report.add_row fn_report unless Prof::Config.quiet
156
155
 
157
- if @@t_total > Prof::Config.t_max && action == :execute
156
+ if @t_total > Prof::Config.t_max && action == :invoke
158
157
  raise RuntimeError.new Prof::Formatter.colorize(
159
158
  "Max execution time of #{Prof::Config.t_max}ms reached for function"\
160
- " `#{fn_name}()` (took #{@@t_total.round(3)}ms)", :red)
159
+ " `#{fn_name}()` (took #{@t_total.round(3)}ms)", :red)
161
160
  end
162
161
  end
163
162
 
164
163
  def fn_execution_time
165
- color = @@t_total > Prof::Config.t_max ? :red : :green
166
- t_exec = "%.#{Prof::Config.precision}f" % @@t_total
164
+ color = @t_total > Prof::Config.t_max ? :red : :green
165
+ t_exec = "%.#{Prof::Config.precision}f" % @t_total
167
166
  Prof::Formatter.colorize t_exec, color
168
167
  end
169
168
 
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
4
+ version: 0.3.5
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-26 00:00:00.000000000 Z
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: compass