class Pandora::Models::App

Attributes

dependencies[R]

Application dependencies

name[R]

Application name

project_path[R]

Project directory (.xcodeproj)

target_name[R]

Application target name

test_target_name[R]

Application test target name

workspace_path[R]

Workspace directory (.xcworkspace)

Public Class Methods

from_yml(name, yml) click to toggle source

Initializes an App from a YAML hash. @param [String] application name. @param [Hash] hash that represents the app. @raise [StandardError] if any of the required attributes are missing (project_path, workspace_path, target_name) @return [App] initialized App.

# File lib/pandora/models/app.rb, line 49
def self.from_yml(name, yml)
  project_path = yml["project_path"]
  raise "The app #{name} doesn't include project_path attribute" unless project_path
  workspace_path = yml["workspace_path"]
  raise "The app #{name} doesn't include workspace_path attribute" unless workspace_path
  target_name = yml["target_name"]
  raise "The app #{name} doesn't include target_name attribute" unless target_name
  test_target_name = yml["test_target_name"]
  dependencies = yml["dependencies"]
  dependencies ||= []
  App.new(name, project_path, workspace_path, target_name, test_target_name, dependencies)
end
new(name, project_path, workspace_path, target_name, test_target_name, dependencies) click to toggle source

Initializes an App. @param [String] application name. @param [String] project path. @param [String] workspace path. @param [String] application main target name. @param [String] application main tests target name. @param [String] dependencies. @raise [StandardError] if any of the attributes has a wrong format. @return [App] initialized App.

# File lib/pandora/models/app.rb, line 32
def initialize(name, project_path, workspace_path, target_name, test_target_name, dependencies)
  @name = name
  @project_path = project_path
  raise "Wrong project path. It should be a .xcodeproj" unless @project_path.include?(".xcodeproj")
  @workspace_path = workspace_path
  raise "Wrong workspace path. It should be a .xcworkspace" unless @workspace_path.include?(".xcworkspace")
  @target_name = target_name
  @test_target_name = test_target_name
  @dependencies = dependencies
  raise "Dependencies must be an array" unless @dependencies.kind_of? Array
end