xprint 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/version.rb +1 -1
  3. data/lib/xprint.rb +12 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 990179163a84db36aa76ba3ba878bb21641efbb5720823cc635d37b61a95721b
4
- data.tar.gz: 513f72918e49b0ff51aecf7181ab4b2a2e288d01d791a6c67b951abbe40fdcdc
3
+ metadata.gz: 2be8f204460b6491697acbaf5330c863f18f2e912122cc208a772a1fdfb28098
4
+ data.tar.gz: 6a0c9623de984721f74f890f73a4b5039b7c75b7249c346da5fb293a52c5b72d
5
5
  SHA512:
6
- metadata.gz: c8087e594b361566fe9375e6c77296474a40b5454d24bf7b5e139640f2c033e71d2b9555fadcdac9e1843d5436aaa14b0b928247bd0ffba343994a8a4ff2f903
7
- data.tar.gz: d4435f361143d2d9c5660f634256b6eb7444261b40bfd00337699bd6a9370b3f4c93d9581167083dfab0ddd99b62d93866c5461b3ef66830fad358cd8819c56f
6
+ metadata.gz: 52f41f9883f320b7b3dfd281bc37ad439cb69f8a41939a09c057f1635970f3048733b8019e4840a5c17523735caab0d8437fcfb070dd31a0c05114b50e138ace
7
+ data.tar.gz: 6f7e1cb37ac8894cc2123ef9ffa1212f97b663ba3c9098605a0cc1c1c8e93bf1bd95a7b8e6a462f7dc77e8071e6b77fc100c8321ea014e035fabc6d1f403a4d7
@@ -1,3 +1,3 @@
1
1
  module XPrint
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
@@ -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('\\', '/').split('/')[-2..-1].join('/')
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 ->{}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JCabr