clockwork 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/clockwork.rb +13 -0
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Wiggins