discretion 1.0.0.pre.alpha → 2.0.0.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/discretion/helpers.rb +9 -2
- data/lib/discretion/version.rb +1 -1
- 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: 356b1ea298c592e14cc0bee26238faf978a325da
|
4
|
+
data.tar.gz: 68ea3e321eb97c0c718c7ce28e11d6f92cf6f3e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea101402106c86b157f4741bdba29563b33d8d07620bc88b5e4031972dd92cb426134be70e14b40ddf7ecb274f015697ee71ee7cf8c1098e3f1dad882d729705
|
7
|
+
data.tar.gz: '058fa5ae16167fab16beb478f630d3a7c7e0a9d8a9fd6d22cf81da1c5a1218e86c3863dae2196360c775f4ca5755311dd65da545deb5569cdbb48e30461c50f4'
|
data/lib/discretion/helpers.rb
CHANGED
@@ -8,8 +8,15 @@ module Discretion
|
|
8
8
|
Rails.env.test?
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
|
11
|
+
def try_to(viewer)
|
12
|
+
orig_viewer = Discretion.current_viewer
|
13
|
+
Discretion.set_current_viewer(viewer)
|
14
|
+
yield
|
15
|
+
true
|
16
|
+
rescue Discretion::CannotSeeError, Discretion::CannotWriteError
|
17
|
+
false
|
18
|
+
ensure
|
19
|
+
Discretion.set_current_viewer(orig_viewer)
|
13
20
|
end
|
14
21
|
|
15
22
|
def omnisciently
|
data/lib/discretion/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discretion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abe Land
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|