Skip to content

Commit 5dc4fb9

Browse files
committed
refactor: make BANNER constant private and simplify validation checks for quiet and verbose options
1 parent 19b781c commit 5dc4fb9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

exe/revert-github-release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Parser
7676
COMMAND
7777
end
7878

79-
BANNER = <<~BANNER.freeze
79+
private_constant BANNER = <<~BANNER.freeze
8080
Usage:
8181
#{File.basename($PROGRAM_NAME)} [--help | --version]
8282

lib/create_github_release/command_line/validations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class ValidateQuiet < Base
119119
# @return [Boolean]
120120
# @api private
121121
def valid?
122-
options.quiet == true || options.quiet == false
122+
[true, false].include? options.quiet
123123
end
124124

125125
# Called when valid? is `false` to return the error messages
@@ -137,7 +137,7 @@ class ValidateVerbose < Base
137137
# @return [Boolean]
138138
# @api private
139139
def valid?
140-
options.verbose == true || options.verbose == false
140+
[true, false].include? options.verbose
141141
end
142142

143143
# Called when valid? is `false` to return the error messages

0 commit comments

Comments
 (0)