wormhole 0.1.0 → 0.1.1

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.
data/ChangeLog CHANGED
@@ -1,4 +1,8 @@
1
+ == 0.1.1 / 2008-07-04
2
+
3
+ * changed API according to the suggestion of @yugui.
4
+
1
5
  == 0.0.1 / 2008-07-02
2
6
 
3
- * initial release
7
+ * initial release.
4
8
 
data/README CHANGED
@@ -19,9 +19,22 @@ depth of stack to outside.
19
19
 
20
20
  == Features/Problems
21
21
 
22
-
23
22
  == Synopsis
24
23
 
24
+ Here is an example of use.
25
+
26
+ require 'rubygems'
27
+ require 'wormhole'
28
+
29
+ def some_method
30
+ Wormhole.throw
31
+ end
32
+
33
+ w = Wormhole.catch do
34
+ some_method
35
+ end
36
+ w.return
37
+
25
38
  == Copyright
26
39
 
27
40
  Author:: takiuchi <genki{at}s21g{dot}com>
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ DESCRIPTION = "The utility library for making a wormhole on the stack fram
18
18
  RUBYFORGE_PROJECT = "cocktail-party"
19
19
  HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
20
20
  BIN_FILES = %w( )
21
- VERS = "0.1.0"
21
+ VERS = "0.1.1"
22
22
 
23
23
  REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
24
24
  CLEAN.include ['**/.*.sw?', '*.gem', '.config']
@@ -27,6 +27,7 @@ private
27
27
  callcc{|@cc|}
28
28
  if @opened
29
29
  @result = block.call @data if block
30
+ @data
30
31
  else
31
32
  Kernel.throw :__wormhole__, self
32
33
  end
@@ -8,9 +8,8 @@ class WormholeTest < Test::Unit::TestCase
8
8
 
9
9
  def foo
10
10
  @result << "foo"
11
- Wormhole.throw :bar => 'hello' do |data|
12
- @result << data[:bar]
13
- end
11
+ data = Wormhole.throw :bar => 'hello'
12
+ @result << data[:bar]
14
13
  @result << "bar"
15
14
  end
16
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wormhole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Takiuchi