rex-text 0.2.37 → 0.2.38

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
  SHA256:
3
- metadata.gz: 7b3c8a4e9870f41cc0c8b6dbb175ab5eb56b9fc188a3cbe2be85ebcf05bd8945
4
- data.tar.gz: 5f23d20961036a7886e15b432b332c72ee014837687040cab44b368ee9eac0ff
3
+ metadata.gz: bf931b9b53daa1391f3410fa721235e01375a64f8e7d06919af5f6e69f30b5c0
4
+ data.tar.gz: ca35cab4eeefe5ef8df4d17cfae63c5c58047b5a56daf402dcff34ce378d923c
5
5
  SHA512:
6
- metadata.gz: eb340466122a0875e63c7da7da642892c14b4c9880fc68c167aefd4c49a0617d6c4a3cf39a4ca97d3e60748bc6de19ca0c66976c9b7701a7768dfedf3f5454a2
7
- data.tar.gz: a6b14508fa0e30c49c1afd10b170fe9fce99e9112a3dda3073557ffb99abe1ff7d9c467e992dbc4881cba4fba35fe53509b40fc44563119f756c496f2ad91460
6
+ metadata.gz: eea968a9e08f2f54b666ce99e0cd8767541eb9560d6c2d6f5cee01d005c1c92f72772be0ae9a4807bc1ec82e526d903f1f79df82108c9f742b5269a3d0516489
7
+ data.tar.gz: 78ac55937b82a2ef55fc4e926b6afd4c9726fbefa63c8699e954499da83f54ebc28443caa985d401d93902e1233e9406d332f06e26eddd80cd7320fb9b064caa
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.2.37"
3
+ VERSION = "0.2.38"
4
4
  end
5
5
  end
@@ -183,12 +183,11 @@ class WrappedTable
183
183
  raise RuntimeError, 'Invalid number of columns!'
184
184
  end
185
185
  formatted_fields = fields.map.with_index { |field, idx|
186
- # Remove whitespace and ensure String format
187
- field = format_table_field(field.to_s.strip, idx)
186
+ field = format_table_field(field, idx)
188
187
 
189
- if (colprops[idx]['MaxWidth'] < display_width(field.to_s))
188
+ if (colprops[idx]['MaxWidth'] < display_width(field))
190
189
  old = colprops[idx]['MaxWidth']
191
- colprops[idx]['MaxWidth'] = display_width(field.to_s)
190
+ colprops[idx]['MaxWidth'] = display_width(field)
192
191
  end
193
192
 
194
193
  field
@@ -410,7 +409,7 @@ protected
410
409
  values_as_chunks = values.each_with_index.map do |value, idx|
411
410
  column_width = optimal_widths[idx]
412
411
  value
413
- .split('')
412
+ .chars
414
413
  .each_slice(column_width)
415
414
  .map(&:join)
416
415
  end
@@ -511,13 +510,13 @@ protected
511
510
  end
512
511
 
513
512
  def format_table_field(str, idx)
514
- str_cp = str.dup
513
+ str_cp = str.to_s.encode('UTF-8', invalid: :replace, undef: :replace).strip
515
514
 
516
515
  colprops[idx]['Formatters'].each do |f|
517
516
  str_cp = f.format(str_cp)
518
517
  end
519
518
 
520
- str_cp.dup.force_encoding('UTF-8')
519
+ str_cp
521
520
  end
522
521
 
523
522
  def style_table_field(str, _idx)
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.37
4
+ version: 0.2.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2021-09-16 00:00:00.000000000 Z
96
+ date: 2022-06-29 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file