Sha256: 141fe52fbc14db9703c445ac2564ee64056d93ba8e120af5acdf1e7e1a932d24

Contents?: true

Size: 849 Bytes

Versions: 7

Compression:

Stored size: 849 Bytes

Contents

module Elasticity

  module JobFlowStep

    @@step_klasses = []

    def to_aws_step(jobflow_step)
      raise RuntimeError, '#to_aws_step is required to be defined on all job flow steps.'
    end

    def requires_installation?
      self.class.requires_installation?
    end

    def aws_installation_step
      self.class.aws_installation_step
    end

    module ClassMethods

      def requires_installation?
        false
      end

      def aws_installation_step
        raise RuntimeError, '.aws_installation_step is required to be defined when a step requires installation (e.g. Pig, Hive).'
      end

    end

    def self.included(base)
      base.extend(ClassMethods)
      @@step_klasses << base
    end

    def self.steps_requiring_installation
      @@step_klasses.select{|klass| klass.requires_installation?}
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
elasticity-2.5.1 lib/elasticity/job_flow_step.rb
elasticity-2.5 lib/elasticity/job_flow_step.rb
elasticity-2.4 lib/elasticity/job_flow_step.rb
elasticity-2.3.1 lib/elasticity/job_flow_step.rb
elasticity-2.3 lib/elasticity/job_flow_step.rb
elasticity-2.2 lib/elasticity/job_flow_step.rb
elasticity-2.1.1 lib/elasticity/job_flow_step.rb