Class: Umbrella::XcodeProjParser
- Inherits:
-
Object
- Object
- Umbrella::XcodeProjParser
- Defined in:
- lib/umbrellalinter/xcodeprojparser.rb
Instance Attribute Summary collapse
-
#fix ⇒ Object
readonly
Returns the value of attribute fix.
-
#framework_target_name ⇒ Object
readonly
Returns the value of attribute framework_target_name.
-
#import_files ⇒ Object
readonly
Returns the value of attribute import_files.
-
#umbrella_header ⇒ Object
readonly
Returns the value of attribute umbrella_header.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ XcodeProjParser
constructor
A new instance of XcodeProjParser.
- #parse ⇒ Object
Constructor Details
#initialize(options) ⇒ XcodeProjParser
13 14 15 16 17 18 19 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 13 def initialize() @import_files = .fetch(:import_files) @fix = .fetch(:fix) @umbrella_header = .fetch(:umbrella_header) @framework_target_name = .fetch(:framework_target_name) @project_files = {} end |
Instance Attribute Details
#fix ⇒ Object (readonly)
Returns the value of attribute fix.
7 8 9 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 7 def fix @fix end |
#framework_target_name ⇒ Object (readonly)
Returns the value of attribute framework_target_name.
7 8 9 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 7 def framework_target_name @framework_target_name end |
#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 |
#umbrella_header ⇒ Object (readonly)
Returns the value of attribute umbrella_header.
7 8 9 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 7 def umbrella_header @umbrella_header 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
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/umbrellalinter/xcodeprojparser.rb', line 21 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.chop] = "Public" end end end Umbrella::Validator.new({ :import_files => @import_files, :project_files => @project_files, :fix => @fix, :project_file_path => project_file_path, :umbrella_header => @umbrella_header, :framework_target_name => @framework_target_name }).validate end |