-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Is the project alive? #199
Comments
The latest outstanding PR was posted in May, which suggest that there are at least people trying to contribute. Though the PR wasn't made by an existing contributor, and I don't know who owns the project and where they're at. |
Thinking about using https://github.com/sunny/actor instead as it was inspired by Interactor and seems a bit more active. |
I would like to recommend this project https://github.com/serradura/u-case (the project has 305 stars 😊), the interactor is great and it and other gems gave me the ideas and experience to make my own abstraction to handle business operations. |
I'm contemplating just replacing it with our own PORO implementation that actually supports call signatures with keyword arguments. The context API in this gem is just too loose and error prone for sizable production applications |
Check out https://github.com/adomokos/light-service, it's quite nice. |
Looks like the creator got a job at GitHub... |
Hey folks 👋
And what a year it's been right? Interactor hasn't been a priority this last year as... well... * gestures wildly at everything *
Yes, it's still being maintained. There was some work toward a v4 but, as @batmanbury points out, Steve has moved on to other things and he was the driving force behind that work and I haven't had a need to pick it up. We would love some help maintaining it and moving it forward. I've had a few people reach out this last year offering to help but haven't had the bandwidth until recently to even get that started. So if you'd like to help out let me know and we can start that conversation. |
@gaffneyc we use this gem quite a bit on my team at work, and I'd love to help improve it. Is addressing general issue tickets or cards in the v4.0 project the best way to help? |
Another project that was based on this one is https://github.com/jonatasdaniel/interaptor - though I haven't used any of these tools yet, I'm now trying to figure out which one I like best. |
@gaffneyc What is the status of this project? I would like to help with the maintenance but other developers have previously offered and it seems that this remains stopped. |
I ended up using https://github.com/sunny/actor, and then wrote a TTY/CLI for it. |
I also switched to using the |
The beauty of this gem is in its simplicity. It has just a few lines of code, but it allows you to make almost everything you want on top of it. module TrackCurrentInteractorClass
extend ActiveSupport::Concern
included do
before do
context._current_interactor_class = self
end
end
end
class Test
include Interactor
include TrackCurrentInteractorClass
def call
puts "Interactor: #{context._current_interactor_class}"
end
end Output: > Test.call
Interactor: #<Test:0x000055779a9dc788>
=> #<Interactor::Context _current_interactor_class=#<Test:0x000055779a9dc788 @context=#<Interactor::Context ...>>> Or you want to validate input parameters. I can do it with dry-validation: # Extension for Interactor which adds strictness to the context
#
# @example
# class Foo
# include Interactor
# include Interactor::ContextSchema
#
# validate_with_schema(
# Dry::Validation.Schema do
# required(:name).filled(:str?)
# end
# )
# end
module Interactor
module ContextSchema
Error = Class.new(RuntimeError)
module Validation
def call(context = {})
return super(context) unless validation_schema
validate_context(context)
super(context)
end
def call!(context = {})
return super(context) unless validation_schema
validate_context(context)
super(context)
end
private
def validate_context(context)
result = validation_schema.call(context.to_h)
raise Error, result.errors if result.failure?
end
end
def self.included(mod)
mod.singleton_class.prepend(Validation)
mod.extend(ClassMethods)
end
module ClassMethods
def validate_with_schema(schema)
@_validation_schema = schema
end
def validation_schema
@_validation_schema
end
end
end
end |
It hasn't seen any activity for over a year. Is it still active?
The text was updated successfully, but these errors were encountered: