ronin-web-user_agents 0.1.0.beta1 → 0.1.0
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 +4 -4
- data/.github/workflows/ruby.yml +1 -0
- data/.yardopts +1 -1
- data/ChangeLog.md +3 -0
- data/README.md +3 -2
- data/gemspec.yml +3 -3
- data/lib/ronin/web/user_agents/chrome.rb +1 -1
- data/lib/ronin/web/user_agents/data_dir.rb +1 -1
- data/lib/ronin/web/user_agents/firefox.rb +1 -1
- data/lib/ronin/web/user_agents/google_bot.rb +1 -1
- data/lib/ronin/web/user_agents/os/android.rb +1 -1
- data/lib/ronin/web/user_agents/os/linux.rb +1 -1
- data/lib/ronin/web/user_agents/os/mac_os.rb +1 -1
- data/lib/ronin/web/user_agents/os/windows.rb +1 -1
- data/lib/ronin/web/user_agents/version.rb +2 -2
- data/lib/ronin/web/user_agents.rb +1 -1
- data/ronin-web-user_agents.gemspec +2 -1
- metadata +6 -23
- data/spec/chrome_spec.rb +0 -511
- data/spec/firefox_spec.rb +0 -414
- data/spec/google_bot_spec.rb +0 -231
- data/spec/os/android_spec.rb +0 -55
- data/spec/os/linux_spec.rb +0 -48
- data/spec/os/mac_os_spec.rb +0 -73
- data/spec/os/windows_spec.rb +0 -52
- data/spec/spec_helper.rb +0 -4
- data/spec/user_agents_spec.rb +0 -49
data/spec/os/android_spec.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/web/user_agents/os/android'
|
3
|
-
|
4
|
-
describe Ronin::Web::UserAgents::OS::Android do
|
5
|
-
describe "VERSIONS" do
|
6
|
-
subject { described_class::VERSIONS }
|
7
|
-
|
8
|
-
it { expect(subject).to_not be_empty }
|
9
|
-
it { expect(subject).to include('10') }
|
10
|
-
it { expect(subject).to include('10.0') }
|
11
|
-
it { expect(subject).to include('11') }
|
12
|
-
it { expect(subject).to include('11.0') }
|
13
|
-
it { expect(subject).to include('12') }
|
14
|
-
it { expect(subject).to include('12.1') }
|
15
|
-
it { expect(subject).to include('4.0.4') }
|
16
|
-
it { expect(subject).to include('4.1.2') }
|
17
|
-
it { expect(subject).to include('4.2.2') }
|
18
|
-
it { expect(subject).to include('4.4.2') }
|
19
|
-
it { expect(subject).to include('4.4.4') }
|
20
|
-
it { expect(subject).to include('5.0') }
|
21
|
-
it { expect(subject).to include('5.0.2') }
|
22
|
-
it { expect(subject).to include('5.1') }
|
23
|
-
it { expect(subject).to include('5.1.1') }
|
24
|
-
it { expect(subject).to include('6.0') }
|
25
|
-
it { expect(subject).to include('6.0.1') }
|
26
|
-
it { expect(subject).to include('7.0') }
|
27
|
-
it { expect(subject).to include('7.1.1') }
|
28
|
-
it { expect(subject).to include('7.1.2') }
|
29
|
-
it { expect(subject).to include('8.0') }
|
30
|
-
it { expect(subject).to include('8.0.0') }
|
31
|
-
it { expect(subject).to include('8.1') }
|
32
|
-
it { expect(subject).to include('8.1.0') }
|
33
|
-
it { expect(subject).to include('9') }
|
34
|
-
it { expect(subject).to include('9.0') }
|
35
|
-
end
|
36
|
-
|
37
|
-
describe "ARCHES" do
|
38
|
-
subject { described_class::ARCHES }
|
39
|
-
|
40
|
-
it "must map :arm to 'arm'" do
|
41
|
-
expect(subject[:arm]).to eq('arm')
|
42
|
-
end
|
43
|
-
|
44
|
-
it "must map :arm64 to 'arm_64'" do
|
45
|
-
expect(subject[:arm64]).to eq('arm_64')
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe "DEVICES" do
|
50
|
-
subject { described_class::DEVICES }
|
51
|
-
|
52
|
-
it { expect(subject).to_not be_empty }
|
53
|
-
it { expect(subject).to all(be_kind_of(String)) }
|
54
|
-
end
|
55
|
-
end
|
data/spec/os/linux_spec.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/web/user_agents/os/linux'
|
3
|
-
|
4
|
-
describe Ronin::Web::UserAgents::OS::Linux do
|
5
|
-
describe "DISTROS" do
|
6
|
-
subject { described_class::DISTROS }
|
7
|
-
|
8
|
-
it "must map :ubuntu to 'Ubuntu'" do
|
9
|
-
expect(subject[:ubuntu]).to eq('Ubuntu')
|
10
|
-
end
|
11
|
-
|
12
|
-
it "must map :fedora to 'Fedora'" do
|
13
|
-
expect(subject[:fedora]).to eq('Fedora')
|
14
|
-
end
|
15
|
-
|
16
|
-
it "must map :arch to 'Arch'" do
|
17
|
-
expect(subject[:arch]).to eq('Arch')
|
18
|
-
end
|
19
|
-
|
20
|
-
it "must map nil to nil" do
|
21
|
-
expect(subject[nil]).to be(nil)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "ARCHES" do
|
26
|
-
subject { described_class::ARCHES }
|
27
|
-
|
28
|
-
it "must map :x86_64 to 'x86_64'" do
|
29
|
-
expect(subject[:x86_64]).to eq('x86_64')
|
30
|
-
end
|
31
|
-
|
32
|
-
it "must map :aarch64 to 'aarch64'" do
|
33
|
-
expect(subject[:aarch64]).to eq('aarch64')
|
34
|
-
end
|
35
|
-
|
36
|
-
it "must map :arm64 to 'aarch64'" do
|
37
|
-
expect(subject[:arm64]).to eq('aarch64')
|
38
|
-
end
|
39
|
-
|
40
|
-
it "must map :i686 to 'i686'" do
|
41
|
-
expect(subject[:i686]).to eq('i686')
|
42
|
-
end
|
43
|
-
|
44
|
-
it "must map :x86 to 'i686'" do
|
45
|
-
expect(subject[:x86]).to eq('i686')
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
data/spec/os/mac_os_spec.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/web/user_agents/os/mac_os'
|
3
|
-
|
4
|
-
describe Ronin::Web::UserAgents::OS::MacOS do
|
5
|
-
describe "VERSIONS" do
|
6
|
-
subject { described_class::VERSIONS }
|
7
|
-
|
8
|
-
it { expect(subject).to_not be_empty }
|
9
|
-
it { expect(subject).to include('10.10') }
|
10
|
-
it { expect(subject).to include('10.10.3') }
|
11
|
-
it { expect(subject).to include('10.10.4') }
|
12
|
-
it { expect(subject).to include('10.11.6') }
|
13
|
-
it { expect(subject).to include('10.12.0') }
|
14
|
-
it { expect(subject).to include('10.12.1') }
|
15
|
-
it { expect(subject).to include('10.12.6') }
|
16
|
-
it { expect(subject).to include('10.13.4') }
|
17
|
-
it { expect(subject).to include('10.13.6') }
|
18
|
-
it { expect(subject).to include('10.14.0') }
|
19
|
-
it { expect(subject).to include('10.14.1') }
|
20
|
-
it { expect(subject).to include('10.14.2') }
|
21
|
-
it { expect(subject).to include('10.14.5') }
|
22
|
-
it { expect(subject).to include('10.14.6') }
|
23
|
-
it { expect(subject).to include('10.14.8') }
|
24
|
-
it { expect(subject).to include('10.15.1') }
|
25
|
-
it { expect(subject).to include('10.15.2') }
|
26
|
-
it { expect(subject).to include('10.15.4') }
|
27
|
-
it { expect(subject).to include('10.15.6') }
|
28
|
-
it { expect(subject).to include('10.15.7') }
|
29
|
-
it { expect(subject).to include('10.16') }
|
30
|
-
it { expect(subject).to include('10.16.0') }
|
31
|
-
it { expect(subject).to include('10.31.7') }
|
32
|
-
it { expect(subject).to include('10.4') }
|
33
|
-
it { expect(subject).to include('10.55') }
|
34
|
-
it { expect(subject).to include('10.7.0') }
|
35
|
-
it { expect(subject).to include('11.0.0') }
|
36
|
-
it { expect(subject).to include('11.15') }
|
37
|
-
it { expect(subject).to include('11.6.3') }
|
38
|
-
it { expect(subject).to include('12.2.0') }
|
39
|
-
it { expect(subject).to include('16.55') }
|
40
|
-
end
|
41
|
-
|
42
|
-
describe "VERSIONS_UNDERSCORED" do
|
43
|
-
subject { described_class::VERSIONS_UNDERSCORED }
|
44
|
-
|
45
|
-
it "must map known X.Y versions to X_Y notation" do
|
46
|
-
expect(subject['10.10']).to eq('10_10')
|
47
|
-
end
|
48
|
-
|
49
|
-
it "must map known X.Y.Z versions to X_Y_Z notation" do
|
50
|
-
expect(subject['10.10.3']).to eq('10_10_3')
|
51
|
-
end
|
52
|
-
|
53
|
-
it "must map unknwon X.Y versions to X_Y notation" do
|
54
|
-
expect(subject['20.20']).to eq('20_20')
|
55
|
-
end
|
56
|
-
|
57
|
-
it "must map unknwon X.Y.Z versions to X_Y_Z notation" do
|
58
|
-
expect(subject['20.20.20']).to eq('20_20_20')
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "ARCHES" do
|
63
|
-
subject { described_class::ARCHES }
|
64
|
-
|
65
|
-
it "must map :intel to 'Intel'" do
|
66
|
-
expect(subject[:intel]).to eq('Intel')
|
67
|
-
end
|
68
|
-
|
69
|
-
it "must map :x86_64 to 'Intel'" do
|
70
|
-
expect(subject[:x86_64]).to eq('Intel')
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
data/spec/os/windows_spec.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/web/user_agents/os/windows'
|
3
|
-
|
4
|
-
describe Ronin::Web::UserAgents::OS::Windows do
|
5
|
-
describe "VERSIONS" do
|
6
|
-
subject { described_class::VERSIONS }
|
7
|
-
|
8
|
-
it "must map :xp to '5.2'" do
|
9
|
-
expect(subject[:xp]).to eq('5.2')
|
10
|
-
end
|
11
|
-
|
12
|
-
it "must map :vista to '6.0'" do
|
13
|
-
expect(subject[:vista]).to eq('6.0')
|
14
|
-
end
|
15
|
-
|
16
|
-
it "must map 7 to '6.1'" do
|
17
|
-
expect(subject[7]).to eq('6.1')
|
18
|
-
end
|
19
|
-
|
20
|
-
it "must map 8 to '6.2'" do
|
21
|
-
expect(subject[8]).to eq('6.2')
|
22
|
-
end
|
23
|
-
|
24
|
-
it "must map 8.1 to '6.3'" do
|
25
|
-
expect(subject[8.1]).to eq('6.3')
|
26
|
-
end
|
27
|
-
|
28
|
-
it "must map 10 to '10.0'" do
|
29
|
-
expect(subject[10]).to eq('10.0')
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "ARCHES" do
|
34
|
-
subject { described_class::ARCHES }
|
35
|
-
|
36
|
-
it "must map :wow64 to 'WOW64'" do
|
37
|
-
expect(subject[:wow64]).to eq('WOW64')
|
38
|
-
end
|
39
|
-
|
40
|
-
it "must map :win64 to 'Win64; x64'" do
|
41
|
-
expect(subject[:win64]).to eq('Win64; x64')
|
42
|
-
end
|
43
|
-
|
44
|
-
it "must map :x86_64 to 'Win64; x64'" do
|
45
|
-
expect(subject[:x86_64]).to eq('Win64; x64')
|
46
|
-
end
|
47
|
-
|
48
|
-
it "must map nil to nil" do
|
49
|
-
expect(subject[nil]).to be(nil)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
data/spec/spec_helper.rb
DELETED
data/spec/user_agents_spec.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/web/user_agents'
|
3
|
-
|
4
|
-
describe Ronin::Web::UserAgents do
|
5
|
-
it "must define a VERSION constant" do
|
6
|
-
expect(subject.const_defined?('VERSION',false)).to be(true)
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".chrome" do
|
10
|
-
it "must return Ronin::Web::UserAgents::Chrome" do
|
11
|
-
expect(subject.chrome).to eq(Ronin::Web::UserAgents::Chrome)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe ".google_chrome" do
|
16
|
-
it "must return Ronin::Web::UserAgents::Chrome" do
|
17
|
-
expect(subject.google_chrome).to eq(Ronin::Web::UserAgents::Chrome)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe ".firefox" do
|
22
|
-
it "must return Ronin::Web::UserAgents::Firefox" do
|
23
|
-
expect(subject.firefox).to eq(Ronin::Web::UserAgents::Firefox)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe ".google_bot" do
|
28
|
-
it "must return Ronin::Web::UserAgents::GoogleBot" do
|
29
|
-
expect(subject.google_bot).to eq(Ronin::Web::UserAgents::GoogleBot)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe ".random" do
|
34
|
-
it "must return a random User-Agent string" do
|
35
|
-
expect(subject.random).to match(
|
36
|
-
%r{
|
37
|
-
^(?:
|
38
|
-
Mozilla/5\.0\ \([^\)]+\)\ AppleWebKit/537\.36\ \(KHTML,\ like\ Gecko\)\ Chrome/\d+(\.\d+)*\ (?:Mobile\ )?Safari/537\.36|
|
39
|
-
Mozilla/5\.0\ \([^\)]+\)\ Gecko/(?:20100101|\d+(?:\.\d+)*)\ Firefox/\d+(\.\d+)*
|
40
|
-
)$
|
41
|
-
}x
|
42
|
-
)
|
43
|
-
end
|
44
|
-
|
45
|
-
it "must return a random User-Agent string each time" do
|
46
|
-
expect(subject.random).to_not eq(subject.random)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|