Sha256: 1f0e3d4e555f0b240797555de79bcc17a3314ba44dba8fb31ac4fe50b8af82b4

Contents?: true

Size: 628 Bytes

Versions: 8

Compression:

Stored size: 628 Bytes

Contents

module GitCompound
  # Task module and factory
  #
  module Task
    extend self

    def factory(name, type, manifest, &block)
      case
      # manifest task
      when type.nil? || type == :manfiest then task_class = TaskSingle
      # task for each component defined in manifest
      when type == :each                  then task_class = TaskEach
      # task for all descendant components of manifest
      when type == :all                   then task_class = TaskAll
      else
        raise GitCompoundError, "Unrecognized task type `#{type}`"
      end

      task_class.new(name, manifest, &block)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
git_compound-0.2.2 lib/git_compound/task.rb
git_compound-0.2.1 lib/git_compound/task.rb
git_compound-0.2.0 lib/git_compound/task.rb
git_compound-0.1.2 lib/git_compound/task.rb
git_compound-0.1.1 lib/git_compound/task.rb
git_compound-0.1.0 lib/git_compound/task.rb
git_compound-0.0.10 lib/git_compound/task.rb
git_compound-0.0.9 lib/git_compound/task.rb