Skip to content

Releases: akuzko/zen-service

v1.1.0

09 Oct 22:14
Compare
Choose a tag to compare

What's Changed

  • Add ability to use block when using a plugin by @akuzko in #1

New Contributors

  • @akuzko made their first contribution in #1

Full Changelog: v1.0.0...v1.1.0

[email protected]

24 Mar 08:14
Compare
Choose a tag to compare

[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

11 Feb 13:34
Compare
Choose a tag to compare

New Features

  • Added :dry_types plugin which allows you to use dry-types to define command attributes instead of default args and opts. Read more on Wiki

v0.3.0

04 Feb 20:03
Compare
Choose a tag to compare

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 and opts reader methods are auto-delegated in corresponding sentries. Both inline and defined as dedicated classes.

v0.2.0

14 Jan 11:12
Compare
Choose a tag to compare

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 both status and result 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

11 Dec 22:07
Compare
Choose a tag to compare

Patch Updates

  • Changed default value for context when using :context plugin from empty hash to nil. This is more expected and actually allows to assign custom hash-like objects, like Hashie::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