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

wpscanteam / OptParseValidator / 13484526228

23 Feb 2025 03:44PM UTC coverage: 100.0%. Remained the same
13484526228

push

github

web-flow
Merge pull request #164 from wpscanteam/dependabot/bundler/rubocop-tw-1.72.2

Update rubocop requirement from ~> 1.28.1 to ~> 1.72.2

141 of 144 branches covered (97.92%)

15 of 15 new or added lines in 12 files covered. (100.0%)

414 of 414 relevant lines covered (100.0%)

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

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

13
      return true if value.match(TRUE_PATTERN)
152✔
14
      return false if value.match(FALSE_PATTERN)
24✔
15

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