### Home Classes Methods

### In Files

- common/src/rb/lib/selenium/webdriver/platform.rb

### Methods

- #bitsize
- #engine
- #find_binary
- #home
- #ironruby?
- #jruby?
- #mac?
- #make_writable
- #os
- #ruby187?
- #ruby19?
- #win?
- #wrap_in_quotes_if_necessary

### Class/Module Index

Quicksearch

- Selenium
- Selenium::WebDriver
- Selenium::WebDriver::BridgeHelper
- Selenium::WebDriver::ChildProcess
- Selenium::WebDriver::ChildProcess::IronRubyProcess
- Selenium::WebDriver::ChildProcess::JRubyProcess
- Selenium::WebDriver::ChildProcess::WindowsProcess
- Selenium::WebDriver::Chrome
- Selenium::WebDriver::Chrome::Bridge
- Selenium::WebDriver::Chrome::CommandExecutor
- Selenium::WebDriver::Chrome::Launcher
- Selenium::WebDriver::Chrome::Launcher::MacOSXLauncher
- Selenium::WebDriver::Chrome::Launcher::UnixLauncher
- Selenium::WebDriver::Chrome::Launcher::WindowsLauncher
- Selenium::WebDriver::Driver
- Selenium::WebDriver::DriverExtensions
- Selenium::WebDriver::DriverExtensions::TakesScreenshot
- Selenium::WebDriver::Element
- Selenium::WebDriver::Error
- Selenium::WebDriver::Error::ElementNotDisplayedError
- Selenium::WebDriver::Error::ElementNotEnabledError
- Selenium::WebDriver::Error::ElementNotSelectableError
- Selenium::WebDriver::Error::ExpectedError
- Selenium::WebDriver::Error::IndexOutOfBoundsError
- Selenium::WebDriver::Error::InvalidCookieDomainError
- Selenium::WebDriver::Error::NoCollectionError
- Selenium::WebDriver::Error::NoScriptResultError
- Selenium::WebDriver::Error::NoStringError
- Selenium::WebDriver::Error::NoStringLengthError
- Selenium::WebDriver::Error::NoStringWrapperError
- Selenium::WebDriver::Error::NoSuchCollectionError
- Selenium::WebDriver::Error::NoSuchDocumentError
- Selenium::WebDriver::Error::NoSuchDriverError
- Selenium::WebDriver::Error::NoSuchElementError
- Selenium::WebDriver::Error::NoSuchFrameError
- Selenium::WebDriver::Error::NoSuchWindowError
- Selenium::WebDriver::Error::NullPointerError
- Selenium::WebDriver::Error::ObsoleteElementError
- Selenium::WebDriver::Error::ServerError
- Selenium::WebDriver::Error::TimeOutError
- Selenium::WebDriver::Error::UnableToSetCookieError
- Selenium::WebDriver::Error::UnexpectedJavascriptError
- Selenium::WebDriver::Error::UnhandledError
- Selenium::WebDriver::Error::UnknownCommandError
- Selenium::WebDriver::Error::UnknownScriptResultError
- Selenium::WebDriver::Error::UnsupportedOperationError
- Selenium::WebDriver::Error::WebDriverError
- Selenium::WebDriver::FileReaper
- Selenium::WebDriver::Find
- Selenium::WebDriver::Firefox
- Selenium::WebDriver::Firefox::Binary
- Selenium::WebDriver::Firefox::Bridge
- Selenium::WebDriver::Firefox::Launcher
- Selenium::WebDriver::Firefox::Profile
- Selenium::WebDriver::Firefox::ProfilesIni
- Selenium::WebDriver::Firefox::Util
- Selenium::WebDriver::IE
- Selenium::WebDriver::IE::Bridge
- Selenium::WebDriver::IE::Kernel32
- Selenium::WebDriver::IE::Lib
- Selenium::WebDriver::IE::Util
- Selenium::WebDriver::Keys
- Selenium::WebDriver::Navigation
- Selenium::WebDriver::Options
- Selenium::WebDriver::Platform
- Selenium::WebDriver::Remote
- Selenium::WebDriver::Remote::Bridge
- Selenium::WebDriver::Remote::Capabilities
- Selenium::WebDriver::Remote::Http
- Selenium::WebDriver::Remote::Http::Common
- Selenium::WebDriver::Remote::Http::Curb
- Selenium::WebDriver::Remote::Http::Default
- Selenium::WebDriver::Remote::Response
- Selenium::WebDriver::TargetLocator
- Selenium::WebDriver::Timeouts
- Dir
- SocketError
- String

No matching classes.

# Selenium::WebDriver::Platform

@private

### Public Instance Methods

bitsize() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 44
    def bitsize
      @bitsize ||= (
        if defined?(FFI::BITSIZE)
          FFI::BITSIZE
        elsif defined?(FFI)
          FFI.type_size :pointer
        elsif jruby?
          Integer(ENV_JAVA['sun.arch.data.model'])
        else
          1.size == 4 ? 32 : 64
        end
      )
    end

engine() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 16
    def engine
      @engine ||= (
        if defined? RUBY_ENGINE
          RUBY_ENGINE.to_sym
        else
          :ruby
        end
      )
    end

find_binary(*binary_names) click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 90
    def find_binary(*binary_names)
      paths = ENV['PATH'].split(File::PATH_SEPARATOR)
      binary_names.map! { |n| "#{n}.exe" } if win?

      binary_names.each do |binary_name|
        paths.each do |path|
          exe = File.join(path, binary_name)
          return exe if File.executable?(exe)
        end
      end

      nil
    end

home() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 11
    def home
      # jruby has an issue with ENV['HOME'] on Windows
      @home ||= jruby? ? ENV_JAVA['user.home'] : ENV['HOME']
    end

ironruby?() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 62
    def ironruby?
      engine == :ironruby
    end

jruby?() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 58
    def jruby?
      engine == :jruby
    end

mac?() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 78
    def mac?
      os == :macosx
    end

make_writable(file) click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 86
    def make_writable(file)
      File.chmod 0766, file
    end

os() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 26
    def os
      @os ||= (
        host_os = RbConfig::CONFIG['host_os']
        case host_os
        when /mswin|msys|mingw32/
          :windows
        when /darwin|mac os/
          :macosx
        when /linux/
          :linux
        when /solaris|bsd/
          :unix
        else
          raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
        end
      )
    end

ruby187?() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 66
    def ruby187?
      !!(RUBY_VERSION =~ /^1\.8\.7/)
    end

ruby19?() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 70
    def ruby19?
      !!(RUBY_VERSION =~ /^1\.9/)
    end

win?() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 74
    def win?
      os == :windows
    end

wrap_in_quotes_if_necessary(str) click to toggle source

    # File common/src/rb/lib/selenium/webdriver/platform.rb, line 82
    def wrap_in_quotes_if_necessary(str)
      win? ? %{"#{str}"} : str
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.