schmurfy-bacon 1.3.4 → 1.3.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.
- data/lib/bacon/ext/em.rb +29 -9
- data/lib/bacon/version.rb +1 -1
- data/lib/output/better_output.rb +1 -0
- metadata +12 -7
data/lib/bacon/ext/em.rb
CHANGED
@@ -11,11 +11,25 @@ require 'eventmachine'
|
|
11
11
|
#
|
12
12
|
module Bacon
|
13
13
|
module EMSpec # :nodoc:
|
14
|
-
|
14
|
+
class << self
|
15
|
+
attr_accessor :context_fiber
|
16
|
+
end
|
17
|
+
|
18
|
+
def wakeup
|
19
|
+
# this should be enough but for some reason the reactor
|
20
|
+
# idles for 20 seconds on EM::stop before really exiting
|
21
|
+
# @waiting_fiber.resume
|
22
|
+
|
23
|
+
if @waiting_fiber
|
24
|
+
EM::next_tick { @waiting_fiber.resume }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
15
28
|
def wait(timeout = 0.1, &block)
|
16
29
|
@waiting_fiber = Fiber.current
|
17
30
|
EM::cancel_timer(@timeout)
|
18
|
-
|
31
|
+
EM::add_timer(timeout, &method(:wakeup))
|
32
|
+
|
19
33
|
Fiber.yield
|
20
34
|
|
21
35
|
@waiting_fiber = nil
|
@@ -25,19 +39,25 @@ module Bacon
|
|
25
39
|
|
26
40
|
def done
|
27
41
|
EM.cancel_timer(@timeout)
|
28
|
-
|
42
|
+
wakeup
|
29
43
|
end
|
30
44
|
|
31
45
|
def run(*)
|
32
|
-
|
33
|
-
if subcontext
|
46
|
+
if EMSpec.context_fiber == Fiber.current
|
34
47
|
super
|
35
48
|
else
|
36
49
|
EM::run do
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
50
|
+
|
51
|
+
EMSpec.context_fiber = Fiber.new do
|
52
|
+
begin
|
53
|
+
super
|
54
|
+
EM::stop_event_loop
|
55
|
+
ensure
|
56
|
+
EMSpec.context_fiber = nil
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
EMSpec.context_fiber.resume
|
41
61
|
end
|
42
62
|
|
43
63
|
end
|
data/lib/bacon/version.rb
CHANGED
data/lib/output/better_output.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schmurfy-bacon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: term-ansicolor
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,12 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
description: ! 'Bacon is a small RSpec clone weighing less than 350 LoC but
|
26
31
|
|
27
32
|
nevertheless providing all essential features.
|
@@ -77,7 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
82
|
version: '0'
|
78
83
|
segments:
|
79
84
|
- 0
|
80
|
-
hash:
|
85
|
+
hash: 2049935721437851805
|
81
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
87
|
none: false
|
83
88
|
requirements:
|
@@ -86,10 +91,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
91
|
version: '0'
|
87
92
|
segments:
|
88
93
|
- 0
|
89
|
-
hash:
|
94
|
+
hash: 2049935721437851805
|
90
95
|
requirements: []
|
91
96
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.8.
|
97
|
+
rubygems_version: 1.8.22
|
93
98
|
signing_key:
|
94
99
|
specification_version: 3
|
95
100
|
summary: a small RSpec clone
|