Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the project alive? #199

Open
randaalex opened this issue Jul 1, 2021 · 13 comments
Open

Is the project alive? #199

randaalex opened this issue Jul 1, 2021 · 13 comments

Comments

@randaalex
Copy link

It hasn't seen any activity for over a year. Is it still active?

@Buzzkill-McSquare
Copy link

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.

@billgloff
Copy link

Thinking about using https://github.com/sunny/actor instead as it was inspired by Interactor and seems a bit more active.

@serradura
Copy link

serradura commented Jul 3, 2021

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.

@corytheboyd-cirrusmd
Copy link

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

@cmer
Copy link

cmer commented Jul 16, 2021

Check out https://github.com/adomokos/light-service, it's quite nice.

@batmanbury
Copy link

Looks like the creator got a job at GitHub...

@gaffneyc
Copy link
Member

Hey folks 👋

It hasn't seen any activity for over a year

And what a year it's been right? Interactor hasn't been a priority this last year as... well... * gestures wildly at everything *

Is it still active?

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.

@alexcameron89
Copy link

@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?

@pboling
Copy link

pboling commented Apr 16, 2022

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.

@javierav
Copy link

@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.

@pboling
Copy link

pboling commented Mar 11, 2024

I ended up using https://github.com/sunny/actor, and then wrote a TTY/CLI for it.

@Buzzkill-McSquare
Copy link

I also switched to using the actor gem.

@mainameiz
Copy link

mainameiz commented Mar 17, 2024

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.
E.g. you want to track _current_interactor_class . Not everbody want this feature. But you don't need to wait for the gem maintainer to add this feature into the gem.
You can do it yourself just for your project:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests