press 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/press/printer.rb +10 -5
  2. metadata +2 -2
@@ -24,11 +24,11 @@ module Press
24
24
  end
25
25
 
26
26
  def self.pdfme(file, m, e, *data)
27
- write $stderr, hashify(*data, file: File.basename(file, ".rb"), fn: m, at: "error", class: e.class, message: e.message)
27
+ write $stderr, hashify(*data, at: "error", class: e.class, message: e.message, file: File.basename(file, ".rb"), fn: m)
28
28
  end
29
29
 
30
30
  def self.hashify(*data, initial)
31
- data.compact.reduce(ctx.merge(initial)) { |d, v| d.merge v }
31
+ data.compact.reduce(initial.merge(ctx)) { |d, v| d.merge v }
32
32
  end
33
33
 
34
34
  def self.stringify(data)
@@ -57,9 +57,14 @@ module Press
57
57
  file.flush
58
58
  else
59
59
  start = Time.now
60
- write file, data.merge(at: "start")
61
- result = yield
62
- write file, data.merge(at: "finish", elapsed: Time.now - start)
60
+ write file, { at: "start" }.merge(data)
61
+ begin
62
+ result = yield
63
+ rescue => e
64
+ pde e, data
65
+ raise
66
+ end
67
+ write file, { at: "finish", elapsed: Time.now - start }.merge(data)
63
68
  result
64
69
  end
65
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: press
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
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-31 00:00:00.000000000Z
12
+ date: 2012-06-04 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Data and exception printer.
15
15
  email: mark.fine@gmail.com