• 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/boolean.rb
1
# frozen_string_literal: true
2

3
module OptParseValidator
1✔
4
  # Implementation of the Boolean Option
5
  class OptBoolean < OptBase
1✔
6
    TRUE_PATTERN  = /\A(true|t|yes|y|1)\z/i.freeze
1✔
7
    FALSE_PATTERN = /\A(false|f|no|n|0)\z/i.freeze
1✔
8

9
    # @return [ Boolean ]
10
    def validate(value)
1✔
11
      value = value.to_s
38✔
12

13
      return true if value.match(TRUE_PATTERN)
38✔
14
      return false if value.match(FALSE_PATTERN)
6✔
15

16
      raise Error, 'Invalid boolean value, expected true|t|yes|y|1|false|f|no|n|0'
1✔
17
    end
18
  end
19
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

© 2026 Coveralls, Inc