lib/github_bot/validator/base.rb
# Public: Validates the file extension for the provided file
#
# @param file [Sawyer::Resource] The file to evaluate
# @param extension [String] The extension type to evaluate
Validates the file extension for the provided file
Validates the file extension for the provided file
def validate_file_extension(file, extension)
        return if File.extname(file.filename) == ".#{extension}"
        feedback(
          path: file.filename,
          annotation_level: 'failure',
          message: "File suffix is incorrect, please use '.#{extension}'"
        )
      end
def validate_file_extension ( file , extension ) return if File . extname ( file . filename ) == ".#{extension}" feedback ( path : file . filename , annotation_level : 'failure' , message : "File suffix is incorrect, please use '.#{extension}'" ) end
Public: Validates the file extension for the provided file
Public : Validates the file extension for the provided file
file
The file to evaluate
The file to evaluate
extension
The extension type to evaluate
The extension type to evaluate