• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wpscanteam / OptParseValidator / 4660321049

pending completion
4660321049

push

github

GitHub
Update rubocop-performance requirement from ~> 1.16.0 to ~> 1.17.1

132 of 136 branches covered (97.06%)

414 of 414 relevant lines covered (100.0%)

25.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/lib/opt_parse_validator/opts/array.rb
1
# frozen_string_literal: true
2

3
module OptParseValidator
1✔
4
  # Implementation of the Array Option
5
  class OptArray < OptBase
1✔
6
    # @return [ Void ]
7
    def append_help_messages
1✔
8
      option << "Separator to use between the values: '#{separator}'"
30✔
9

10
      super
30✔
11
    end
12

13
    # @param [ String ] value
14
    #
15
    # @return [ Array ]
16
    def validate(value)
1✔
17
      super(value).split(separator)
23✔
18
    end
19

20
    # @return [ String ] The separator used to split the string into an array
21
    def separator
1✔
22
      attrs[:separator] || ','
67✔
23
    end
24

25
    # See OptBase#normalize
26
    # @param [ Array ] values
27
    def normalize(values)
1✔
28
      values.each_with_index do |value, index|
2✔
29
        values[index] = super(value)
4✔
30
      end
31
      values
2✔
32
    end
33
  end
34
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc