Class: HotCocoa::ApplicationBuilder::Configuration
- Defined in:
- lib/hotcocoa/application_builder.rb
Overview
support CFBundleDocumentTypes
support CFBundleShortVersionString
support NSHumanReadableCopyright
support arbitrary info.plist key/value pairs
Instance Attribute Summary collapse
-
#agent ⇒ Boolean
readonly
Whether the app is an daemon with UI or a regular app.
-
#data_models ⇒ Array<String>
readonly
Any
.xcdatamodel
directories to compile and add to the app bundle. -
#embed_bs ⇒ Boolean
(also: #embed_bs?)
readonly
Whether or not to embed BridgeSupport files embedding the MacRuby framework.
-
#gems ⇒ Array<String>
readonly
An array of gem names to embed in the app bundle during deployment.
-
#icon ⇒ String
readonly
Path to the icon file.
-
#identifier ⇒ String
readonly
Reverse URL unique identifier.
-
#name ⇒ String
readonly
Name of the app.
-
#overwrite ⇒ Boolean
(also: #overwrite?)
readonly
Always make a clean build of the app.
-
#resources ⇒ Array<String>
readonly
Globbing patterns describing where to find resources that need to be copied into the app bundle.
-
#signature ⇒ String
readonly
Four letter code that is a signature of the bundle, defaults to '????' since most apps never set this value.
-
#sources ⇒ Array<String>
readonly
Globbing patterns describing where to find source code that needs to be copied into the app bundle.
-
#stdlib ⇒ Boolean
readonly
Whether to include the Ruby stdlib in the app.
-
#type ⇒ String
readonly
Four letter code identifying bundle type, the default value is 'APPL' to specify the bundle is an application.
-
#version ⇒ String
readonly
Version of the app.
Instance Method Summary collapse
- #icon_exists? ⇒ Boolean
-
#initialize(file) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(file) ⇒ Configuration
validation (sources should not be an empty array)
Returns a new instance of Configuration.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/hotcocoa/application_builder.rb', line 124 def initialize file yml = YAML.load(File.read(file)) @name = yml['name'] # mandatory @icon = yml['icon'] @identifier = yml['identifier'] || "com.#{@name}" @version = yml['version'] || '1.0' @sources = yml['sources'] || [] # this should be mandatory? @resources = yml['resources'] || [] @data_models = yml['data_models'] || [] @gems = yml['gems'] || [] @type = yml['type'] || 'APPL' @signature = yml['signature'] || '????' @overwrite = yml['overwrite'] == true ? true : false @agent = yml['agent'] == true ? '1' : '0' @stdlib = yml['stdlib'] == false ? false : true @embed_bs = yml['embed_bs'] == false ? false : true end |
Instance Attribute Details
#agent ⇒ Boolean (readonly)
Whether the app is an daemon with UI or a regular app
64 65 66 |
# File 'lib/hotcocoa/application_builder.rb', line 64 def agent @agent end |
#data_models ⇒ Array<String> (readonly)
Any .xcdatamodel
directories to compile and add to the app
bundle
77 78 79 |
# File 'lib/hotcocoa/application_builder.rb', line 77 def data_models @data_models end |
#embed_bs ⇒ Boolean (readonly) Also known as: embed_bs?
Whether or not to embed BridgeSupport files embedding the MacRuby framework
113 114 115 |
# File 'lib/hotcocoa/application_builder.rb', line 113 def @embed_bs end |
#gems ⇒ Array<String> (readonly)
An array of gem names to embed in the app bundle during deployment
106 107 108 |
# File 'lib/hotcocoa/application_builder.rb', line 106 def gems @gems end |
#icon ⇒ String (readonly)
Path to the icon file
44 45 46 |
# File 'lib/hotcocoa/application_builder.rb', line 44 def icon @icon end |
#identifier ⇒ String (readonly)
Reverse URL unique identifier
32 33 34 |
# File 'lib/hotcocoa/application_builder.rb', line 32 def identifier @identifier end |
#name ⇒ String (readonly)
Name of the app
22 23 24 |
# File 'lib/hotcocoa/application_builder.rb', line 22 def name @name end |
#overwrite ⇒ Boolean (readonly) Also known as: overwrite?
Always make a clean build of the app
120 121 122 |
# File 'lib/hotcocoa/application_builder.rb', line 120 def overwrite @overwrite end |
#resources ⇒ Array<String> (readonly)
Globbing patterns describing where to find resources that need to be copied into the app bundle
51 52 53 |
# File 'lib/hotcocoa/application_builder.rb', line 51 def resources @resources end |
#signature ⇒ String (readonly)
Four letter code that is a signature of the bundle, defaults to '????' since most apps never set this value
99 100 101 |
# File 'lib/hotcocoa/application_builder.rb', line 99 def signature @signature end |
#sources ⇒ Array<String> (readonly)
Globbing patterns describing where to find source code that needs to be copied into the app bundle
58 59 60 |
# File 'lib/hotcocoa/application_builder.rb', line 58 def sources @sources end |
#stdlib ⇒ Boolean (readonly)
Whether to include the Ruby stdlib in the app
70 71 72 |
# File 'lib/hotcocoa/application_builder.rb', line 70 def stdlib @stdlib end |
#type ⇒ String (readonly)
Four letter code identifying bundle type, the default value is 'APPL' to specify the bundle is an application
84 85 86 |
# File 'lib/hotcocoa/application_builder.rb', line 84 def type @type end |
#version ⇒ String (readonly)
Version of the app
38 39 40 |
# File 'lib/hotcocoa/application_builder.rb', line 38 def version @version end |
Instance Method Details
#icon_exists? ⇒ Boolean
142 143 144 |
# File 'lib/hotcocoa/application_builder.rb', line 142 def icon_exists? @icon ? File.exist?(@icon) : false end |