Sha256: 50dd5cb1d58089b39a0f1aca40949614cf4e9839e9c385bd5f10fb26777698e3

Contents?: true

Size: 769 Bytes

Versions: 4

Compression:

Stored size: 769 Bytes

Contents

module Polytrix
  module Runners
    module Middleware
      class FeatureExecutor
        include Polytrix::Core::FileSystemHelper
        def initialize(app)
          @app   = app
        end

        def call(env)
          challenge_runner = env[:challenge_runner]
          env_file = env[:env_file]
          source_file = env[:source_file]
          relative_source_file = relativize(source_file, env[:basedir])
          command = challenge_runner.challenge_command(env_file, relative_source_file)
          execution_result = challenge_runner.run_command command
          env[:result] = Result.new(execution_result: execution_result, source_file: env[:source_file].to_s)
          @app.call env
          env[:result]
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
polytrix-0.1.2 lib/polytrix/runners/middleware/feature_executor.rb
polytrix-0.1.1 lib/polytrix/runners/middleware/feature_executor.rb
polytrix-0.1.0 lib/polytrix/runners/middleware/feature_executor.rb
polytrix-0.1.0.pre lib/polytrix/runners/middleware/feature_executor.rb