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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fabc7b72080a5a72b9c4f02e298546228dfebca
4
- data.tar.gz: ffb6409b8cb5e104792c007ea293ec28c20bbc5b
3
+ metadata.gz: 78c87ff16a83375685a2a79af98f1d8aeff0d879
4
+ data.tar.gz: 661d46f5e3e55949e0c9f0b6d8515a68c81ac7c8
5
5
  SHA512:
6
- metadata.gz: 6a47d2f626884a4efcd6a589e9d255b3305432884a044239e8c08b531773299fa0e20e2d92ae4945d2a2c4b723128da94ae386f4b1baff8147e99197bc923c98
7
- data.tar.gz: db6e15c5b1f7882db1b0212d2fb5e5b1c39a6f32513394ead72cf17670c142999ae5e0e67dff9fd0a81982337676a71cec1268d4a5079d7bafd2264911a44f3e
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.0.0"
26
+ spec.add_development_dependency "rspec", "~> 3"
27
27
 
28
28
  spec.add_dependency "event_object", "~> 0.9"
29
29
  end
@@ -26,11 +26,11 @@ class Fiber
26
26
  class <<self
27
27
 
28
28
  def scope(*a, &b)
29
- Fiber::Scope.scope(*a, &b)
29
+ Fibre::Scope.scope(*a, &b)
30
30
  end
31
31
 
32
32
  def sync(*a, &b)
33
- Fiber::Scope.scope? ? Fiber::Scope.sync(*a, &b) : sync_it(*a, &b)
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
@@ -1,4 +1,4 @@
1
- class Fiber
1
+ module Fibre
2
2
  class Mock
3
3
  attr_reader :scope
4
4
  attr_reader :result
data/lib/fibre/scope.rb CHANGED
@@ -1,4 +1,4 @@
1
- class Fiber
1
+ module Fibre
2
2
  class Scope
3
3
  attr_accessor :mocks
4
4
  attr_accessor :fiber
@@ -36,7 +36,6 @@ class Fiber
36
36
  fiber.resume if @mocks.all?(&:completed?)
37
37
  end
38
38
 
39
-
40
39
  module Iterator
41
40
  def sync
42
41
  res = Fiber.scope do
data/lib/fibre/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fibre
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
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.0
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-08-13 00:00:00.000000000 Z
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.0.0
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.0.0
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: event_object
57
57
  requirement: !ruby/object:Gem::Requirement