Class: FileXmlContentRule
- Defined in:
- lib/technologist/rules/file_xml_content_rule.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#css_selector ⇒ Object
Returns the value of attribute css_selector.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
Attributes inherited from Rule
Instance Method Summary collapse
Methods inherited from Rule
Constructor Details
This class inherits a constructor from Rule
Instance Attribute Details
#css_selector ⇒ Object
Returns the value of attribute css_selector.
5 6 7 |
# File 'lib/technologist/rules/file_xml_content_rule.rb', line 5 def css_selector @css_selector end |
#file_name ⇒ Object
Returns the value of attribute file_name.
5 6 7 |
# File 'lib/technologist/rules/file_xml_content_rule.rb', line 5 def file_name @file_name end |
Instance Method Details
#matches?(repository) ⇒ Boolean
7 8 9 10 11 12 |
# File 'lib/technologist/rules/file_xml_content_rule.rb', line 7 def matches?(repository) !!repository.file_with_content_exists?(file_name) do |content| xml = Nokogiri::XML(content) xml.css(css_selector).any? end end |