fibre 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fibre.gemspec +1 -1
- data/lib/fibre/core_ext/fiber.rb +2 -2
- data/lib/fibre/mock.rb +1 -1
- data/lib/fibre/scope.rb +1 -2
- data/lib/fibre/version.rb +1 -1
- data/spec/fibre_spec.rb +11 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78c87ff16a83375685a2a79af98f1d8aeff0d879
|
4
|
+
data.tar.gz: 661d46f5e3e55949e0c9f0b6d8515a68c81ac7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a41f3b41b1c74d0621024c0339f5de1efb27f75921ff60a5835244898b0717e6efb4e91b19b9e76dad4aa6435a1254fb5f6ce191915432d9ecb3e6ce707b13ce
|
7
|
+
data.tar.gz: 1d2b2f41298fdc5dc7b35ba99d2ae488539e5766a693d9c33e0c06f48b420e90fa4f7bb80c4566efc7f91fda2fd39fd555bbb140acfdaba1be26b3a1c1efcf39
|
data/fibre.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.6"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
-
spec.add_development_dependency "rspec", "~> 3
|
26
|
+
spec.add_development_dependency "rspec", "~> 3"
|
27
27
|
|
28
28
|
spec.add_dependency "event_object", "~> 0.9"
|
29
29
|
end
|
data/lib/fibre/core_ext/fiber.rb
CHANGED
@@ -26,11 +26,11 @@ class Fiber
|
|
26
26
|
class <<self
|
27
27
|
|
28
28
|
def scope(*a, &b)
|
29
|
-
|
29
|
+
Fibre::Scope.scope(*a, &b)
|
30
30
|
end
|
31
31
|
|
32
32
|
def sync(*a, &b)
|
33
|
-
|
33
|
+
Fibre::Scope.scope? ? Fibre::Scope.sync(*a, &b) : sync_it(*a, &b)
|
34
34
|
end
|
35
35
|
|
36
36
|
# raise exception if we catch exception
|
data/lib/fibre/mock.rb
CHANGED
data/lib/fibre/scope.rb
CHANGED
data/lib/fibre/version.rb
CHANGED
data/spec/fibre_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
|
+
|
2
3
|
describe Fibre do
|
3
4
|
using EventObject
|
4
5
|
|
@@ -18,11 +19,20 @@ describe Fibre do
|
|
18
19
|
Fibre.pool.checkout(&probe)
|
19
20
|
end
|
20
21
|
|
21
|
-
it "rescue error in fiber" do
|
22
|
+
it "should rescue error in fiber" do
|
22
23
|
expect(probe).to receive(:call)
|
23
24
|
Fibre.pool.on(:error, &probe)
|
24
25
|
Fibre.pool.checkout do
|
25
26
|
raise
|
26
27
|
end
|
27
28
|
end
|
29
|
+
|
30
|
+
it "should scope" do
|
31
|
+
expect(probe).to receive(:call)
|
32
|
+
Fibre.pool.checkout do
|
33
|
+
Fiber.scope do
|
34
|
+
probe.call
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
28
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fibre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- che
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3
|
47
|
+
version: '3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3
|
54
|
+
version: '3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: event_object
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|