Class: Pandora::Models::App
- Inherits:
-
Object
- Object
- Pandora::Models::App
- Defined in:
- lib/pandora/models/app.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Application dependencies.
-
#name ⇒ Object
readonly
Application name.
-
#project_path ⇒ Object
readonly
Project directory (.xcodeproj).
-
#target_name ⇒ Object
readonly
Application target name.
-
#test_target_name ⇒ Object
readonly
Application test target name.
-
#workspace_path ⇒ Object
readonly
Workspace directory (.xcworkspace).
Class Method Summary collapse
-
.from_yml(name, yml) ⇒ App
Initializes an App from a YAML hash.
Instance Method Summary collapse
-
#initialize(name, project_path, workspace_path, target_name, test_target_name, dependencies) ⇒ App
constructor
Initializes an App.
Constructor Details
#initialize(name, project_path, workspace_path, target_name, test_target_name, dependencies) ⇒ App
Initializes an App.
32 33 34 35 36 37 38 39 40 41 42 |
# 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 |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Application dependencies
21 22 23 |
# File 'lib/pandora/models/app.rb', line 21 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Application name
6 7 8 |
# File 'lib/pandora/models/app.rb', line 6 def name @name end |
#project_path ⇒ Object (readonly)
Project directory (.xcodeproj)
9 10 11 |
# File 'lib/pandora/models/app.rb', line 9 def project_path @project_path end |
#target_name ⇒ Object (readonly)
Application target name
15 16 17 |
# File 'lib/pandora/models/app.rb', line 15 def target_name @target_name end |
#test_target_name ⇒ Object (readonly)
Application test target name
18 19 20 |
# File 'lib/pandora/models/app.rb', line 18 def test_target_name @test_target_name end |
#workspace_path ⇒ Object (readonly)
Workspace directory (.xcworkspace)
12 13 14 |
# File 'lib/pandora/models/app.rb', line 12 def workspace_path @workspace_path end |
Class Method Details
.from_yml(name, yml) ⇒ App
Initializes an App from a YAML hash.
49 50 51 52 53 54 55 56 57 58 59 60 |
# 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 |