Sha256: 3f5df52789da81b39d6dd7bd2b980f2db11ae2ac88c137f4e0e6b4e8ab12aaab

Contents?: true

Size: 380 Bytes

Versions: 9

Compression:

Stored size: 380 Bytes

Contents

module Akami
  module XPathHelper
    def at_xpath(node, xpath)
      return unless node
      node.at_xpath local_name_xpath(xpath)
    end

    def xpath(node, xpath)
      return unless node
      node.xpath local_name_xpath(xpath)
    end

    def local_name_xpath(xpath)
      xpath.gsub(%r{([/]*)([A-Za-z]+)([/]*)}) { "#{$1}*[local-name()='#{$2}']#{$3}" }
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
akami-1.3.3 lib/akami/xpath_helper.rb
akami-1.3.2 lib/akami/xpath_helper.rb
akami-1.3.1 lib/akami/xpath_helper.rb
akami-1.3.0 lib/akami/xpath_helper.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/akami-1.2.2/lib/akami/xpath_helper.rb
akami-1.2.2 lib/akami/xpath_helper.rb
akami-1.2.1 lib/akami/xpath_helper.rb
akami-1.2.0 lib/akami/xpath_helper.rb
akami-1.1.0 lib/akami/xpath_helper.rb