xprint 0.7.9 → 0.8.1

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 +9 -6
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a2df6a9e5eeff509346a2faa00414a4aa87a6abb1ea6bd426edeb9f9050bda2
4
- data.tar.gz: b6cac4edf725cf6cadf55262a013fb63d8f2dd0b4e9d7cf77d0eeef34a33854a
3
+ metadata.gz: d8e6e0778467e8ed1efb112fc5a6fb7ee2e5463e1338dbffaf73aeeb61a75d0f
4
+ data.tar.gz: 43fef229c2551c8791d0b009cac768524fdb929a014701f16ed360981a014a7d
5
5
  SHA512:
6
- metadata.gz: e5e8257c53b8577455262226b7cd69ae599c53ee82e63ae031e8124bdeb8bf557a11cbce4d8f43a17b791843a0ae0df0f2982512e7daf56e7c3c4db05a73ae49
7
- data.tar.gz: bf0d3df1881063303b08024197ce55313573de893f339f65fd17d5dc24033953a2f963d54d2a0915579ea7e8d289a36db03b5bc07dc17dbcb5efad2d06d301f6
6
+ metadata.gz: 301cc656d0b4d0e62c6cf0c13486866b4249e7668700f11bcd9e58d2c4a28cac9a033b9ed3de430f64afde2ccb46f008a46e232f4ef5ca943e5371d9b17ecde9
7
+ data.tar.gz: 3ef89b719424f34e220ffc9aa77d4591dddb19fc695a64c257144fe3d1bf068b3569c8896b70ff85048a6fad0a4e4bcb6f722cd0af4c541259091228ff229c19
@@ -1,3 +1,3 @@
1
1
  module XPrint
2
- VERSION = '0.7.9'
2
+ VERSION = '0.8.1'
3
3
  end
@@ -4,7 +4,7 @@ require 'date'
4
4
  module XPrint
5
5
  @data_classes = [
6
6
  String, Integer, Float, TrueClass, FalseClass, NilClass,
7
- Symbol
7
+ Symbol, Date, Time, DateTime, BigDecimal, Rational
8
8
  ]
9
9
  @hash_name_classes = @data_classes + [Proc]
10
10
  @tab = "\t"
@@ -26,10 +26,12 @@ module XPrint
26
26
  float: :cyan,
27
27
  index: :darkgrey,
28
28
  integer: :cyan,
29
+ module: :green,
29
30
  nil: :darkpurple,
30
31
  proc: :darkyellow,
31
32
  rational: :darkcyan,
32
33
  string: :yellow,
34
+ struct: :green,
33
35
  symbol: :darkblue,
34
36
  time: :darkblue,
35
37
  true: :darkgreen
@@ -257,8 +259,8 @@ module XPrint
257
259
 
258
260
  # X is a Structure; essentially a special case of X being an object.
259
261
  elsif x.is_a? Struct
260
- struct_word = colorize('Struct', :classname)
261
- classname = colorize(x.class, :classname)
262
+ struct_word = colorize('Struct', :struct)
263
+ classname = colorize(x.class, :struct)
262
264
  result = "#{struct_word} #{classname}#{@braces ? '(' : ''}\n"
263
265
  longest_item = x.members.map { |m| m.to_s.length }.max()
264
266
 
@@ -275,8 +277,9 @@ module XPrint
275
277
 
276
278
  # X is any arbitrary object; print all instance variables.
277
279
  else
278
- classname = x.class == Module ? "Module #{x}" : x.class
279
- classname = colorize(classname, :classname)
280
+ is_module = x.class == Module
281
+ classname = is_module ? "Module #{x}" : x.class
282
+ classname = colorize(classname, is_module ? :module : :classname)
280
283
  result = "#{classname}#{@braces ? '(' : ''}"
281
284
  ivars = x.instance_variables
282
285
  result += "\n" if ivars.length > 0
@@ -307,4 +310,4 @@ end
307
310
 
308
311
  def xpand(item, tab: "\t")
309
312
  XPrint::xpand(item, tab: tab)
310
- end
313
+ end
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.7.9
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JCabr