device_detector_regexes 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/device_detector_regexes.rb +3 -18
- data/lib/device_detector_regexes/parser.rb +18 -0
- data/lib/device_detector_regexes/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 259016a25baf4a3a0c0337fbb095f839d552d360ec1562d29b40da0bc7c6fc3e
|
4
|
+
data.tar.gz: d07e661f1f540ec039a5c0069a9c0582da886b1fd9c1eff3381122894257b7cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f706f2da25d3053aed27c2bbbc8105c7afe22ee4f449e7d7c689956e76a48fe2b6346f1a754a2a8931b1ecdbaff29e8a847a981903f9041d5bcd17bef244c0ab
|
7
|
+
data.tar.gz: 5f502de8b2c9a306f9dadd60847e61c064d1221ce9e61e2eac56bd2658a0595b174a3315440e7e2f2ec5747bdf086ee9bad5883f2eca676f1a52e10a62f27eb6
|
data/CHANGELOG.md
CHANGED
@@ -1,26 +1,11 @@
|
|
1
|
-
require "device_detector_regexes/version"
|
2
|
-
|
3
1
|
require "device_detector"
|
4
2
|
require "dry/configurable"
|
5
3
|
|
4
|
+
Gem.find_files('device_detector_regexes/*.rb').each { |path| require path }
|
5
|
+
|
6
6
|
module DeviceDetectorRegexes
|
7
|
+
|
7
8
|
extend Dry::Configurable
|
8
9
|
|
9
10
|
setting(:dir, Dir.pwd) { |dir| Pathname(dir) }
|
10
|
-
|
11
|
-
class DeviceDetector::Parser
|
12
|
-
private
|
13
|
-
|
14
|
-
def filepaths
|
15
|
-
filenames.each_with_object([]) do |filename, filenames|
|
16
|
-
filenames << [filename.to_sym, File.join(ROOT, 'regexes', filename)]
|
17
|
-
|
18
|
-
custom_file_path = File.expand_path(filename, File.join(DeviceDetectorRegexes.config.dir, 'regexes'))
|
19
|
-
|
20
|
-
if File.exists?(custom_file_path)
|
21
|
-
filenames << [filename.to_sym, custom_file_path]
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
11
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module DeviceDetectorRegexes
|
2
|
+
class ::DeviceDetector::Parser
|
3
|
+
private
|
4
|
+
|
5
|
+
def filepaths
|
6
|
+
filenames.each_with_object([]) do |filename, filenames|
|
7
|
+
|
8
|
+
# push custom files first due to higher precedence lookup than default files
|
9
|
+
custom_file_path = File.expand_path(filename, File.join(DeviceDetectorRegexes.config.dir, 'regexes'))
|
10
|
+
if File.exists?(custom_file_path)
|
11
|
+
filenames << [filename.to_sym, custom_file_path]
|
12
|
+
end
|
13
|
+
|
14
|
+
filenames << [filename.to_sym, File.join(ROOT, 'regexes', filename)]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: device_detector_regexes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Karpinovsky
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: device_detector
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- bin/setup
|
76
76
|
- device_detector_regexes.gemspec
|
77
77
|
- lib/device_detector_regexes.rb
|
78
|
+
- lib/device_detector_regexes/parser.rb
|
78
79
|
- lib/device_detector_regexes/version.rb
|
79
80
|
homepage: https://github.com/karpinovsky/device_detector_regexes
|
80
81
|
licenses:
|