opt_parse_validator 0.0.15.1 → 0.0.15.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
  SHA1:
3
- metadata.gz: 7ee35fe5e103f3659a0082d41e24de1c70e35e43
4
- data.tar.gz: d87b41662240be5231c7abb1d8cf404d36bfe215
3
+ metadata.gz: 58bdbf0b9c2bc56380fec56808903c0809c99720
4
+ data.tar.gz: 79eaa1f3db729626ea0054e9f75134b8f0593b6e
5
5
  SHA512:
6
- metadata.gz: 12fd590e25afda0b9e5ae52bba0b9a1da139bd7d4a9334d2d332f20c0f03d5db6f6722ef9e7270ef1219418054da3b15a3c7be36c21274756c7ad84d95a11c95
7
- data.tar.gz: 8240a04fded3e186410e9306b8ad9f3e867eb03adaf3ea4a224512769e8e4036adb2d395bcc04cc01c8444a52cab0cd46256f718f0b4b6f39f76609bc9e66cde
6
+ metadata.gz: 8b17d62e6fd525c9dab90460468a6686d87f862b7d3647888e3a88b2bd1ea153279bf9d4f25f8cf8ade8b266ad1381581027f2ec3302ee9926f00208c3e5f60b
7
+ data.tar.gz: '00780cbecf1ab1fbedfa168accc963d37ebbde70e0c71e4447802a7add91bcbe3c6ce73f2a59ab1fce608a9508a0c84f1024339b2acd6a02ec6ee1a8d06847f8'
@@ -25,12 +25,16 @@ module OptParseValidator
25
25
 
26
26
  # @return [ Void ]
27
27
  def append_help_messages
28
- option << "Default: #{default}" if default
28
+ option << "Default: #{help_message_for_default}" if default
29
29
  option << "Value if no argument supplied: #{value_if_empty}" if value_if_empty
30
30
  option << 'This option is mandatory' if required?
31
31
  option << "This option is mandatory unless #{required_unless.join(' or ')} is/are supplied" unless required_unless.empty?
32
32
  end
33
33
 
34
+ def help_message_for_default
35
+ default.to_s
36
+ end
37
+
34
38
  # @return [ Boolean ]
35
39
  def required?
36
40
  @required ||= attrs[:required]
@@ -13,23 +13,6 @@ module OptParseValidator
13
13
  super(option, attrs)
14
14
  end
15
15
 
16
- def default
17
- return nil unless attrs[:default]
18
-
19
- default = ''
20
-
21
- attrs[:default].each do |key, value|
22
- default << if value == true
23
- key.to_s.titleize
24
- else
25
- "#{key.to_s.titleize}: #{value}"
26
- end
27
- default << ', '
28
- end
29
-
30
- default.chomp(', ')
31
- end
32
-
33
16
  def append_help_messages
34
17
  option << 'Available Choices:'
35
18
 
@@ -53,6 +36,21 @@ module OptParseValidator
53
36
  end
54
37
  end
55
38
 
39
+ def help_message_for_default
40
+ msg = ''
41
+
42
+ default.each do |key, value|
43
+ msg << if value == true
44
+ key.to_s.titleize
45
+ else
46
+ "#{key.to_s.titleize}: #{value}"
47
+ end
48
+ msg << ', '
49
+ end
50
+
51
+ msg.chomp(', ')
52
+ end
53
+
56
54
  # @param [ OptBase ] opt
57
55
  #
58
56
  # @return [ Array<String> ]
@@ -1,4 +1,4 @@
1
1
  # Gem Version
2
2
  module OptParseValidator
3
- VERSION = '0.0.15.1'.freeze
3
+ VERSION = '0.0.15.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opt_parse_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15.1
4
+ version: 0.0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam