Sha256: 5503faca971040e3b3c715317f998f4231b43dfb384ce57ee4a2b6c6c63b729a

Contents?: true

Size: 324 Bytes

Versions: 10

Compression:

Stored size: 324 Bytes

Contents

# encoding: utf-8
module Watir
  module XpathSupport

    def self.escape(value)
      if value.include? "'"
        parts = value.split("'", -1).map { |part| "'#{part}'" }
        string = parts.join(%{,"'",})

        "concat(#{string})"
      else
        "'#{value}'"
      end
    end

  end # XpathSupport
end # Watir

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
watir-webdriver-0.6.1 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.6.0 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.8 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.7 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.6 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.5 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.4 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.3 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.2 lib/watir-webdriver/xpath_support.rb
watir-webdriver-0.5.1 lib/watir-webdriver/xpath_support.rb