clockwork 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/clockwork.rb +13 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/clockwork.rb
CHANGED
@@ -16,6 +16,19 @@ module Clockwork
|
|
16
16
|
def run(t)
|
17
17
|
@block.call
|
18
18
|
@last = t
|
19
|
+
rescue => e
|
20
|
+
STDERR.puts exception_message(e)
|
21
|
+
end
|
22
|
+
|
23
|
+
def exception_message(e)
|
24
|
+
msg = [ "Exception #{e.class} -> #{e.message}" ]
|
25
|
+
|
26
|
+
base = File.expand_path(Dir.pwd) + '/'
|
27
|
+
e.backtrace.each do |t|
|
28
|
+
msg << " #{File.expand_path(t).gsub(/#{base}/, '')}"
|
29
|
+
end
|
30
|
+
|
31
|
+
msg.join("\n")
|
19
32
|
end
|
20
33
|
|
21
34
|
class FailedToParse < RuntimeError; end
|