module WarpEngine
WarpEngine is the mountable Rails engine behind a game catalog: it ingests CI builds of software titles, stores their releases and assets, and serves them through the catalog API, the admin API and the ActiveAdmin screens.
The host configures it once in an initializer:
WarpEngine.configure do file_container_path Rails.root.join("storage/files") site_url "https://games.example.org" end
The pluggable parts (storage, images, CI, access policy) are reached through the module accessors below; each falls back to the engine’s default adapter.
Constants
- API_VERSION
-
The version of the catalog API envelope served to clients.
- FileShowInputDto
-
Input of
WarpEngine::FileService#show:path, the requested file path relative to the file container. - VERSION
-
The gem version of the engine.
- VERSION_HEADER
-
The name of the HTTP header that carries the engine
VERSION.
Public Class Methods
Source
# File lib/warp_engine.rb, line 79 def self.access_policy AccessPolicy.current end
Returns the configured access policy (see WarpEngine::AccessPolicy.current).
Source
# File lib/warp_engine.rb, line 74 def self.ci CI.adapter end
Returns the configured CI adapter (see WarpEngine::CI.adapter).
Source
# File lib/warp_engine.rb, line 40 def self.config @config ||= Configuration.new end
Returns the process-wide WarpEngine::Configuration, creating it with its defaults on first use.
# File lib/warp_engine.rb, line 52 def self.configure(&block) block.arity.zero? ? Configuration::DSL.apply(config, &block) : yield(config) end
Configures the engine. A block without arguments is evaluated with the WarpEngine::Configuration::DSL; a block taking one argument is yielded the WarpEngine::Configuration itself:
WarpEngine.configure { site_url "https://games.example.org" } WarpEngine.configure { |config| config.file_container_path = "/srv/files" }
Returns the result of the block.
Source
# File lib/warp_engine.rb, line 85 def self.identity_configured? config.access_token_owner_class.present? end
Returns true when the host configured an access_token_owner_class, which enables client sign-in and subject authentication.
Source
# File lib/warp_engine.rb, line 69 def self.images Images.adapter end
Returns the configured image adapter (see WarpEngine::Images.adapter).
Source
# File lib/warp_engine.rb, line 59 def self.instruments_publish? true end
Returns true: the engine emits the warp_engine.publish ActiveSupport notification whenever a release is published, so hosts may subscribe to it.
Source
# File lib/warp_engine.rb, line 64 def self.storage Storage.adapter end
Returns the configured storage adapter (see WarpEngine::Storage.adapter).
Source
# File lib/warp_engine.rb, line 34 def self.table_name_prefix "" end
Returns the table name prefix for the engine’s models: the empty string, so the engine’s tables carry no warp_engine_ prefix.