Skip to content

Releases: taylorthurlow/interaktor

v0.4.0

18 Feb 19:03
1e58250
Compare
Choose a tag to compare

Added

  • An ensure_hook method has been added which will run a piece of code after normal interaktor execution, regardless of whether or not the interaktor ran successfully. The method accepts a symbol (corresponding to an instance method name to call), or a block (containing code to run). These hooks, like others, will run in the order in which they are defined. (@nicolas-heinig, #16)

v0.3.0

02 Jul 00:52
86d81fa
Compare
Choose a tag to compare

Buckle up, we've got some breaking changes.

Fixed

  • Some methods that previously raised NoMethodError exceptions now raise NotImplementedError exceptions. This is done in an effort to denote these methods as "abstract" methods. NoMethodError is a subclass of Exception and not StandardError so it is generally a bad idea to raise them without understanding the consequences, especially in a library such as this.

Changed

  • Attributes of all kinds (input, success, and failure attributes) are now defined using dry-schema's schema DSL. Check out the revised README for more details. This change should prevent me from having to reinvent the wheel for validating attributes in general.
  • Organizers now pass their input attributes into all organized interaktors' input attributes.
  • Organized interaktors now pass their success attributes into all successive organized interaktors' input attributes.
    • For example, when an organizer organizes interaktors A, B, C, and D, in that order, A's success attributes may be used as input attributes of B, C, and D. C's success attributes may be used as input attributes of D.
  • Some exception messages are now benefiting from increased excellence.

Added

  • Explicit support for Ruby 3.0.

v0.2.0

02 Nov 23:42
95f7ea3
Compare
Choose a tag to compare

Fixed

  • Interaktors which have success attributes defined will now cause an exception to be raised if their execution finishes completely without a call to #success!.

Changed

  • Organizers now pass their own attributes to the first interaktor, and each interaktor passes its attributes (required, optional, and success) to the next interaktor in the chain. When passing attributes between interaktors, attributes unknown to the receiving interaktor are dropped. See the organizer section of the README for more detail.
  • Providing unknown options to the failure and success DSL methods will now raise an exception.
  • Passing a non-hash argument to .call or .call! will raise a more helpful exception.

Added

  • Added custom error classes for the various error cases instead of raising RuntimeErrors.

v0.1.5

29 Sep 23:58
8232d68
Compare
Choose a tag to compare

Fixed

  • Using #success! to return early from an interaktor should no longer prevent organizers from working properly.

Changed

  • An error will now be raised when you call an interaktor and an attribute is provided that is not defined on the interaktor class.

Added

  • Added default option to the optional DSL method, which can be optionally provided to set a default value for an optional attribute, which will be set if the attribute is not set when called

v0.1.4

24 Sep 21:51
0d20b56
Compare
Choose a tag to compare

Changed

  • Removed the public accessor for context now that the entire interface for an interaktor's context should consist of explicitly defined attributes. This is a breaking change as it is no longer backwards-compatible with Interactor. No major version bump because this is definitely not 1.0 yet, and I can't imagine anyone is using this at this point.
  • Relaxed zeitwerk dependency version from ~> 2.3.1 to ~> 2.0

Added

  • Added #success! method for early-exit functionality, and their accompanying success attribute DSL method

v0.1.3

13 Jul 17:41
7241e75
Compare
Choose a tag to compare

This is the first public release. It can act as a drop-in replacement for Interactor, assuming you change the module name references to Interaktor.