pretty_debug 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pretty_debug.rb +8 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d53d26ecca768dfa1ec3491f40d53af195d39af1
|
4
|
+
data.tar.gz: 24003df6fe979c82f03bfcdd5d1b0673014a7d10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b194e5322fba3c535932cbce868452686a7c25c3f7cc9603ddf8a000477deecaa7541dca206183e5cf6d72db718ae05c3066d500b3cc88d2fcfece4afcda7df
|
7
|
+
data.tar.gz: 838f36dc3a6f6db069cde81dac3a885d4e321a1f1eddc4a336def7f547b9bc84ade347d3b74068f74ac69d3ee931fd62d1a4692e265950046d6e8b455a0e8b59
|
data/lib/pretty_debug.rb
CHANGED
@@ -66,7 +66,7 @@ module Kernel
|
|
66
66
|
def class_check v, klass, &pr
|
67
67
|
unless v.kind_of?(klass)
|
68
68
|
ArgumentError.raise(
|
69
|
-
"#{pr.call + " " if pr}should be #{klass.expand} but is #{v.expand}")
|
69
|
+
"#{pr.call + " " if pr}should be #{klass.expand} instance but is #{v.expand}")
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
@@ -104,8 +104,6 @@ module Kernel
|
|
104
104
|
yield
|
105
105
|
$VERBOSE = original_verbose
|
106
106
|
end
|
107
|
-
ErrorMsgProcess = Mutex.new
|
108
|
-
def log h; ErrorMsgProcess.synchronize{puts(h.ltsv)} end
|
109
107
|
alias old_raise :raise unless defined?(old_raise)
|
110
108
|
def raise *args
|
111
109
|
old_raise *args
|
@@ -261,6 +259,13 @@ class Object
|
|
261
259
|
(pr ? pr.call(x) : x).inspect.verbatim.unchomp
|
262
260
|
end
|
263
261
|
end
|
262
|
+
end
|
263
|
+
|
264
|
+
#############################################
|
265
|
+
# Terminal
|
266
|
+
#############################################
|
267
|
+
|
268
|
+
class Object
|
264
269
|
def expand; inspect.verbatim end
|
265
270
|
end
|
266
271
|
|
@@ -279,14 +284,3 @@ class String
|
|
279
284
|
private
|
280
285
|
def vt100 s = "".freeze; "\e[#{s}m" end
|
281
286
|
end
|
282
|
-
|
283
|
-
#############################################
|
284
|
-
# LTSV
|
285
|
-
#############################################
|
286
|
-
|
287
|
-
class Hash
|
288
|
-
def ltsv; map{|k, v| "#{k}:#{v.to_s.tr("\t".freeze, " ".freeze)}"}.join("\t".freeze) end
|
289
|
-
end
|
290
|
-
class String
|
291
|
-
def parse_ltsv; Hash[chomp.split("\t".freeze).map{|f| f.split(":".freeze, 2)}] end
|
292
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_debug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email: []
|