Sha256: 1001010251344f2ac01cd74495ef8f830072625235ace0dfd77dec6ac363011a

Contents?: true

Size: 1001 Bytes

Versions: 47

Compression:

Stored size: 1001 Bytes

Contents

module Excon
  module Test
    module Plugin
      module Server
        module Unicorn
          def start(app_str = app, bind_uri = bind)
            bind_uri = URI.parse(bind_uri) unless bind_uri.is_a? URI::Generic
            is_unix_socket = (bind_uri.scheme == "unix")
            if is_unix_socket
              bind_str = bind_uri.to_s
            else
              host = bind_uri.host.gsub(/[\[\]]/, '')
              bind_str = "#{host}:#{bind_uri.port}"
            end
            args = [ 
              'unicorn', 
              '--no-default-middleware', 
              '-l',
              bind_str,  
              app_str
            ]
            open_process(*args)
            line = ''
            until line =~ /worker\=0 ready/
              line = error.gets
              fatal_time = elapsed_time > timeout
              raise 'unicorn server has taken too long to start' if fatal_time
            end
            true
          end
        end
      end
    end
  end
end

Version data entries

47 entries across 44 versions & 4 rubygems

Version Path
excon-0.85.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.84.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.83.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.82.0 lib/excon/test/plugin/server/unicorn.rb
coingecko_client-0.1.2 vendor/bundle/ruby/2.7.0/gems/excon-0.75.0/lib/excon/test/plugin/server/unicorn.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/excon-0.78.1/lib/excon/test/plugin/server/unicorn.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/excon-0.81.0/lib/excon/test/plugin/server/unicorn.rb
excon-0.81.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.80.1 lib/excon/test/plugin/server/unicorn.rb
excon-0.80.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.79.0 lib/excon/test/plugin/server/unicorn.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/excon-0.78.1/lib/excon/test/plugin/server/unicorn.rb
excon-0.78.1 lib/excon/test/plugin/server/unicorn.rb
excon-0.78.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.76.0 lib/excon/test/plugin/server/unicorn.rb
coingecko_client-0.1.1 vendor/bundle/ruby/2.7.0/gems/excon-0.75.0/lib/excon/test/plugin/server/unicorn.rb
coingecko_client-0.1.0 vendor/bundle/ruby/2.7.0/gems/excon-0.75.0/lib/excon/test/plugin/server/unicorn.rb
excon-0.75.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.74.0 lib/excon/test/plugin/server/unicorn.rb
excon-0.73.0 lib/excon/test/plugin/server/unicorn.rb