opt_parse_validator 0.0.10 → 0.0.11

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
  SHA1:
3
- metadata.gz: b9f84ae1d23fed8ad36be7b431234657f5c9cbc3
4
- data.tar.gz: b813aa3f972db1171b96ac7442d7aa14597296b5
3
+ metadata.gz: 2005faf0fda899b8304fc50a4c3e7d6284c6b03b
4
+ data.tar.gz: d36c2268f69d3a2e917e19aaa7d66fe1db9ad9bf
5
5
  SHA512:
6
- metadata.gz: e92ff979aa85b9020e5044512451d4d291a548f49e69d6aa51d1487444609cd25fabe346ef111912532aa88b8a775f90bc2e276dc6f2f74c31ca12f23e06b6d6
7
- data.tar.gz: 07f1cb36452e4f4ed87c3263744afa32185f0bd8f05c03312eccca0deb6698c2ba1cdb30033d2f16a4331e688e21a58f5c0217e6bf228b4a56df569cc9e580cb
6
+ metadata.gz: 8e871a6e7480a37abae8c4c19e13ca364b3e2bd82968fbbf76e5e2ef04ca387ef058f7d5f658e9ed7c4098e3e7840a10fe2236973c4c77a1ba54c2b2f3710dd0
7
+ data.tar.gz: 71c191d035bb3e7711d5c9fd3d17cf692bad1086672f461bd8a4e6c6fd109f17a722ae7b06dd797ccbc90dd49577d8d0d50cb74ef29fc2b7959e392e2a997d03
@@ -0,0 +1,4 @@
1
+ module OptParseValidator
2
+ class NoRequiredOption < StandardError
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
1
  # Gem Version
2
2
  module OptParseValidator
3
- VERSION = '0.0.10'
3
+ VERSION = '0.0.11'
4
4
  end
@@ -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.10
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-15 00:00:00.000000000 Z
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