WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/command_line_boss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ def succeeded? = @error_messages.empty?
#
def failed? = !succeeded?

VALIDATION_METHOD_REGEXP = /^validate_(.+)$/

DEFINITION_METHOD_REGEXP = /^define_(.+)_option$/

private

# This is how you should add an error message to the error_messages array
Expand Down Expand Up @@ -208,6 +204,9 @@ def parse_options
#
def parse_arguments; end

VALIDATION_METHOD_REGEXP = /^validate_(.+)$/
private_constant :VALIDATION_METHOD_REGEXP

# Validate the command line options and remaining arguments
#
# Calls all validation methods defined by this class. Validation
Expand All @@ -224,6 +223,9 @@ def validate
private_methods.select { |m| m.to_s.match?(VALIDATION_METHOD_REGEXP) }.each { |m| send(m) }
end

DEFINITION_METHOD_REGEXP = /^define_(.+)_option$/
private_constant :DEFINITION_METHOD_REGEXP

# Set the default values for the command line options
#
# @return [void]
Expand Down