cute-hex 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55c4ec793ac6ff560cc76f4b17c0d98ec63f1aa2
4
- data.tar.gz: 3414cc18b608d3dfd6d6830a78bab967470ca181
3
+ metadata.gz: 069d925cce5b94292d5c883b4ba92449e663f11e
4
+ data.tar.gz: e928301b22bc46b79780d664091320a7a4f21cfc
5
5
  SHA512:
6
- metadata.gz: 53d10b62ac0348b5c497e7b57c2b746ccfefd0266afe0692f5815e63871830a04c7ad541595281202ee2d70ce05322e3d51fac6c9ecd7ed4780810a1967828ba
7
- data.tar.gz: 01af1b0687e8f48ef05640d8eb7dc82acae64ef17bbabff21059cfa642fb53b1e3ff9d55eecc84fe2e4b0c162a24158fc1633966f39187e0a9a8abf1159fffd1
6
+ metadata.gz: c99fd19ba0ff5d0197b103d1df697ec2666d9bc3d9b66ee0697dd6ea0c53189af06aeadc911130ff2a7c3cf431316388dd425d1ca7065151dd030132dde91bc8
7
+ data.tar.gz: 2b1b013b2597ec4d81dcb0a9f92c0f7ac1f28df5be04a0dfe5b41d7a5ac860c029800eaf7ea6573d1b0ac108debbcc73fa34ed008e2fce2f6c9d0b2ad1dadb6a
data/README.md CHANGED
@@ -10,7 +10,9 @@ a = 0xbeef
10
10
 
11
11
  # Basic usage
12
12
  CuteHex.x a # [0000 BEEF]
13
+ CuteHex.x nil # [???? ????]
13
14
  CuteHex.x a, style: :data # 00 00 BE EF
15
+ CuteHex.x nil, style: :data # ?? ?? ?? ??
14
16
 
15
17
  # Adjust word size
16
18
  CuteHex.x a, word_size: 64 # [0000 0000 0000 BEEF]
@@ -23,6 +25,7 @@ CuteHex.x a, word_size: 64, slicer: :word, style: :data # 000000000000BEEF
23
25
 
24
26
  # Remove trailing zeros, only work with :data style
25
27
  CuteHex.x a, style: :data, pad_zeros: false # BE EF
28
+ CuteHex.x nil, style: :data, pad_zeros: false # ?? ?? ?? ??
26
29
  ```
27
30
 
28
31
  Overriding default configuration
@@ -34,12 +34,12 @@ private
34
34
  else word_size / 4
35
35
  end
36
36
 
37
- s = sprintf(format, _x).split('')
37
+ s = (_x ? sprintf(format, _x) : '?' * (word_size / 4)).split('')
38
38
  output = s.each_slice(slice_by).map{ |x| x.join }.join(' ')
39
39
 
40
40
  if @@config.debug_mode
41
41
  p "Format: #{format}"
42
- p "Sliced: #{s}"
42
+ p "Sliced: #{s} (#{_slicer} | #{slice_by})"
43
43
  p "Output: #{output}"
44
44
  end
45
45
 
@@ -1,3 +1,3 @@
1
1
  module CuteHex
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cute-hex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gloria Budiman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport