class Loader
The domain specific language for loading configuration files.
Definitions
def load(*features)
- deprecated
Load specific features into the current configuration.
Signature
- deprecated
Use
requireinstead.-
parameter
featuresArray(Symbol) The features to load.
Implementation
def load(*features)
features.each do |feature|
case feature
when Symbol
require File.join(__dir__, "environment", "#{feature}.rb")
else
raise LoadError, "Unsure about how to load #{feature}!"
end
end
end
def host(name, *parents, &block)
- deprecated
Define a host with the specified name.
Adds root and authority keys.
Signature
- deprecated
Use
serviceandinclude Falcon::Environment::Serverinstead.-
parameter
nameString The name of the environment, usually a hostname.
Implementation
def host(name, *parents, &block)
@configuration.add(
merge(*parents, name: name, root: @root, authority: name, &block)
)
end
def proxy(name, *parents, &block)
- deprecated
Define a proxy with the specified name.
Adds root and authority keys.
Signature
- deprecated
Use
serviceandinclude Falcon::Environment::Proxyinstead.-
parameter
nameString The name of the environment, usually a hostname.
Implementation
def proxy(name, *parents, &block)
@configuration.add(
merge(:proxy, *parents, name: name, root: @root, authority: name, &block)
)
end
def rack(name, *parents, &block)
- deprecated
Define a rack application with the specified name.
Adds root and authority keys.
Signature
- deprecated
Use
serviceandinclude Falcon::Environment::Rackinstead.-
parameter
nameString The name of the environment, usually a hostname.
Implementation
def rack(name, *parents, &block)
@configuration.add(
merge(:rack, *parents, name: name, root: @root, authority: name, &block)
)
end
def supervisor(&block)
- deprecated
Define a supervisor instance
Signature
- deprecated
Use
serviceandinclude Falcon::Environment::Supervisorinstead.
Implementation
def supervisor(&block)
name = File.join(@root, "supervisor")
@configuration.add(
merge(:supervisor, name: name, root: @root, &block)
)
end
def merge(*parents, **initial, &block)
Build a new environment with the specified name and the given parents.
Signature
-
parameter
nameString -
parameter
parentsArray(Symbol) -
yields
{...} The block that will generate the environment.
Implementation
def merge(*parents, **initial, &block)
facets = parents.map{|parent| Environment::LEGACY_ENVIRONMENTS.fetch(parent)}
::Async::Service::Environment.build(*facets, **initial, &block)
end