Sha256: df148c0b8402b53dd20f4975c4d4cd9148094907a99a6867c01f9b6bd9028802

Contents?: true

Size: 1.02 KB

Versions: 33

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'eac_cli/definition'
require 'eac_cli/definition/error'
require 'eac_cli/runner/class_runner'

module EacCli
  module Runner
    module AfterClassMethods
      # @return [EacCli::Runner::ClassRunner]
      def class_runner(runner_context_args)
        ::EacCli::Runner::ClassRunner.new(self, runner_context_args)
      end

      def create(*runner_context_args)
        class_runner(runner_context_args).create
      end

      def run(*runner_context_args)
        class_runner(runner_context_args).run
      end

      def runner_definition(&block)
        @runner_definition ||= super_runner_definition
        begin
          @runner_definition.instance_eval(&block) if block
        rescue ::EacCli::Definition::Error => _e
          raise ::EacCli::Definition::Error, "Definition error for #{self}"
        end
        @runner_definition
      end

      def super_runner_definition
        superclass.try(:runner_definition).if_present(&:dup) || ::EacCli::Definition.new
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
eac_cli-0.42.0 lib/eac_cli/runner/after_class_methods.rb
eac_cli-0.40.1 lib/eac_cli/runner/after_class_methods.rb
eac_cli-0.40.0 lib/eac_cli/runner/after_class_methods.rb
eac_cli-0.39.0 lib/eac_cli/runner/after_class_methods.rb
eac_cli-0.38.1 lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.82.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.81.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.80.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.79.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.78.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.77.1 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.77.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_cli-0.38.0 lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.76.1 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.76.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.75.2 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_cli-0.37.0 lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.75.1 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.75.0 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb
eac_tools-0.74.1 sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb