Implement a more solid Environment system by considering them as first class citizens.
Environment are specified in environments/, and can be defined with a fairly simple class definition
# in environments/new_environment.rb
class NewEnvironment < Shark::Environment
# Register the name of the environment used to reference it from the
# command line. Multiple names can be registered using repeated calls.
cli_name :new_env
cli_name :other_name
# Environments also provide 4 hookable methods: configure, load,
# finalize, and start. Each method has `before` and `after` hooks. This
# example modifies the middleware list before it is finalized into a stack.
before(:finalize) do
# Remove all middlewares of a given type.
remove_middleware Transport
# Add new middlewares anywhere in the list. This example inserts a
# middleware immediately after the Agency.
insert_middleware NewMiddleware, after: Shark::Agency
end
end
Running the system with this environment is done with the --environment or -e options on the command line:
$ bin/shark -e new_env
More functionality will likely be added in the future. However, this is now a working feature, so it can be merged immediately.
Implement a more solid Environment system by considering them as first class citizens.
Environment are specified in
environments/
, and can be defined with a fairly simple class definitionRunning the system with this environment is done with the
--environment
or-e
options on the command line:More functionality will likely be added in the future. However, this is now a working feature, so it can be merged immediately.