boca-golf 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,7 @@ class BocaGolf
48
48
  proxy.module_eval <<-end_code, __FILE__, (__LINE__ + 1)
49
49
  def #{method}(*args, &block)
50
50
  lambda do
51
- $SAFE = 4
51
+ $SAFE = 4 if $SAFE < 4
52
52
  super(*args, &block)
53
53
  end.call
54
54
  end
@@ -1,3 +1,3 @@
1
1
  class BocaGolf
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/spec/gist_spec.rb CHANGED
@@ -28,6 +28,18 @@ describe BocaGolf::Gist do
28
28
 
29
29
  lambda { o.foo }.should raise_error(SecurityError)
30
30
  end
31
+
32
+ it "allows recursion in solutions" do
33
+ o = Object.new.tap do |o|
34
+ o.extend BocaGolf::Gist.new(%{
35
+ def foo(n)
36
+ n > 0 ? foo(n - 1) : :done
37
+ end
38
+ }).safe_module
39
+ end
40
+
41
+ o.foo(1).should == :done
42
+ end
31
43
  end
32
44
 
33
45
  describe "load_from_url" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Vollbracht
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-11 00:00:00 -05:00
17
+ date: 2011-02-08 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency