lib/watir/xpath_support.rb in watir-6.10.0 vs lib/watir/xpath_support.rb in watir-6.10.1

- old
+ new

@@ -1,20 +1,20 @@ -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 - - def self.downcase(value) - "translate(#{value},'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" - end - - end # XpathSupport -end # Watir +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 + + def self.downcase(value) + "translate(#{value},'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" + end + + end # XpathSupport +end # Watir