Releases: akuzko/zen-service
Releases · akuzko/zen-service
v1.1.0
[email protected]
[email protected]
Since it's the first release of the gem under new name, there's no "breaking" changes, despite the fact that lots of them have been made. Gem has new Plugin API, and the list of included plugins was changed as well.
Plugins included out of the box:
:assertions
:context
:execution_cache
:policies
:rescue
:status
:validation
In addition, new module - Zen::Service::SpecHelpers
is available to ease testing of services by providing stub_service
method.
v0.4.0
v0.3.0
New Features
- Added
:delegate
option to:sentry
plugin that will delegate specified methods to command - Added ability to define sentry logic inline in command classes with
.sentry
class method. This method also accepts:delegate
option for conveniency - Command's
args
andopts
reader methods are auto-delegated in corresponding sentries. Both inline and defined as dedicated classes.
v0.2.0
New Features
- Added command execution delegation. This can be done by calling
~@
method on an executed command as last expression of command's#run
method. This will assign bothstatus
andresult
of executed command. For example:
class Todos::Create < Excom::Command
opts :project, :params
def run
if (todo = project.todos.create(params))
result ok: todo.as_json
else
result unprocessable_entity: todo.errors
end
end
end
module Users
class Todos::Create < Excom::Command
use :context
delegate :project, to: :context
opts :params
def run
~::Todos::Create.(project: project, params: params)
end
end
end
v0.1.1
Patch Updates
- Changed default value for context when using
:context
plugin from empty hash tonil
. This is more expected and actually allows to assign custom hash-like objects, likeHashie::Mash
instances as base context. Since excom tries to merge new context into existing one, having empty hash as initial context prevented using custom hash-like objects. - Updated README slightly