expri 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,7 +46,7 @@ module Expri
46
46
  end
47
47
 
48
48
  def header
49
- "Expri.metrics do\n\n"
49
+ "Expri.metrics(destroy_extras: false) do\n\n"
50
50
  end
51
51
  end
52
52
  end
@@ -10,7 +10,7 @@ module Expri
10
10
 
11
11
  def run(&block)
12
12
  puts "run options=#{@options}" if @options[:verbose]
13
- cache_current if @options[:destroy_extras]
13
+ cache_current
14
14
 
15
15
  @metrics = []
16
16
  instance_eval(&block)
@@ -18,7 +18,7 @@ module Expri
18
18
  metric.put
19
19
  end
20
20
 
21
- destroy_extras if @options[:destroy_extras]
21
+ destroy_extras
22
22
  end
23
23
 
24
24
  private
@@ -28,11 +28,13 @@ module Expri
28
28
  end
29
29
 
30
30
  def destroy_extras
31
- puts "check_extras" if @options[:verbose]
32
31
  extra_metrics = @current_metrics - @metrics.map(&:name)
33
- extra_metrics.each do |metric|
34
- metric = Metric.new(metric, {}, @options)
35
- metric.destroy
32
+ puts "check_extras extras=#{extra_metrics}" if @options[:verbose]
33
+ if @options[:destroy_extras]
34
+ extra_metrics.each do |metric|
35
+ metric = Metric.new(metric, {}, @options)
36
+ metric.destroy
37
+ end
36
38
  end
37
39
  end
38
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: