Sha256: 01c1ed67e839d85f021d4bc7af57ca5aa851e114dada8081c54c515877f2aad3

Contents?: true

Size: 507 Bytes

Versions: 13

Compression:

Stored size: 507 Bytes

Contents

# frozen_string_literal: true

module Lite
  module Command
    class Sequence < Base

      def self.step(*commands, **options)
        commands.flatten.each do |command|
          steps << Step.new(command, options)
        end
      end

      def self.steps
        @steps ||= []
      end

      def call
        self.class.steps.each do |step|
          next unless step.run?(self)

          cmd = step.command.call(context)
          throw!(cmd) if cmd.bad?
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
lite-command-3.3.2 lib/lite/command/sequence.rb
lite-command-3.3.1 lib/lite/command/sequence.rb
lite-command-3.3.0 lib/lite/command/sequence.rb
lite-command-3.2.1 lib/lite/command/sequence.rb
lite-command-3.2.0 lib/lite/command/sequence.rb
lite-command-3.1.5 lib/lite/command/sequence.rb
lite-command-3.1.4 lib/lite/command/sequence.rb
lite-command-3.1.3 lib/lite/command/sequence.rb
lite-command-3.1.2 lib/lite/command/sequence.rb
lite-command-3.1.1 lib/lite/command/sequence.rb
lite-command-3.1.0 lib/lite/command/sequence.rb
lite-command-3.0.1 lib/lite/command/sequence.rb
lite-command-3.0.0 lib/lite/command/sequence.rb