Class: Umbrella::XcodeProjParser
- Inherits:
-
Object
- Object
- Umbrella::XcodeProjParser
- Defined in:
- lib/umbrellalinter/xcodeprojparser.rb
Instance Attribute Summary collapse
-
#import_files ⇒ Object
readonly
Returns the value of attribute import_files.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ XcodeProjParser
constructor
A new instance of XcodeProjParser.
- #parse ⇒ Object
Constructor Details
#initialize(options) ⇒ XcodeProjParser
Returns a new instance of XcodeProjParser.
13 14 15 16 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 13 def initialize() @import_files = .fetch(:import_files) @project_files = {} end |
Instance Attribute Details
#import_files ⇒ Object (readonly)
Returns the value of attribute import_files.
7 8 9 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 7 def import_files @import_files end |
Class Method Details
.perform(options) ⇒ Object
9 10 11 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 9 def self.perform() new().perform end |
Instance Method Details
#parse ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 18 def parse project_file_path = "" Dir["./**/project.pbxproj"].reject{ |f| f['./Pods'] }.each do |filename| project_file_path = filename break end IO.readlines(project_file_path).each do |line| if line.include? "in Headers" if line.include? "settings = {ATTRIBUTES = (Public" filename = line.split(/\/\* (.*?)in Headers \*\//)[1] @project_files[filename] = "Public" end end end Umbrella::Validator.new({ :import_files => @import_files, :project_files => @project_files }).validate end |