xprint 0.5.1 → 0.5.2
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/version.rb +1 -1
- data/lib/xprint.rb +12 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2be8f204460b6491697acbaf5330c863f18f2e912122cc208a772a1fdfb28098
|
4
|
+
data.tar.gz: 6a0c9623de984721f74f890f73a4b5039b7c75b7249c346da5fb293a52c5b72d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52f41f9883f320b7b3dfd281bc37ad439cb69f8a41939a09c057f1635970f3048733b8019e4840a5c17523735caab0d8437fcfb070dd31a0c05114b50e138ace
|
7
|
+
data.tar.gz: 6f7e1cb37ac8894cc2123ef9ffa1212f97b663ba3c9098605a0cc1c1c8e93bf1bd95a7b8e6a462f7dc77e8071e6b77fc100c8321ea014e035fabc6d1f403a4d7
|
data/lib/version.rb
CHANGED
data/lib/xprint.rb
CHANGED
@@ -6,10 +6,15 @@ module XPrint
|
|
6
6
|
@hash_name_classes = @data_classes + [Proc]
|
7
7
|
@tab = "\t"
|
8
8
|
@show_indexes = true
|
9
|
+
@full_proc_path = false
|
9
10
|
|
10
11
|
def self.set(**kwargs)
|
11
12
|
@tab = kwargs[:tab] unless kwargs[:tab].nil?
|
12
13
|
@show_indexes = kwargs[:show_indexes] unless kwargs[:show_indexes].nil?
|
14
|
+
|
15
|
+
unless @full_proc_path.nil?
|
16
|
+
@full_proc_path = kwargs[:full_proc_path]
|
17
|
+
end
|
13
18
|
end
|
14
19
|
|
15
20
|
def self.tab()
|
@@ -39,7 +44,11 @@ module XPrint
|
|
39
44
|
elsif x.class == Proc
|
40
45
|
type = x.lambda? ? 'Lambda' : 'Proc'
|
41
46
|
source, line = x.source_location
|
42
|
-
source = source.gsub('\\', '/')
|
47
|
+
source = source.gsub('\\', '/')
|
48
|
+
|
49
|
+
unless @full_proc_path
|
50
|
+
source = source.split('/')[-2..-1].join('/')
|
51
|
+
end
|
43
52
|
|
44
53
|
return "<#{type} @ #{source} [Line #{line}]>"
|
45
54
|
# X is an Array, print list of all items.
|
@@ -145,3 +154,5 @@ end
|
|
145
154
|
def xpand(item, tab: "\t")
|
146
155
|
XPrint::xpand(item, tab: tab)
|
147
156
|
end
|
157
|
+
|
158
|
+
xp ->{}
|