schmurfy-bacon 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -81,6 +81,28 @@ module Bacon
81
81
  end
82
82
  end
83
83
 
84
+ def self.store_error(e, description)
85
+ ErrorLog << "#{e.class}: #{e.message}\n"
86
+
87
+ backtrace = e.backtrace.find_all { |line| line !~ /bin\/bacon|\/bacon\.rb:\d+/ && line !~ /guard|fsevent|thor/ }
88
+ backtrace = backtrace[0, Bacon.backtrace_size] if Bacon.backtrace_size
89
+
90
+ backtrace.each_with_index do |line, i|
91
+ ErrorLog << " #{line}#{i==0 ? ": #@name - #{description}" : ""}\n"
92
+ end
93
+
94
+ ErrorLog << "\n"
95
+
96
+ if e.kind_of? Error
97
+ Counter[e.count_as] += 1
98
+ e.count_as.to_s.upcase
99
+ [:failed]
100
+ else
101
+ Counter[:errors] += 1
102
+ [:error, e]
103
+ end
104
+ end
105
+
84
106
  module ContextAssertions
85
107
  def execute_spec(&block)
86
108
  block.call
@@ -113,25 +135,7 @@ module Bacon
113
135
  end
114
136
  end
115
137
  rescue Object => e
116
- ErrorLog << "#{e.class}: #{e.message}\n"
117
-
118
- backtrace = e.backtrace.find_all { |line| line !~ /bin\/bacon|\/bacon\.rb:\d+/ && line !~ /guard|fsevent|thor/ }
119
- backtrace = backtrace[0, Bacon.backtrace_size] if Bacon.backtrace_size
120
-
121
- backtrace.each_with_index do |line, i|
122
- ErrorLog << " #{line}#{i==0 ? ": #@name - #{description}" : ""}\n"
123
- end
124
-
125
- ErrorLog << "\n"
126
-
127
- if e.kind_of? Error
128
- Counter[e.count_as] += 1
129
- e.count_as.to_s.upcase
130
- [:failed]
131
- else
132
- Counter[:errors] += 1
133
- [:error, e]
134
- end
138
+ Bacon.store_error(e, description)
135
139
  else
136
140
  ""
137
141
  ensure
@@ -47,6 +47,9 @@ module Bacon
47
47
  super
48
48
  else
49
49
  EM::run do
50
+ EM::error_handler do |err|
51
+ ::Bacon::store_error(err, "(EM Loop)")
52
+ end
50
53
 
51
54
  EMSpec.context_fiber = Fiber.new do
52
55
  begin
@@ -1,3 +1,3 @@
1
1
  module Bacon
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
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.4.0
4
+ version: 1.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-18 00:00:00.000000000 Z
12
+ date: 2012-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: term-ansicolor
@@ -84,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  segments:
86
86
  - 0
87
- hash: -3016209986274602744
87
+ hash: 4527591756316638354
88
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
@@ -93,10 +93,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: -3016209986274602744
96
+ hash: 4527591756316638354
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 1.8.22
99
+ rubygems_version: 1.8.24
100
100
  signing_key:
101
101
  specification_version: 3
102
102
  summary: a small RSpec clone