xplenty-jruby_sandbox 0.2.5-java → 0.2.6-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sandbox/safe.rb +5 -0
- data/lib/sandbox/sandbox.jar +0 -0
- data/lib/sandbox/version.rb +1 -1
- data/spec/sandbox_spec.rb +11 -6
- 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: a53b8c5b150b3f8869f85839e0f248ac2b24962e
|
4
|
+
data.tar.gz: c67be1f47c6fe9ab92b1f0b6247250886e3962d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b6a84730f01587919e12ff6cd200eb39d10dc7b0e3db65daadfcaa4765bead7a0c5fbfd63fa2ddc866825a705358d35a2a49c78d79e4a29ab5e30de51b06d66
|
7
|
+
data.tar.gz: 4fb479679fe4428bd3d7bf85cd7165eb8ef2658184e54964a2cd97b59211f770c241fd20f9aaf6fda398e38ce58951527a004f760abe07fe7542b9351078469e
|
data/lib/sandbox/safe.rb
CHANGED
@@ -71,6 +71,11 @@ module Sandbox
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
# We do this here as some of the FakeFs classes require ENV in order to behave..
|
75
|
+
Object.class_eval do
|
76
|
+
remove_const(:ENV)
|
77
|
+
end
|
78
|
+
|
74
79
|
[Dir, File, FileUtils, FileTest].each do |fake_class|
|
75
80
|
fake_class.class_eval do
|
76
81
|
def self.class_eval
|
data/lib/sandbox/sandbox.jar
CHANGED
Binary file
|
data/lib/sandbox/version.rb
CHANGED
data/spec/sandbox_spec.rb
CHANGED
@@ -58,6 +58,17 @@ describe Sandbox do
|
|
58
58
|
subject.eval(%{FileUtils.cp("/bar.txt", "/baz.txt")})
|
59
59
|
}.to_not raise_error(Sandbox::SandboxException, /NoMethodError/)
|
60
60
|
end
|
61
|
+
|
62
|
+
|
63
|
+
it "should have an empty ENV" do
|
64
|
+
subject.eval(%{ENV.to_a}).should_not be_empty
|
65
|
+
|
66
|
+
subject.activate!
|
67
|
+
|
68
|
+
expect{
|
69
|
+
subject.eval(%{ENV.to_a})
|
70
|
+
}.to raise_error(Sandbox::SandboxException, /NameError: uninitialized constant ENV/)
|
71
|
+
end
|
61
72
|
end
|
62
73
|
|
63
74
|
describe ".current" do
|
@@ -137,12 +148,6 @@ describe Sandbox do
|
|
137
148
|
subject.eval(operations).should == "foo"
|
138
149
|
end
|
139
150
|
|
140
|
-
# it "should have an empty ENV" do
|
141
|
-
# pending do
|
142
|
-
# subject.eval(%{ENV.to_a}).should be_empty
|
143
|
-
# end
|
144
|
-
# end
|
145
|
-
|
146
151
|
it "should persist state between evaluations" do
|
147
152
|
subject.eval(%|o = Object.new|)
|
148
153
|
subject.eval(%|o|).should_not be_nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xplenty-jruby_sandbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Dray Lacy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-07-
|
13
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fakefs
|