Sha256: 37bdfb0a5f247c29a855c6d33845ec5233677cb4f7ac57cd2bcbd22d44dd7055

Contents?: true

Size: 1022 Bytes

Versions: 16

Compression:

Stored size: 1022 Bytes

Contents

module Minke
  module Tasks
    class TaskRunner

      def initialize args
        @ruby_helper       = args[:ruby_helper]
        @copy_helper       = args[:copy_helper]
        @service_discovery = args[:service_discovery]
        @logger            = args[:logger_helper]
      end

      ##
      # execute the defined steps in the given Minke::Config::TaskRunSettings
      def run_steps steps
        execute_ruby_tasks steps.tasks unless steps.tasks == nil
        copy_assets steps.copy unless steps.copy == nil
      end

      private
      ##
      # execute an array of rake tasks
      def execute_ruby_tasks tasks
        tasks.each { |t| 
          @logger.debug "Executing task: #{t}"
          @ruby_helper.invoke_task(t, @logger)
        }
      end

      ##
      # copys the assets defined in the step
      def copy_assets assets
        assets.each do |a| 
          @logger.debug "Copy #{a.from} To #{a.to}"
          @copy_helper.copy_assets a.from, a.to
        end
      end

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
minke-1.15.0 lib/minke/tasks/task_runner.rb
minke-1.14.5 lib/minke/tasks/task_runner.rb
minke-1.14.4 lib/minke/tasks/task_runner.rb
minke-1.14.3 lib/minke/tasks/task_runner.rb
minke-1.14.2 lib/minke/tasks/task_runner.rb
minke-1.14.1 lib/minke/tasks/task_runner.rb
minke-1.14.0 lib/minke/tasks/task_runner.rb
minke-1.13.20 lib/minke/tasks/task_runner.rb
minke-1.13.19 lib/minke/tasks/task_runner.rb
minke-1.13.18 lib/minke/tasks/task_runner.rb
minke-1.13.16 lib/minke/tasks/task_runner.rb
minke-1.13.15 lib/minke/tasks/task_runner.rb
minke-1.13.14 lib/minke/tasks/task_runner.rb
minke-1.13.13 lib/minke/tasks/task_runner.rb
minke-1.13.12 lib/minke/tasks/task_runner.rb
minke-1.13.11 lib/minke/tasks/task_runner.rb