Sha256: 4c3ea2fb4176d47be434a446ee3603f54359be799c4271037d036376cbb788e9

Contents?: true

Size: 1.01 KB

Versions: 25

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true
module Dynflow
  # for cases the serialized action was renamed and it's not available
  # in the code base anymore.
  class Action::Missing < Dynflow::Action

    def self.generate(action_name)
      Class.new(self).tap do |klass|
        klass.singleton_class.send(:define_method, :name) do
          action_name
        end
      end
    end

    def plan(*args)
      raise StandardError,
            "The action class was not found and therefore plan phase failed, this can happen if the action was added/renamed but the executor was not restarted."
    end

    def run
      raise StandardError,
            "The action class was not found and therefore run phase failed, this can happen if the action was added/renamed but the executor was not restarted."
    end

    def finalize
      raise StandardError,
            "The action class was not found and therefore finalize phase failed, this can happen if the action was added/renamed but the executor was not restarted."
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
dynflow-1.8.2 lib/dynflow/action/missing.rb
dynflow-1.8.1 lib/dynflow/action/missing.rb
dynflow-1.8.0 lib/dynflow/action/missing.rb
dynflow-1.7.0 lib/dynflow/action/missing.rb
dynflow-1.6.11 lib/dynflow/action/missing.rb
dynflow-1.6.10 lib/dynflow/action/missing.rb
dynflow-1.6.8 lib/dynflow/action/missing.rb
dynflow-1.6.7 lib/dynflow/action/missing.rb
dynflow-1.6.6 lib/dynflow/action/missing.rb
dynflow-1.6.5 lib/dynflow/action/missing.rb
dynflow-1.6.4 lib/dynflow/action/missing.rb
dynflow-1.6.3 lib/dynflow/action/missing.rb
dynflow-1.6.2 lib/dynflow/action/missing.rb
dynflow-1.6.1 lib/dynflow/action/missing.rb
dynflow-1.4.9 lib/dynflow/action/missing.rb
dynflow-1.4.8 lib/dynflow/action/missing.rb
dynflow-1.5.0 lib/dynflow/action/missing.rb
dynflow-1.4.7 lib/dynflow/action/missing.rb
dynflow-1.4.6 lib/dynflow/action/missing.rb
dynflow-1.4.5 lib/dynflow/action/missing.rb