class Pandora::Models::App
Attributes
Application dependencies
Application name
Project directory (.xcodeproj)
Application target name
Application test target name
Workspace directory (.xcworkspace)
Public Class Methods
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
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