press 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/press.rb +4 -0
- data/lib/press/printer.rb +9 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/press.rb
CHANGED
data/lib/press/printer.rb
CHANGED
@@ -3,6 +3,14 @@ require "time"
|
|
3
3
|
module Press
|
4
4
|
module Printer
|
5
5
|
|
6
|
+
def self.ctx
|
7
|
+
@ctx ||= {}
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.ctx=(data)
|
11
|
+
@ctx = data
|
12
|
+
end
|
13
|
+
|
6
14
|
def self.pd(*data, &blk)
|
7
15
|
write $stdout, hashify(*data, {}), &blk
|
8
16
|
end
|
@@ -20,7 +28,7 @@ module Press
|
|
20
28
|
end
|
21
29
|
|
22
30
|
def self.hashify(*data, initial)
|
23
|
-
data.compact.reduce(initial) { |d, v| d.merge v }
|
31
|
+
data.compact.reduce(ctx.merge(initial)) { |d, v| d.merge v }
|
24
32
|
end
|
25
33
|
|
26
34
|
def self.stringify(data)
|
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.
|
4
|
+
version: '0.5'
|
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-
|
12
|
+
date: 2012-05-31 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Data and exception printer.
|
15
15
|
email: mark.fine@gmail.com
|