Sha256: 32c1eb2068967039b89d25fcc92615d754b5097bf7093ae0859cb84ac1ad8723

Contents?: true

Size: 1.2 KB

Versions: 45

Compression:

Stored size: 1.2 KB

Contents

require "webrat/selenium/application_servers/base"

module Webrat
  module Selenium
    module ApplicationServers
      class Rails < Webrat::Selenium::ApplicationServers::Base

        def start
          system start_command
        end

        def stop
          silence_stream(STDOUT) do
            system stop_command
          end
        end

        def fail
          $stderr.puts
          $stderr.puts
          $stderr.puts "==> Failed to boot the Rails application server... exiting!"
          $stderr.puts
          $stderr.puts "Verify you can start a Rails server on port #{Webrat.configuration.application_port} with the following command:"
          $stderr.puts
          $stderr.puts "    #{start_command}"
          exit
        end

        def pid_file
          prepare_pid_file("#{RAILS_ROOT}/tmp/pids", "mongrel_selenium.pid")
        end

        def start_command
        "mongrel_rails start -d --chdir='#{RAILS_ROOT}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &"
        end

        def stop_command
        "mongrel_rails stop -c #{RAILS_ROOT} --pid #{pid_file}"
        end

      end
    end
  end
end

Version data entries

45 entries across 45 versions & 16 rubygems

Version Path
diabolo-webrat-0.5.1 lib/webrat/selenium/application_servers/rails.rb
dstrelau-webrat-0.5.1 lib/webrat/selenium/application_servers/rails.rb
emipair-webrat-0.0.1 lib/webrat/selenium/application_servers/rails.rb
garnierjm-webrat-0.4.5 lib/webrat/selenium/application_servers/rails.rb
hardbap-webrat-0.5.1 lib/webrat/selenium/application_servers/rails.rb
hardbap-webrat-0.5.2 lib/webrat/selenium/application_servers/rails.rb
winton-sum-0.1.0 vendor/webrat/lib/webrat/selenium/application_servers/rails.rb
winton-sum-0.1.1 vendor/webrat/lib/webrat/selenium/application_servers/rails.rb
thoughtbot-webrat-0.7.2.pre lib/webrat/selenium/application_servers/rails.rb
honkster-webrat-0.7.1.2 lib/webrat/selenium/application_servers/rails.rb
honkster-webrat-0.7.1.1 lib/webrat/selenium/application_servers/rails.rb
revo-webrat-0.7.0.1 lib/webrat/selenium/application_servers/rails.rb
webrat-0.7.1 lib/webrat/selenium/application_servers/rails.rb
revo-webrat-0.7.0 lib/webrat/selenium/application_servers/rails.rb
revo-webrat-0.7.1.pre lib/webrat/selenium/application_servers/rails.rb
webrat-0.7.0 lib/webrat/selenium/application_servers/rails.rb
honkster-webrat-0.6.0.10 lib/webrat/selenium/application_servers/rails.rb
honkster-webrat-0.6.0.9 lib/webrat/selenium/application_servers/rails.rb
darkofabijan-webrat-0.6.1 lib/webrat/selenium/application_servers/rails.rb
kbaum-webrat-0.5.1 lib/webrat/selenium/application_servers/rails.rb