Sha256: cdca93b51870c6be03c6caeba63b39f204b82935e14ae41942478f0c0c3b6673

Contents?: true

Size: 600 Bytes

Versions: 3

Compression:

Stored size: 600 Bytes

Contents

module RevealCK
  module Builders
    #
    # Public: A Builder knows how to execute BuildTasks. These are added
    # via add_task, and executed via build!
    #
    # It is expected to be subclassed, and the subclass must override
    # register_tasks.
    #
    class Builder

      def register_tasks
        raise 'Subclasses must implement register_tasks'
      end

      def add_task(description, &action)
        @tasks << BuildTask.new(description, action)
      end

      def build!
        register_tasks unless @tasks
        @tasks.each { |task| task.go }
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reveal-ck-0.2.0 lib/reveal-ck/builders/builder.rb
reveal-ck-0.1.8 lib/reveal-ck/builders/builder.rb
reveal-ck-0.1.7 lib/reveal-ck/builders/builder.rb