Class: XcodeXml
- Inherits:
-
Object
- Object
- XcodeXml
- Defined in:
- lib/check_xcode_xmls/helpers.rb
Direct Known Subclasses
Class Method Summary collapse
- .check_if_file_uses_autolayout(file, doc_xpath) ⇒ Object
- .extension ⇒ Object
- .search_constraints_without_identifiers(file, doc_xpath) ⇒ Object
Class Method Details
.check_if_file_uses_autolayout(file, doc_xpath) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/check_xcode_xmls/helpers.rb', line 8 def self.check_if_file_uses_autolayout(file, doc_xpath) # <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" # propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> if doc_xpath.attribute('useAutolayout').nil? return ["#{file}: doesn't use autolayout."] end nil end |
.extension ⇒ Object
4 5 6 |
# File 'lib/check_xcode_xmls/helpers.rb', line 4 def self.extension 'implement in subclass' end |
.search_constraints_without_identifiers(file, doc_xpath) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/check_xcode_xmls/helpers.rb', line 17 def self.search_constraints_without_identifiers(file, doc_xpath) result = [] doc_xpath.children.each do |child| array = search_constraints_without_identifiers(file, child) # puts '----' # puts child if child.name == 'constraint' if child.attr('identifier').nil? array.push("#{file}: constraint with id #{child.attr('id')} doesn't have an identifier.") end end result += array unless array.nil? end result end |