rex-text 0.2.36 → 0.2.39

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: ed5e7201007a3c09cec5c931c006e00de6d55b0c76f602b7641c25b02c8d6a14
4
- data.tar.gz: 445ecf81d92555096f960255bb8a424153f113735d88c02aec6fbaa3508dd250
3
+ metadata.gz: 6bffdfea7c55e2707e258f7d6dd3dc9afbfe55d798c2c61aa85765d069a98121
4
+ data.tar.gz: '09908c92febd56164687e8c472bc6aa8e3f4059a5ea28fcb847e48fe89b712ba'
5
5
  SHA512:
6
- metadata.gz: 9bb526a85fbeeef3a3afd1b1d9b26f3ab5025f27415b13528d96e9bdb61e0362e13f5939fa41b5c9882c118d490d0ca4f7c3c0bd9c56a2e129c7fde0f2c92620
7
- data.tar.gz: 9ceb7ea946a1d2156614116c7f5b6d57f0529c464f1432e04c840f242e376f64b8c16c2807e7a9e2b7d45e0395ef1660c1d5c849676e72e83f1d03b0c8b4b81f
6
+ metadata.gz: b3b7064a20270a251ae0a1f86581c42f9fa9ba96ca231e790545713cf34420492a975c84279b5da7f3f01c20a0889cbad4940b16e2442d0145a3838189d7504c
7
+ data.tar.gz: 7629d0abf3b69bab460a9d3063d347155a36d2c50ea2b9e9e1baa27db189419e330c3de7de5ef8a00d4e2c743bffc9b4f2b99f508c527ce67f7bb29f17f70ce7
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-16.04
29
+ runs-on: ${{ matrix.os }}
14
30
  timeout-minutes: 40
15
31
 
16
32
  strategy:
@@ -18,36 +34,30 @@ jobs:
18
34
  matrix:
19
35
  ruby:
20
36
  - 2.7
37
+ - 3.0
38
+ - 3.1
39
+ os:
40
+ - ubuntu-18.04
41
+ - ubuntu-22.04
42
+ exclude:
43
+ - { os: ubuntu-22.04, ruby: 2.7 }
44
+ - { os: ubuntu-22.04, 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
31
55
 
32
- - uses: actions/setup-ruby@v1
56
+ - name: Setup Ruby
57
+ uses: ruby/setup-ruby@v1
33
58
  with:
34
59
  ruby-version: ${{ matrix.ruby }}
35
-
36
- - name: Setup bundler
37
- run: |
38
- gem install bundler
39
-
40
- - uses: actions/cache@v2
41
- with:
42
- path: vendor/bundle
43
- key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
44
- restore-keys: |
45
- ${{ runner.os }}-gems-
46
-
47
- - name: Bundle install
48
- run: |
49
- bundle config path vendor/bundle
50
- bundle install --jobs 4 --retry 3
60
+ bundler-cache: true
51
61
 
52
62
  - name: ${{ matrix.test_cmd }}
53
63
  run: |
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.2.36"
3
+ VERSION = "0.2.39"
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.36
4
+ version: 0.2.39
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-08-13 00:00:00.000000000 Z
96
+ date: 2022-08-08 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file