opt_parse_validator 0.0.10 → 0.0.11
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/errors.rb +4 -0
- data/lib/opt_parse_validator/version.rb +1 -1
- data/lib/opt_parse_validator.rb +3 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2005faf0fda899b8304fc50a4c3e7d6284c6b03b
|
4
|
+
data.tar.gz: d36c2268f69d3a2e917e19aaa7d66fe1db9ad9bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e871a6e7480a37abae8c4c19e13ca364b3e2bd82968fbbf76e5e2ef04ca387ef058f7d5f658e9ed7c4098e3e7840a10fe2236973c4c77a1ba54c2b2f3710dd0
|
7
|
+
data.tar.gz: 71c191d035bb3e7711d5c9fd3d17cf692bad1086672f461bd8a4e6c6fd109f17a722ae7b06dd797ccbc90dd49577d8d0d50cb74ef29fc2b7959e392e2a997d03
|
data/lib/opt_parse_validator.rb
CHANGED
@@ -4,6 +4,7 @@ require 'addressable/uri'
|
|
4
4
|
require 'optparse'
|
5
5
|
require 'pathname'
|
6
6
|
# Custom Libs
|
7
|
+
require 'opt_parse_validator/errors'
|
7
8
|
require 'opt_parse_validator/hacks'
|
8
9
|
require 'opt_parse_validator/opts'
|
9
10
|
require 'opt_parse_validator/version'
|
@@ -69,7 +70,7 @@ module OptParseValidator
|
|
69
70
|
def post_processing
|
70
71
|
@opts.each do |opt|
|
71
72
|
if opt.required?
|
72
|
-
fail "The option #{opt} is required" unless @results.key?(opt.to_sym)
|
73
|
+
fail NoRequiredOption, "The option #{opt} is required" unless @results.key?(opt.to_sym)
|
73
74
|
end
|
74
75
|
|
75
76
|
next if opt.required_unless.empty?
|
@@ -77,7 +78,7 @@ module OptParseValidator
|
|
77
78
|
|
78
79
|
fail_msg = "One of the following options is required: #{opt}, #{opt.required_unless.join(', ')}"
|
79
80
|
|
80
|
-
fail fail_msg unless opt.required_unless.any? do |sym|
|
81
|
+
fail NoRequiredOption, fail_msg unless opt.required_unless.any? do |sym|
|
81
82
|
@results.key?(sym)
|
82
83
|
end
|
83
84
|
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: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WPScanTeam - Erwan le Rousseau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- LICENSE
|
120
120
|
- README.md
|
121
121
|
- lib/opt_parse_validator.rb
|
122
|
+
- lib/opt_parse_validator/errors.rb
|
122
123
|
- lib/opt_parse_validator/hacks.rb
|
123
124
|
- lib/opt_parse_validator/options_file.rb
|
124
125
|
- lib/opt_parse_validator/opts.rb
|