Sha256: 63a05e67fc6e113b425bdce1844db993baaf6f6030663fa45229aa09ff1a7547

Contents?: true

Size: 1.36 KB

Versions: 31

Compression:

Stored size: 1.36 KB

Contents

require 'rake'

module Henry

  class Task

    # The Henry Task implementation for Rake Tasks
    class RakeTask < Task

      # The temporary output file path for the RakeTask execution.
      #
      # @return [String] the output file path.
      OUT_PATH = 'rake.out'

      # The Rake Application name.
      #
      # @return [String] the rake application name.
      APPLICATION_NAME = 'rake'

      # Executes the Task and returns its results.
      def execute
        begin 
          Rake.application[self.application_name].invoke 
 
          self.execution.code = 'OK'
          self.execution.message = 'OK'
          self.execution.output = File.open(self.out_path, 'r').read
          self.execution.log = self.logger.log_as_hash
        rescue Exception => e
          self.execution.code = 'ERROR'
          self.execution.message = e.message
          self.execution.output = File.open(self.out_path, 'r').read
          self.execution.backtrace = e.backtrace
          self.execution.log = self.logger.log_as_hash
        end
      end

      # Configures the Task.
      #
      # @param [Hash] params the task params.
      # @param [Hash] extended_context task extended context.
      def configure(params, extended_context={}, options={})
      end

    end
  
  end

end

require_relative 'cucumber_task'
require_relative 'rspec_task'
require_relative 'minitest_task'

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
henry-container-0.1.68 lib/henry/task/rake_task.rb
henry-container-0.1.67 lib/henry/task/rake_task.rb
henry-container-0.1.66 lib/henry/task/rake_task.rb
henry-container-0.1.65 lib/henry/task/rake_task.rb
henry-container-0.1.64 lib/henry/task/rake_task.rb
henry-container-0.1.63 lib/henry/task/rake_task.rb
henry-container-0.1.62 lib/henry/task/rake_task.rb
henry-container-0.1.61 lib/henry/task/rake_task.rb
henry-container-0.1.60 lib/henry/task/rake_task.rb
henry-container-0.1.59 lib/henry/task/rake_task.rb
henry-container-0.1.58 lib/henry/task/rake_task.rb
henry-container-0.1.57 lib/henry/task/rake_task.rb
henry-container-0.1.56 lib/henry/task/rake_task.rb
henry-container-0.1.55 lib/henry/task/rake_task.rb
henry-container-0.1.54 lib/henry/task/rake_task.rb
henry-container-0.1.53 lib/henry/task/rake_task.rb
henry-container-0.1.52 lib/henry/task/rake_task.rb
henry-container-0.1.51 lib/henry/task/rake_task.rb
henry-container-0.1.50 lib/henry/task/rake_task.rb
henry-container-0.1.49 lib/henry/task/rake_task.rb