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 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.bad_classes << [:Rails]
14
- config.bad_classes << [:ActiveRecord]
13
+ config.bad_constants << :Rails
14
+ config.bad_constants << :ActiveRecord
15
15
  end
16
16
  ```
17
17
 
data/Sandrbox.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sandrbox"
8
- s.version = "0.0.2"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Symonds"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.1.0
@@ -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
- self.result = "SandrboxError: execution expired" if timeout.nil?
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.2
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: 928819448596422268
184
+ hash: 401916456025782568
185
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  none: false
187
187
  requirements: