crawler_detect 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +34 -34
- data/lib/crawler_detect/library.rb +12 -2
- data/lib/crawler_detect/version.rb +1 -1
- data/lib/crawler_detect.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abc20006d901205f658b54f78a94acb2480f3efbbc80213540381a1f956ce9d8
|
4
|
+
data.tar.gz: 53a3959effd4a78f93afa1d438ea06b6db567a3f3227311f24bbc7a1ea0d89fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '018d27fba7246b394e3cb5444cd8c0862e4ea08bf1b9e1fa12adb46d887b8753820ecbc103030c89af0b0e8ab05fa2c1d42ee33466685eaadfbc61b3185ef32f'
|
7
|
+
data.tar.gz: 02536c1035099e35961fafc9877a3d29d72ff5ed20848f2f4eb183d4fbbc300d6d5d7d68d23282e49e2a19ad589c04bc6ffb8dd8200e14b81a602286af924261
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
crawler_detect (1.1.
|
4
|
+
crawler_detect (1.1.2)
|
5
5
|
qonfig (~> 0.24)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.0.
|
10
|
+
activesupport (6.0.4.1)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 0.7, < 2)
|
13
13
|
minitest (~> 5.1)
|
@@ -19,31 +19,31 @@ GEM
|
|
19
19
|
rubocop-rails (= 2.5.2)
|
20
20
|
rubocop-rake (= 0.5.1)
|
21
21
|
rubocop-rspec (= 1.38.1)
|
22
|
-
ast (2.4.
|
23
|
-
awesome_print (1.
|
24
|
-
byebug (11.1.
|
25
|
-
coderay (1.1.
|
26
|
-
concurrent-ruby (1.1.
|
27
|
-
diff-lcs (1.
|
28
|
-
fuubar (2.5.
|
22
|
+
ast (2.4.2)
|
23
|
+
awesome_print (1.9.2)
|
24
|
+
byebug (11.1.3)
|
25
|
+
coderay (1.1.3)
|
26
|
+
concurrent-ruby (1.1.9)
|
27
|
+
diff-lcs (1.4.4)
|
28
|
+
fuubar (2.5.1)
|
29
29
|
rspec-core (~> 3.0)
|
30
30
|
ruby-progressbar (~> 1.4)
|
31
|
-
i18n (1.8.
|
31
|
+
i18n (1.8.10)
|
32
32
|
concurrent-ruby (~> 1.0)
|
33
33
|
jaro_winkler (1.5.4)
|
34
34
|
method_source (1.0.0)
|
35
|
-
minitest (5.14.
|
36
|
-
parallel (1.
|
35
|
+
minitest (5.14.4)
|
36
|
+
parallel (1.20.1)
|
37
37
|
parallel_tests (2.32.0)
|
38
38
|
parallel
|
39
|
-
parser (
|
40
|
-
ast (~> 2.4.
|
41
|
-
pry (0.
|
39
|
+
parser (3.0.2.0)
|
40
|
+
ast (~> 2.4.1)
|
41
|
+
pry (0.14.1)
|
42
42
|
coderay (~> 1.1)
|
43
43
|
method_source (~> 1.0)
|
44
|
-
pry-byebug (3.
|
44
|
+
pry-byebug (3.8.0)
|
45
45
|
byebug (~> 11.0)
|
46
|
-
pry (~> 0.
|
46
|
+
pry (~> 0.10)
|
47
47
|
pry-meta (0.0.10)
|
48
48
|
awesome_print
|
49
49
|
pry
|
@@ -52,26 +52,26 @@ GEM
|
|
52
52
|
pry-remote (0.1.8)
|
53
53
|
pry (~> 0.9)
|
54
54
|
slop (~> 3.0)
|
55
|
-
qonfig (0.
|
55
|
+
qonfig (0.26.0)
|
56
56
|
rack (2.2.3)
|
57
57
|
rack-test (1.1.0)
|
58
58
|
rack (>= 1.0, < 3)
|
59
59
|
rainbow (3.0.0)
|
60
|
-
rake (13.0.
|
61
|
-
rexml (3.2.
|
62
|
-
rspec (3.
|
63
|
-
rspec-core (~> 3.
|
64
|
-
rspec-expectations (~> 3.
|
65
|
-
rspec-mocks (~> 3.
|
66
|
-
rspec-core (3.
|
67
|
-
rspec-support (~> 3.
|
68
|
-
rspec-expectations (3.
|
60
|
+
rake (13.0.6)
|
61
|
+
rexml (3.2.5)
|
62
|
+
rspec (3.10.0)
|
63
|
+
rspec-core (~> 3.10.0)
|
64
|
+
rspec-expectations (~> 3.10.0)
|
65
|
+
rspec-mocks (~> 3.10.0)
|
66
|
+
rspec-core (3.10.1)
|
67
|
+
rspec-support (~> 3.10.0)
|
68
|
+
rspec-expectations (3.10.1)
|
69
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.
|
71
|
-
rspec-mocks (3.
|
70
|
+
rspec-support (~> 3.10.0)
|
71
|
+
rspec-mocks (3.10.2)
|
72
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
-
rspec-support (~> 3.
|
74
|
-
rspec-support (3.
|
73
|
+
rspec-support (~> 3.10.0)
|
74
|
+
rspec-support (3.10.2)
|
75
75
|
rubocop (0.82.0)
|
76
76
|
jaro_winkler (~> 1.5.1)
|
77
77
|
parallel (~> 1.10)
|
@@ -90,13 +90,13 @@ GEM
|
|
90
90
|
rubocop
|
91
91
|
rubocop-rspec (1.38.1)
|
92
92
|
rubocop (>= 0.68.1)
|
93
|
-
ruby-progressbar (1.
|
93
|
+
ruby-progressbar (1.11.0)
|
94
94
|
slop (3.6.0)
|
95
95
|
thread_safe (0.3.6)
|
96
|
-
tzinfo (1.2.
|
96
|
+
tzinfo (1.2.9)
|
97
97
|
thread_safe (~> 0.1)
|
98
98
|
unicode-display_width (1.7.0)
|
99
|
-
zeitwerk (2.
|
99
|
+
zeitwerk (2.4.2)
|
100
100
|
|
101
101
|
PLATFORMS
|
102
102
|
ruby
|
@@ -5,12 +5,16 @@ module CrawlerDetect
|
|
5
5
|
module Library
|
6
6
|
DATA_CLASSES = [Library::Headers, Library::Exclusions, Library::Crawlers].freeze
|
7
7
|
|
8
|
+
@regexp_cache = {}
|
9
|
+
|
8
10
|
class << self
|
9
11
|
# @param param [String] Name of raw data
|
10
12
|
# @return [Regexp]
|
11
13
|
def get_regexp(param)
|
12
|
-
|
13
|
-
|
14
|
+
@regexp_cache[param] ||= begin
|
15
|
+
data = get_array(param)
|
16
|
+
%r{#{data.join('|')}}i
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
# @param param [String] Name of raw data
|
@@ -18,6 +22,12 @@ module CrawlerDetect
|
|
18
22
|
def get_array(param)
|
19
23
|
const_get("CrawlerDetect::Library::#{param.capitalize}").send(:data)
|
20
24
|
end
|
25
|
+
|
26
|
+
# @return [void]
|
27
|
+
def reset_cache
|
28
|
+
DATA_CLASSES.each(&:reload_data)
|
29
|
+
@regexp_cache = {}
|
30
|
+
end
|
21
31
|
end
|
22
32
|
end
|
23
33
|
end
|
data/lib/crawler_detect.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crawler_detect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kozlov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: qonfig
|