class WarpEngine::ReleaseAsset
One file of a release: its kind (one of KINDS, unique within the release) and the absolute path of the file in the file container. Soft-deletable; saving or deleting one refreshes the shelves of the software’s platform.
Constants
- KINDS
-
Every asset kind: the cartridge, source, HTML build and docs, and the native builds per operating system and architecture.
Public Class Methods
Source
# File app/models/warp_engine/release_asset.rb, line 29 def self.for_relative_path(relative) absolute = File.join(WarpEngine.config.file_container_path, relative.to_s) find_by(path: absolute) || where("path LIKE ?", "%/#{sanitize_sql_like(relative.to_s)}").first end
Finds the asset of the file at relative, a path relative to the file container: by its exact absolute path, else by the first path ending in it. Returns the WarpEngine::ReleaseAsset or nil.
Public Instance Methods
Source
# File app/models/warp_engine/release_asset.rb, line 24 def shelf_platform = release&.software&.platform
Returns the platform of the release’s software, whose shelves to refresh.