opt_parse_validator 0.0.13.9 → 0.0.13.10

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: d415463f07cdf6040286e6d663e30e595dd1baa5
4
- data.tar.gz: afd3bdd186e2509e4b7374c6922eba90c37cc350
3
+ metadata.gz: eabff19a148cc02589422cf69471913c9a6a9cf4
4
+ data.tar.gz: 3a85f042127a44563b192e3694f5768b0fcafd5b
5
5
  SHA512:
6
- metadata.gz: a8a1f3f9423004010b3063deac7ad196f054b1a8b5f3ca2d4a06465312a292051b384c007aa65a1556ba594cd49621fe52dc855d255195ca04cd3bc5fd1e23ec
7
- data.tar.gz: 47629f4e35fa33ad43c2ac16682a6ef32b040828f62886259f4289ecefda410a75f46b8e0ad32fed09d1bd97335183e24a3bfe10333afe12736823a5c964fb73
6
+ metadata.gz: 9709ed1f23736346e3d4dab86032a61fc07cd73e8ae593c04bec00721df16e52ed77e81d41a910df45ec96a4362ea61f2a70247e0f381562c0c036d5625cbac0
7
+ data.tar.gz: 5a9537267567f9e8c536885fc22cda5346b6dc3dbd9107b29ff2f7f0d69907004b34328ef4a2e8a518c7c6a951039d7675c6c929136256fb58752e464ad2c7b3
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)
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)
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:
@@ -1,4 +1,4 @@
1
1
  # Gem Version
2
2
  module OptParseValidator
3
- VERSION = '0.0.13.9'.freeze
3
+ VERSION = '0.0.13.10'.freeze
4
4
  end
@@ -41,7 +41,7 @@ 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.default unless opt.default.nil?
44
+ @results[opt.to_sym] = opt.normalize(opt.validate(opt.default)) unless opt.default.nil?
45
45
 
46
46
  on(*opt.option) do |arg|
47
47
  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.13.9
4
+ version: 0.0.13.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-18 00:00:00.000000000 Z
11
+ date: 2017-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable