opt_parse_validator 0.0.14.0 → 0.0.14.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a34dacc55d16b62f89bd6f1d2abda599a3876b3
4
- data.tar.gz: c23a8feb575ecfead935c4e163dcd95d8ce27d3d
3
+ metadata.gz: '0286c5b4aeeef23b862af3aa5f029908b5965bd1'
4
+ data.tar.gz: 625e42c2b8e97c9f448aec2612a6893ad0c02539
5
5
  SHA512:
6
- metadata.gz: 357e580715074b73a6cc639f2f32e1fa52ee9ce116ce82181350c0d08457f76846e1dce9a0d3a567fa4788a2c2730f588050e673b61f43d21e0279d717721161
7
- data.tar.gz: 849d98dd225c8a6e17378f8e59ba6f75f9a665e06968636f089747069eda70d2b71e9a7464fd03f3dd7c9cfab4b6d35f6a56d3a6f8585163506c4058db44b186
6
+ metadata.gz: f7d1bd2b8315771f040b1467cd27d475151d860c898ee90b8872f16efca592de1d73f14cbe502e4556e6cc5d9438250335800cca71e8b67fa9f5ae95676cbeea
7
+ data.tar.gz: 59e2147c23f7ce56a749c3c124a49b7b8508d86be105a7ab7a537830c71afe8dc98da23836cec2819770e17d87b2da9ddc100dec889db2fb6fb1bbfaac4b4452
data/README.md CHANGED
@@ -52,7 +52,7 @@ Please Feel free to send Pull Requests to improve this Readme
52
52
  Some attributes are available for all Validators:
53
53
  - :required (whether or not the associated cli option is required/mandatory - [example](https://github.com/wpscanteam/CMSScanner/blob/master/app/controllers/core/cli_options.rb#L9)).
54
54
  - :required_unless (like the above, except if the option/s given in this parameter are called in the CLI - [example](https://github.com/wpscanteam/wpscan-v3/blob/master/app/controllers/core.rb#L7), can be a single symbol or array of symbols)
55
- - :default (Default value to use if the option is not supplied, which will go through the validation and normalization processes as if it was supplied by the user)
55
+ - :default (Default value to use if the option is not supplied, the correct format has to be used as it won't go through the validation and normalization processes)
56
56
  - :value_if_empty (Value to use if no argument has been supplied for the related option)
57
57
 
58
58
  ### Available Validators & Associated Attributes:
@@ -7,11 +7,11 @@ module OptParseValidator
7
7
 
8
8
  # @param [ Array ] option See OptionParser#on
9
9
  # @param [ Hash ] attrs
10
- # @option attrs [ Boolean ] :required
10
+ # @option attrs [ Boolean ] :required
11
11
  # @options attrs [ Array<Symbol>, Symbol ] :required_unless
12
- # @option attrs [ Mixed ] :default The default value to use if the option is not supplied
13
- # @option attrs [ Mixed ] :value_if_empty The value to use if no argument has been supplied
14
- # @option attrs [ Array<Symbol> ] :normalize See #normalize
12
+ # @option attrs [ Mixed ] :default The default value to use if the option is not supplied
13
+ # @option attrs [ Mixed ] :value_if_empty The value to use if no argument has been supplied
14
+ # @option attrs [ Array<Symbol> ] :normalize See #normalize
15
15
  #
16
16
  # @note The :default and :normalize 'logics' are done in OptParseValidator::OptParser#add_option
17
17
  def initialize(option, attrs = {})
@@ -1,4 +1,4 @@
1
1
  # Gem Version
2
2
  module OptParseValidator
3
- VERSION = '0.0.14.0'.freeze
3
+ VERSION = '0.0.14.1'.freeze
4
4
  end
@@ -41,7 +41,9 @@ module OptParseValidator
41
41
  @opts << opt
42
42
  @symbols_used << opt.to_sym
43
43
  # Set the default option value if it exists
44
- @results[opt.to_sym] = opt.normalize(opt.validate(opt.default)) unless opt.default.nil?
44
+ # The default value is not validated as provided by devs
45
+ # and should be set to the correct format/value directly
46
+ @results[opt.to_sym] = opt.default unless opt.default.nil?
45
47
 
46
48
  on(*opt.option) do |arg|
47
49
  begin
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.14.0
4
+ version: 0.0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2017-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport