wordlist 1.0.2 → 1.0.3

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: '09442b4fa26d163890845f9ba05bb3620d081ede1aeea4f4681e3292023a329e'
4
- data.tar.gz: d69e26ee74fef00403afdbd2acddbc617398132d75074fe6cf8546704540ce83
3
+ metadata.gz: 1e732c8a8b2aa358e9c21c46fd9b5f509b5aeef52d51477ceb49111f94a4102d
4
+ data.tar.gz: 0cb119f423d984b5538b5547f972a7c6c54e1e96e52e461acf3ba13328e8f4d5
5
5
  SHA512:
6
- metadata.gz: f96fd76cbccdeab025ec9bf7c46946f7d684f91e5e01e7a3c68820b9bcbb1c80ec9e50a8d39fea61cbd5e757a0bfffca8e8e2ab1b435b91327d365efeac0f971
7
- data.tar.gz: a99ea8d51f2e0ffd6b8a5a444870c28bee24698fdce3b44474c1c66acc000ebdba009493b267e68e68d592bd668189e5b77dff971f7e03f08ef7921032071a1c
6
+ metadata.gz: b060a80fafcd2e24a1771537030085d19b70722b8436a62e810b2cc2ab876ac3c132b036d625ae496b2b2c2f18c11a75761b0ab6933878a29207f28cfb1b8a73
7
+ data.tar.gz: edef70fcf4bbcf6ab3d0ff4f78281bd4c1edca5535c057a515f662c5cd0efcae254a492d301d7d583ac622c0177961c3b028c2431d94a95da3d03116579824f1
@@ -4,18 +4,22 @@ on: [ push, pull_request ]
4
4
 
5
5
  jobs:
6
6
  tests:
7
- runs-on: ubuntu-latest
7
+ runs-on: ${{ matrix.os }}
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
+ os:
12
+ - ubuntu-latest
13
+ - macos-latest
11
14
  ruby:
12
15
  - 2.6
13
16
  - 2.7
14
17
  - 3.0
15
18
  - 3.1
19
+ - 3.2
16
20
  - jruby
17
21
  - truffleruby
18
- name: Ruby ${{ matrix.ruby }}
22
+ name: OS ${{ matrix.os }} / Ruby ${{ matrix.ruby }}
19
23
  steps:
20
24
  - uses: actions/checkout@v2
21
25
  - name: Set up Ruby
data/ChangeLog.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 1.0.3 / 2023-08-04
2
+
3
+ * Fix reading of compressed wordlists on macOS.
4
+ * macOS's version of `zcat`, `bzcat`, and `xzcat` do not accept a file path
5
+ argument, but instead require the compressed input be piped or redirected
6
+ into them (ex: `zcat < path/to/file.gz`).
7
+
1
8
  ### 1.0.2 / 2023-07-18
2
9
 
3
10
  #### CLI
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2021 Hal Brodigan
1
+ Copyright (c) 2009-2023 Hal Brodigan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -332,6 +332,6 @@ Wordlist::File#mutate_case (N=1000) 24.178521 0.000000 24.178521 ( 24.2
332
332
 
333
333
  ## License
334
334
 
335
- Copyright (c) 2009-2021 Hal Brodigan
335
+ Copyright (c) 2009-2023 Hal Brodigan
336
336
 
337
337
  See {file:LICENSE.txt} for details.
@@ -37,7 +37,7 @@ module Wordlist
37
37
  raise(UnknownFormat,"unsupported format: #{format.inspect}")
38
38
  end
39
39
 
40
- Shellwords.shelljoin([command, path])
40
+ "#{command} < #{Shellwords.shellescape(path)}"
41
41
  end
42
42
 
43
43
  #
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Wordlist
4
4
  # wordlist version
5
- VERSION = '1.0.2'
5
+ VERSION = '1.0.3'
6
6
  end
@@ -8,15 +8,15 @@ describe Wordlist::Compression::Reader do
8
8
  context "when given format: :gzip" do
9
9
  subject { described_class.command(path, format: :gzip) }
10
10
 
11
- it "must return 'zcat path/to/file'" do
12
- expect(subject).to eq("zcat #{path}")
11
+ it "must return 'zcat < path/to/file'" do
12
+ expect(subject).to eq("zcat < #{path}")
13
13
  end
14
14
 
15
15
  context "and the file contains special characters" do
16
16
  let(:path) { 'path/to/the file' }
17
17
 
18
18
  it "must shellescape them" do
19
- expect(subject).to eq("zcat #{Shellwords.shellescape(path)}")
19
+ expect(subject).to eq("zcat < #{Shellwords.shellescape(path)}")
20
20
  end
21
21
  end
22
22
  end
@@ -24,15 +24,15 @@ describe Wordlist::Compression::Reader do
24
24
  context "when given format: :bzip2" do
25
25
  subject { described_class.command(path, format: :bzip2) }
26
26
 
27
- it "must return 'bzcat path/to/file'" do
28
- expect(subject).to eq("bzcat #{path}")
27
+ it "must return 'bzcat < path/to/file'" do
28
+ expect(subject).to eq("bzcat < #{path}")
29
29
  end
30
30
 
31
31
  context "and the file contains special characters" do
32
32
  let(:path) { 'path/to/the file' }
33
33
 
34
34
  it "must shellescape them" do
35
- expect(subject).to eq("bzcat #{Shellwords.shellescape(path)}")
35
+ expect(subject).to eq("bzcat < #{Shellwords.shellescape(path)}")
36
36
  end
37
37
  end
38
38
  end
@@ -40,15 +40,15 @@ describe Wordlist::Compression::Reader do
40
40
  context "when given format: :xz" do
41
41
  subject { described_class.command(path, format: :xz) }
42
42
 
43
- it "must return 'xzcat path/to/file'" do
44
- expect(subject).to eq("xzcat #{path}")
43
+ it "must return 'xzcat < path/to/file'" do
44
+ expect(subject).to eq("xzcat < #{path}")
45
45
  end
46
46
 
47
47
  context "and the file contains special characters" do
48
48
  let(:path) { 'path/to/the file' }
49
49
 
50
50
  it "must shellescape them" do
51
- expect(subject).to eq("xzcat #{Shellwords.shellescape(path)}")
51
+ expect(subject).to eq("xzcat < #{Shellwords.shellescape(path)}")
52
52
  end
53
53
  end
54
54
  end
@@ -69,7 +69,7 @@ describe Wordlist::Compression::Reader do
69
69
 
70
70
  context "when given format: :gzip" do
71
71
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.gz') }
72
- let(:expected_contents) { `zcat #{Shellwords.shellescape(path)}` }
72
+ let(:expected_contents) { `zcat < #{Shellwords.shellescape(path)}` }
73
73
 
74
74
  subject { described_class.open(path, format: :gzip) }
75
75
 
@@ -86,7 +86,7 @@ describe Wordlist::Compression::Reader do
86
86
 
87
87
  context "when given format: :bzip2" do
88
88
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.bz2') }
89
- let(:expected_contents) { `bzcat #{Shellwords.shellescape(path)}` }
89
+ let(:expected_contents) { `bzcat < #{Shellwords.shellescape(path)}` }
90
90
 
91
91
  subject { described_class.open(path, format: :bzip2) }
92
92
 
@@ -103,7 +103,7 @@ describe Wordlist::Compression::Reader do
103
103
 
104
104
  context "when given format: :xz" do
105
105
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.xz') }
106
- let(:expected_contents) { `xzcat #{Shellwords.shellescape(path)}` }
106
+ let(:expected_contents) { `xzcat < #{Shellwords.shellescape(path)}` }
107
107
 
108
108
  subject { described_class.open(path, format: :xz) }
109
109
 
@@ -120,7 +120,7 @@ describe Wordlist::Compression::Reader do
120
120
 
121
121
  context "when the command is not installed" do
122
122
  let(:format) { :gzip }
123
- let(:command) { Shellwords.shelljoin(['zcat', path]) }
123
+ let(:command) { "zcat < #{Shellwords.shellescape(path)}" }
124
124
  let(:path) { 'path/to/wordlist.gz' }
125
125
 
126
126
  before do
@@ -110,7 +110,7 @@ describe Wordlist::Compression::Writer do
110
110
  subject.close
111
111
  end
112
112
 
113
- let(:written_contents) { `zcat #{Shellwords.shellescape(path)}` }
113
+ let(:written_contents) { `zcat < #{Shellwords.shellescape(path)}` }
114
114
  let(:written_words) { written_contents.lines.map(&:chomp) }
115
115
 
116
116
  it "must writing gzip compressed data to the file" do
@@ -136,7 +136,7 @@ describe Wordlist::Compression::Writer do
136
136
  subject.close
137
137
  end
138
138
 
139
- let(:written_contents) { `bzcat #{Shellwords.shellescape(path)}` }
139
+ let(:written_contents) { `bzcat < #{Shellwords.shellescape(path)}` }
140
140
  let(:written_words) { written_contents.lines.map(&:chomp) }
141
141
 
142
142
  it "must writing bzip2 compressed data to the file" do
@@ -162,7 +162,7 @@ describe Wordlist::Compression::Writer do
162
162
  subject.close
163
163
  end
164
164
 
165
- let(:written_contents) { `xzcat #{Shellwords.shellescape(path)}` }
165
+ let(:written_contents) { `xzcat < #{Shellwords.shellescape(path)}` }
166
166
  let(:written_words) { written_contents.lines.map(&:chomp) }
167
167
 
168
168
  it "must writing xz compressed data to the file" do
data/spec/file_spec.rb CHANGED
@@ -132,7 +132,7 @@ describe Wordlist::File do
132
132
 
133
133
  context "and the wordlist format is gzip" do
134
134
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.gz') }
135
- let(:expected_contents) { `zcat #{Shellwords.shellescape(path)}` }
135
+ let(:expected_contents) { `zcat < #{Shellwords.shellescape(path)}` }
136
136
 
137
137
  it "must read the uncompressed gzip data" do
138
138
  expect { |b|
@@ -143,7 +143,7 @@ describe Wordlist::File do
143
143
 
144
144
  context "and the wordlist format is bzip2" do
145
145
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.bz2') }
146
- let(:expected_contents) { `bzcat #{Shellwords.shellescape(path)}` }
146
+ let(:expected_contents) { `bzcat < #{Shellwords.shellescape(path)}` }
147
147
 
148
148
  it "must read the uncompressed gzip data" do
149
149
  expect { |b|
@@ -154,7 +154,7 @@ describe Wordlist::File do
154
154
 
155
155
  context "and the wordlist format is xz" do
156
156
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.xz') }
157
- let(:expected_contents) { `xzcat #{Shellwords.shellescape(path)}` }
157
+ let(:expected_contents) { `xzcat < #{Shellwords.shellescape(path)}` }
158
158
 
159
159
  it "must read the uncompressed gzip data" do
160
160
  expect { |b|
@@ -172,7 +172,7 @@ describe Wordlist::File do
172
172
 
173
173
  context "and the wordlist format is gzip" do
174
174
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.gz') }
175
- let(:expected_contents) { `zcat #{Shellwords.shellescape(path)}` }
175
+ let(:expected_contents) { `zcat < #{Shellwords.shellescape(path)}` }
176
176
 
177
177
  it "must return an Enumerator of the uncompressed gzip data" do
178
178
  expect(subject.each_line).to be_kind_of(Enumerator)
@@ -182,7 +182,7 @@ describe Wordlist::File do
182
182
 
183
183
  context "and the wordlist format is bzip2" do
184
184
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.bz2') }
185
- let(:expected_contents) { `bzcat #{Shellwords.shellescape(path)}` }
185
+ let(:expected_contents) { `bzcat < #{Shellwords.shellescape(path)}` }
186
186
 
187
187
  it "must return an Enumerator of the compressed gzip data" do
188
188
  expect(subject.each_line).to be_kind_of(Enumerator)
@@ -192,7 +192,7 @@ describe Wordlist::File do
192
192
 
193
193
  context "and the wordlist format is xz" do
194
194
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.xz') }
195
- let(:expected_contents) { `xzcat #{Shellwords.shellescape(path)}` }
195
+ let(:expected_contents) { `xzcat < #{Shellwords.shellescape(path)}` }
196
196
 
197
197
  it "must return an Enumerator of the compressed gzip data" do
198
198
  expect(subject.each_line).to be_kind_of(Enumerator)
@@ -211,7 +211,7 @@ describe Wordlist::File do
211
211
 
212
212
  context "and the wordlist format is gzip" do
213
213
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.gz') }
214
- let(:expected_contents) { `zcat #{Shellwords.shellescape(path)}` }
214
+ let(:expected_contents) { `zcat < #{Shellwords.shellescape(path)}` }
215
215
 
216
216
  it "must read the uncompressed gzip data" do
217
217
  expect { |b|
@@ -222,7 +222,7 @@ describe Wordlist::File do
222
222
 
223
223
  context "and the wordlist format is bzip2" do
224
224
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.bz2') }
225
- let(:expected_contents) { `bzcat #{Shellwords.shellescape(path)}` }
225
+ let(:expected_contents) { `bzcat < #{Shellwords.shellescape(path)}` }
226
226
 
227
227
  it "must read the uncompressed gzip data" do
228
228
  expect { |b|
@@ -233,7 +233,7 @@ describe Wordlist::File do
233
233
 
234
234
  context "and the wordlist format is xz" do
235
235
  let(:path) { ::File.join(fixtures_dir,'wordlist.txt.xz') }
236
- let(:expected_contents) { `xzcat #{Shellwords.shellescape(path)}` }
236
+ let(:expected_contents) { `xzcat < #{Shellwords.shellescape(path)}` }
237
237
 
238
238
  it "must read the uncompressed gzip data" do
239
239
  expect { |b|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-19 00:00:00.000000000 Z
11
+ date: 2023-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler