sandrbox 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -2
- data/Sandrbox.gemspec +1 -1
- data/VERSION +1 -1
- data/lib/sandrbox/value.rb +6 -2
- metadata +2 -2
data/README.markdown
CHANGED
@@ -10,8 +10,8 @@ I automatically remove all the bad methods and classes I can think of. But maybe
|
|
10
10
|
|
11
11
|
```ruby
|
12
12
|
Sandrbox.configure do |config|
|
13
|
-
config.
|
14
|
-
config.
|
13
|
+
config.bad_constants << :Rails
|
14
|
+
config.bad_constants << :ActiveRecord
|
15
15
|
end
|
16
16
|
```
|
17
17
|
|
data/Sandrbox.gemspec
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/lib/sandrbox/value.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Sandrbox
|
2
2
|
class Value
|
3
|
-
attr_accessor :line, :line_no, :result, :time, :unbound_methods, :unbound_constants
|
3
|
+
attr_accessor :line, :line_no, :result, :time, :unbound_methods, :unbound_constants, :error
|
4
4
|
|
5
5
|
def initialize(line, line_no)
|
6
6
|
self.unbound_methods = []
|
@@ -21,6 +21,7 @@ module Sandrbox
|
|
21
21
|
end
|
22
22
|
rescue Exception => e
|
23
23
|
self.result = "#{e.class}: #{e.to_s}"
|
24
|
+
self.error = true
|
24
25
|
ensure
|
25
26
|
restore_constants
|
26
27
|
restore_methods
|
@@ -28,7 +29,10 @@ module Sandrbox
|
|
28
29
|
end
|
29
30
|
|
30
31
|
timeout = t.join(3)
|
31
|
-
|
32
|
+
if timeout.nil?
|
33
|
+
self.result = "SandrboxError: execution expired"
|
34
|
+
self.error = true
|
35
|
+
end
|
32
36
|
|
33
37
|
self
|
34
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sandrbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
segments:
|
183
183
|
- 0
|
184
|
-
hash:
|
184
|
+
hash: 401916456025782568
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
186
|
none: false
|
187
187
|
requirements:
|