dohlog 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/dohlog/interface.rb +7 -0
  2. data/lib/dohlog.rb +4 -1
  3. metadata +2 -2
@@ -21,6 +21,13 @@ class Interface
21
21
 
22
22
  def self.disable
23
23
  @@enabled = false
24
+ if block_given?
25
+ begin
26
+ yield
27
+ ensure
28
+ @@enabled = true
29
+ end
30
+ end
24
31
  end
25
32
 
26
33
  def initialize(location)
data/lib/dohlog.rb CHANGED
@@ -18,7 +18,10 @@ def enable
18
18
  end
19
19
 
20
20
  def disable
21
- DohLog::Interface.disable
21
+ return DohLog::Interface.disable if !block_given?
22
+ DohLog::Interface.disable do
23
+ yield
24
+ end
22
25
  end
23
26
 
24
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-19 00:00:00.000000000 Z
13
+ date: 2013-05-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dohutil