opt_parse_validator 1.9.1 → 1.9.2
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/lib/opt_parse_validator/opts/base.rb +2 -2
- data/lib/opt_parse_validator/opts/file_path.rb +1 -1
- data/lib/opt_parse_validator/opts/multi_choices.rb +1 -1
- data/lib/opt_parse_validator/opts/path.rb +5 -5
- data/lib/opt_parse_validator/opts/uri.rb +1 -1
- data/lib/opt_parse_validator/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c43f0910f92116c9ca579acf742f97a5332dbc3cdca9e1eb03b849d639fbece8
|
4
|
+
data.tar.gz: '09e75a1d637a901c41c31061e38c1fb98d62e0032f8acab291e123a1e140f426'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '019c6bd0baa66f1b60fdd11a21151aa0caa2cbb09f10e5dc1811d7e0d59d953f75bc17feca7ffef543a6bf933a8234a21c076576d3ac050404ac4ee58fef1203'
|
7
|
+
data.tar.gz: 5bf3da88e65c5ffece6b31e41d527186aba8de7596d288a9093ec0e41a07d4832052bd534469b259bbc1e9d9d231e790ef333692e13a18add70b54be0c3a19d6
|
@@ -43,7 +43,7 @@ module OptParseValidator
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def required_unless
|
46
|
-
@required_unless ||=
|
46
|
+
@required_unless ||= Array(attrs[:required_unless])
|
47
47
|
end
|
48
48
|
|
49
49
|
# @return [ Mixed ]
|
@@ -91,7 +91,7 @@ module OptParseValidator
|
|
91
91
|
#
|
92
92
|
# @return [ Mixed ]
|
93
93
|
def normalize(value)
|
94
|
-
|
94
|
+
Array(attrs[:normalize]).each do |method|
|
95
95
|
next unless method.is_a?(Symbol)
|
96
96
|
|
97
97
|
value = value.send(method) if value.respond_to?(method)
|
@@ -26,7 +26,7 @@ module OptParseValidator
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def check_extensions(path)
|
29
|
-
return if
|
29
|
+
return if Array(attrs[:extensions]).include?(path.extname.delete('.'))
|
30
30
|
|
31
31
|
raise Error, "The extension of '#{path}' is not allowed"
|
32
32
|
end
|
@@ -39,22 +39,22 @@ module OptParseValidator
|
|
39
39
|
|
40
40
|
# @param [ Pathname ] path
|
41
41
|
def check_file(path)
|
42
|
-
raise Error, "'#{path}' is not a file" unless path.file? || attrs[:exists] == false
|
42
|
+
raise Error, "The path '#{path}' does not exist or is not a file" unless path.file? || attrs[:exists] == false
|
43
43
|
end
|
44
44
|
|
45
45
|
# @param [ Pathname ] path
|
46
46
|
def check_directory(path)
|
47
|
-
raise Error, "'#{path}' is not a directory" unless path.directory? || attrs[:exists] == false
|
47
|
+
raise Error, "The path '#{path}' does not exist or is not a directory" unless path.directory? || attrs[:exists] == false
|
48
48
|
end
|
49
49
|
|
50
50
|
# @param [ Pathname ] path
|
51
51
|
def check_executable(path)
|
52
|
-
raise Error, "'#{path}' is not executable" unless path.executable?
|
52
|
+
raise Error, "The path '#{path}' is not executable" unless path.executable?
|
53
53
|
end
|
54
54
|
|
55
55
|
# @param [ Pathname ] path
|
56
56
|
def check_readable(path)
|
57
|
-
raise Error, "'#{path}' is not readable" unless path.readable?
|
57
|
+
raise Error, "The path '#{path}' is not readable" unless path.readable?
|
58
58
|
end
|
59
59
|
|
60
60
|
# If the path does not exist, it will check for the parent
|
@@ -62,7 +62,7 @@ module OptParseValidator
|
|
62
62
|
#
|
63
63
|
# @param [ Pathname ] path
|
64
64
|
def check_writable(path)
|
65
|
-
raise Error, "'#{path}' is not writable" if path.exist? && !path.writable? || !path.parent.writable?
|
65
|
+
raise Error, "The path '#{path}' is not writable" if path.exist? && !path.writable? || !path.parent.writable?
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
@@ -13,7 +13,7 @@ module OptParseValidator
|
|
13
13
|
|
14
14
|
# @return [ Array<String> ]
|
15
15
|
def allowed_protocols
|
16
|
-
@allowed_protocols ||=
|
16
|
+
@allowed_protocols ||= Array(attrs[:protocols]).map(&:downcase)
|
17
17
|
end
|
18
18
|
|
19
19
|
# The default protocol (or scheme) to use if none was given
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opt_parse_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WPScanTeam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -112,28 +112,28 @@ dependencies:
|
|
112
112
|
requirements:
|
113
113
|
- - "~>"
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: 0.
|
115
|
+
version: 0.88.0
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 0.
|
122
|
+
version: 0.88.0
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
124
|
name: rubocop-performance
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
127
|
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 1.
|
129
|
+
version: 1.7.0
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 1.
|
136
|
+
version: 1.7.0
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: simplecov
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|