class WarpEngine::UploadInputDto
Validated input of POST /build/upload. name and version must match NAME_FORMAT, file must be an uploaded file, and its file name must start with <name>-<version>. or <name>-<version>-.
Constants
- NAME_FORMAT
-
Characters allowed in a software name and a version: letters, digits, dot, underscore and hyphen.
Attributes
The software name, the version string, the uploaded file (an ActionDispatch::Http::UploadedFile) and the optional expected SHA-256 hex digest.
The software name, the version string, the uploaded file (an ActionDispatch::Http::UploadedFile) and the optional expected SHA-256 hex digest.
The software name, the version string, the uploaded file (an ActionDispatch::Http::UploadedFile) and the optional expected SHA-256 hex digest.
The software name, the version string, the uploaded file (an ActionDispatch::Http::UploadedFile) and the optional expected SHA-256 hex digest.
Public Instance Methods
Source
# File app/dtos/warp_engine/upload_input_dto.rb, line 31 def error_message = errors.full_messages.to_sentence
Returns the validation errors joined into one sentence.
Source
# File app/dtos/warp_engine/upload_input_dto.rb, line 24 def filename return nil unless file.respond_to?(:original_filename) File.basename(file.original_filename.to_s) end
Returns the base name of the uploaded file, or nil when file is not an upload.