Sha256: 2dcbde6c22c2f0b07ae0cde6082ffb2745520a6a64d5b6e309296678dd5bddb3

Contents?: true

Size: 696 Bytes

Versions: 11

Compression:

Stored size: 696 Bytes

Contents

module ScrewUnit
  module Resources
    class SuiteCompletion
      def initialize(kill_server_on_completion)
        @kill_server_on_completion = kill_server_on_completion
      end

      def kill_server_on_completion?
        @kill_server_on_completion
      end

      def post(request)
        puts request.body.string unless request.body.string == "success"
        if kill_server_on_completion?
          $exit_status = (request.body.string == "success") ? 0 : 1
          Thread.new do
            sleep 1 # give the server thread a moment to send the response before we kill it
            $thin_server.stop!
          end
        end
        [200, {}, "OK"]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
coolerator.vision-0.2.10 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.9 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.8 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.7 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.6 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.5 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.4 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.3 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.2 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.1 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb
coolerator.vision-0.2.0 spec/support/vendor/screw-unit/lib/screw_unit/resources/suite_completion.rb