Class: CreateGithubRelease::CommandLine::Validations::ValidateChangelogPath Private
- Inherits:
-
Base
- Object
- Base
- CreateGithubRelease::CommandLine::Validations::ValidateChangelogPath
- Defined in:
- lib/create_github_release/command_line/validations.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Validate that the change log path (if given) is a valid path
Instance Method Summary collapse
-
#error ⇒ String+
private
Called when valid? is
false
to return the error messages. -
#valid? ⇒ Boolean
private
Returns
true
if#changelog_path
is nil or is a valid regular file path.
Methods inherited from Base
Constructor Details
This class inherits a constructor from CreateGithubRelease::CommandLine::Validations::Base
Instance Method Details
#error ⇒ String+
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Called when valid? is false
to return the error messages
283 284 285 286 287 288 289 |
# File 'lib/create_github_release/command_line/validations.rb', line 283 def error if valid_path?(.changelog_path) "The change log path '#{.changelog_path}' is not a regular file" else "The change log path '#{.changelog_path}' is not a valid path" end end |
#valid? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns true
if #changelog_path
is nil or is a valid regular file path
275 276 277 278 |
# File 'lib/create_github_release/command_line/validations.rb', line 275 def valid? .changelog_path.nil? || (valid_path?(.changelog_path) && File.file?(File.(.changelog_path))) end |