rex-text 0.2.37 → 0.2.40

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b3c8a4e9870f41cc0c8b6dbb175ab5eb56b9fc188a3cbe2be85ebcf05bd8945
4
- data.tar.gz: 5f23d20961036a7886e15b432b332c72ee014837687040cab44b368ee9eac0ff
3
+ metadata.gz: 6aa8880ab44795dde36fab9173dcfbbe2f2ad0afecb1574dad0620d57f3b7d70
4
+ data.tar.gz: 404c7abc28c4cde12fe46a1de4a3ceff55b96faf1734d3d913690977e4895f5a
5
5
  SHA512:
6
- metadata.gz: eb340466122a0875e63c7da7da642892c14b4c9880fc68c167aefd4c49a0617d6c4a3cf39a4ca97d3e60748bc6de19ca0c66976c9b7701a7768dfedf3f5454a2
7
- data.tar.gz: a6b14508fa0e30c49c1afd10b170fe9fce99e9112a3dda3073557ffb99abe1ff7d9c467e992dbc4881cba4fba35fe53509b40fc44563119f756c496f2ad91460
6
+ metadata.gz: d3719c96add95b2694c20572562674e1ba5de06ecab52d43e2e7921b71d790acaf197d416326674c3ae276d9fcffb0cc3dc601ea74be6bd2b3cf67d111df7125
7
+ data.tar.gz: 4c114558bae64642e567c73a43ca8462cae5df391a469b9017ef18672238dbf04097ace28b6bad24758836f078a6a99f8d098cc43a330f131487fe5281ad8f93
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,5 +1,21 @@
1
1
  name: Verify
2
2
 
3
+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
4
+ permissions:
5
+ actions: none
6
+ checks: none
7
+ contents: none
8
+ deployments: none
9
+ id-token: none
10
+ issues: none
11
+ discussions: none
12
+ packages: none
13
+ pages: none
14
+ pull-requests: none
15
+ repository-projects: none
16
+ security-events: none
17
+ statuses: none
18
+
3
19
  on:
4
20
  push:
5
21
  branches:
@@ -10,7 +26,7 @@ on:
10
26
 
11
27
  jobs:
12
28
  test:
13
- runs-on: ubuntu-18.04
29
+ runs-on: ${{ matrix.os }}
14
30
  timeout-minutes: 40
15
31
 
16
32
  strategy:
@@ -18,13 +34,21 @@ jobs:
18
34
  matrix:
19
35
  ruby:
20
36
  - 2.7
37
+ - 3.0
38
+ - 3.1
39
+ os:
40
+ - ubuntu-20.04
41
+ - ubuntu-latest
42
+ exclude:
43
+ - { os: ubuntu-latest, ruby: 2.7 }
44
+ - { os: ubuntu-latest, ruby: 3.0 }
21
45
  test_cmd:
22
46
  - bundle exec rspec
23
47
 
24
48
  env:
25
49
  RAILS_ENV: test
26
50
 
27
- name: Ruby ${{ matrix.ruby }} - ${{ matrix.test_cmd }}
51
+ name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }} - ${{ matrix.test_cmd }}
28
52
  steps:
29
53
  - name: Checkout code
30
54
  uses: actions/checkout@v2
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.2.37"
3
+ VERSION = "0.2.40"
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.40
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-08-31 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file