Class: Pod::Target::Commands::Parser
- Inherits:
- 
      Object
      
        - Object
- Pod::Target::Commands::Parser
 
- Defined in:
- lib/pod/target/commands/resolve/parser.rb
Instance Attribute Summary collapse
- 
  
    
      #regex  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute regex. 
- 
  
    
      #workspace  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute workspace. 
- 
  
    
      #workspace_dir  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute workspace_dir. 
Instance Method Summary collapse
- #all_targets ⇒ Object
- 
  
    
      #initialize(workspace_path, filter)  ⇒ Parser 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Parser. 
- #projects ⇒ Object
Constructor Details
#initialize(workspace_path, filter) ⇒ Parser
Returns a new instance of Parser.
| 9 10 11 12 13 14 15 16 17 18 | # File 'lib/pod/target/commands/resolve/parser.rb', line 9 def initialize(workspace_path, filter) if workspace_path.nil? prompt = TTY::Prompt.new prompt.error("Error! Cannot find workspace path") exit 1 end @workspace_dir = File.dirname(workspace_path) @workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path) @regex = filter end | 
Instance Attribute Details
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
| 8 9 10 | # File 'lib/pod/target/commands/resolve/parser.rb', line 8 def regex @regex end | 
#workspace ⇒ Object (readonly)
Returns the value of attribute workspace.
| 8 9 10 | # File 'lib/pod/target/commands/resolve/parser.rb', line 8 def workspace @workspace end | 
#workspace_dir ⇒ Object (readonly)
Returns the value of attribute workspace_dir.
| 8 9 10 | # File 'lib/pod/target/commands/resolve/parser.rb', line 8 def workspace_dir @workspace_dir end | 
Instance Method Details
#all_targets ⇒ Object
| 20 21 22 23 | # File 'lib/pod/target/commands/resolve/parser.rb', line 20 def all_targets @projects ||= projects projects.flat_map(&:targets).select { |target| target.name =~ /#{regex}/ } end | 
#projects ⇒ Object
| 25 26 27 28 29 30 | # File 'lib/pod/target/commands/resolve/parser.rb', line 25 def projects all_project_paths = @workspace.file_references.map(&:path) all_project_paths.map do |project_path| Xcodeproj::Project.open(File.(project_path, @workspace_dir)) end end |