Sha256: 70fed875d90982d2809e656d7495a202eeb4e3ac2ca2499c1653595a1fe05f24

Contents?: true

Size: 833 Bytes

Versions: 5

Compression:

Stored size: 833 Bytes

Contents

module Excon
  module Test
    module Plugin
      module Server
        module Webrick
          def start(app_str = app, bind_uri = bind)
            bind_uri = URI.parse(bind_uri) unless bind_uri.is_a? URI::Generic
            host = bind_uri.host.gsub(/[\[\]]/, '')
            port = bind_uri.port.to_s
            open_process('rackup', '-s', 'webrick', '--host', host, '--port', port, app_str)
            process_stderr = ""
            line = ''
            until line =~ /HTTPServer#start/
              line = error.gets
              raise process_stderr if line.nil?
              process_stderr << line
              fatal_time = elapsed_time > timeout
              raise 'webrick server has taken too long to start' if fatal_time
            end
            true
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/excon-0.88.0/lib/excon/test/plugin/server/webrick.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/excon-0.88.0/lib/excon/test/plugin/server/webrick.rb
excon-0.88.0 lib/excon/test/plugin/server/webrick.rb
excon-0.87.0 lib/excon/test/plugin/server/webrick.rb
excon-0.86.0 lib/excon/test/plugin/server/webrick.rb