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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1727b4d4025bf43493520490e4bd470bed76a8979dc8af6c53991a80235f87fb
4
- data.tar.gz: cfc6c8366cfe134ea61e88f1125d0b2a7e6de530813581b627345bd9f9b1c0f0
3
+ metadata.gz: 259016a25baf4a3a0c0337fbb095f839d552d360ec1562d29b40da0bc7c6fc3e
4
+ data.tar.gz: d07e661f1f540ec039a5c0069a9c0582da886b1fd9c1eff3381122894257b7cc
5
5
  SHA512:
6
- metadata.gz: 0ca935290e414e7b09a868b7965a497de6cc6e8930d046ce3aa41ab5b0bd8043cb639398341fe274792a3162dfe20bd7e711c34c33276c5d06dbd4a20f6342d1
7
- data.tar.gz: 26afa858ce8524e85f5a01da29be093ed6797a97f07e95900e274ccc5cea1f153f97e3c5247afde1f96f11ab53108e60c12abd08c3a9a258578deb32a8040b51
6
+ metadata.gz: f706f2da25d3053aed27c2bbbc8105c7afe22ee4f449e7d7c689956e76a48fe2b6346f1a754a2a8931b1ecdbaff29e8a847a981903f9041d5bcd17bef244c0ab
7
+ data.tar.gz: 5f502de8b2c9a306f9dadd60847e61c064d1221ce9e61e2eac56bd2658a0595b174a3315440e7e2f2ec5747bdf086ee9bad5883f2eca676f1a52e10a62f27eb6
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Change log
2
2
 
3
+ ## [0.1.2]
4
+ Fix custom regexes precedence lookup over default ones
5
+
3
6
  ## [0.1.1]
4
7
  Remove dependencies versions restrictions for better compatibility
@@ -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
@@ -1,3 +1,3 @@
1
1
  module DeviceDetectorRegexes
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  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.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-12 00:00:00.000000000 Z
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: