Sha256: cf9dff07a09bd728e11c8cb050f363cc52349fec6be400fd76a8dce8b09145c4

Contents?: true

Size: 309 Bytes

Versions: 4

Compression:

Stored size: 309 Bytes

Contents

require 'technologist/rules/rule'
require 'nokogiri'

class FileXmlContentRule < Rule
  attr_accessor :file_name, :css_selector

  def matches?(repository)
    !!repository.file_with_content_exists?(file_name) do |content|
      xml = Nokogiri::XML(content)
      xml.css(css_selector).any?
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
technologist-0.6.1 lib/technologist/rules/file_xml_content_rule.rb
technologist-0.6.0 lib/technologist/rules/file_xml_content_rule.rb
technologist-0.5.0 lib/technologist/rules/file_xml_content_rule.rb
technologist-0.4.0 lib/technologist/rules/file_xml_content_rule.rb