opt_parse_validator 1.9.1 → 1.9.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: 3ccb947d9079bcc004e16bdfea47a5e5207c26e871da1a1cf0c01f2bbeca5b65
4
- data.tar.gz: 87139c6bbe1664ff3c70374a81d3e6940193b5d46cd0d07c5905cc22ab468cfb
3
+ metadata.gz: c43f0910f92116c9ca579acf742f97a5332dbc3cdca9e1eb03b849d639fbece8
4
+ data.tar.gz: '09e75a1d637a901c41c31061e38c1fb98d62e0032f8acab291e123a1e140f426'
5
5
  SHA512:
6
- metadata.gz: dd7dd0aa734ad3ad63bd1644b8ab05213d96a0d3c223de20d2152581c22c04b7f68df65ea52fbe4b189e46d44b32d005b855da92e12c5e336b31eb42553d5c00
7
- data.tar.gz: 50bca2d9e0f17c6c1f9662b3d3e6a9d9b1d8ed5352b6e35c4847ac373ff91b64a50adfe53ffd73f993575e90a9cae67cfe7bcd52fafe702cefb30ec44d718dce
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 ||= [*attrs[: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
- [*attrs[:normalize]].each do |method|
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 [*attrs[:extensions]].include?(path.extname.delete('.'))
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
@@ -104,7 +104,7 @@ module OptParseValidator
104
104
 
105
105
  # @return [ Array<Array<Symbol>> ]
106
106
  def incompatible
107
- [*attrs[:incompatible]]
107
+ Array(attrs[:incompatible])
108
108
  end
109
109
 
110
110
  # @param [ Hash ] values
@@ -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 ||= [*attrs[:protocols]].map(&:downcase)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Gem Version
4
4
  module OptParseValidator
5
- VERSION = '1.9.1'
5
+ VERSION = '1.9.2'
6
6
  end
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.1
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-05-25 00:00:00.000000000 Z
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.84.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.84.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.6.0
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.6.0
136
+ version: 1.7.0
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: simplecov
139
139
  requirement: !ruby/object:Gem::Requirement