zipstream 0.1.1 → 0.1.2
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/VERSION +1 -1
- data/lib/zipstream/fiber.rb +5 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/zipstream/fiber.rb
CHANGED
@@ -13,17 +13,17 @@ else
|
|
13
13
|
@body = lambda &block
|
14
14
|
end
|
15
15
|
|
16
|
-
def resume
|
16
|
+
def resume *args
|
17
17
|
@@fibers.push self
|
18
18
|
# jumping into fiber
|
19
|
-
jump
|
19
|
+
jump *args
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.current
|
23
23
|
@@fibers.last
|
24
24
|
end
|
25
25
|
|
26
|
-
def self.yield arg
|
26
|
+
def self.yield arg=nil
|
27
27
|
if fiber = @@fibers.pop
|
28
28
|
# jumping out of fiber
|
29
29
|
fiber.send :jump, arg
|
@@ -32,10 +32,10 @@ else
|
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
-
def jump
|
35
|
+
def jump *args
|
36
36
|
callcc do |continuation|
|
37
37
|
destination, @body = @body, continuation
|
38
|
-
destination.call
|
38
|
+
destination.call *args
|
39
39
|
@@fibers.pop
|
40
40
|
# return from the last 'resume'
|
41
41
|
@body.call
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipstream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70305888673700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 2.7.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70305888673700
|
25
25
|
description:
|
26
26
|
email: sj26@sj26.com
|
27
27
|
executables: []
|