Class: ChocBomb::Configuration

Inherits:
Object
  • Object
show all
Includes:
Tasks
Defined in:
lib/chocbomb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Tasks

#define_tasks

Constructor Details

#initialize {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:



83
84
85
86
87
88
89
90
91
# File 'lib/chocbomb.rb', line 83

def initialize
  @plist = Plist::parse_xml(File.expand_path('Info.plist'))
  @files = {}

  yield self if block_given?
  
  default
  define_tasks
end

Instance Attribute Details

#app_icon_positionObject

Position of the icon app



25
26
27
# File 'lib/chocbomb.rb', line 25

def app_icon_position
  @app_icon_position
end

#appcast_filenameObject (readonly)

Returns the value of attribute appcast_filename.



105
106
107
# File 'lib/chocbomb.rb', line 105

def appcast_filename
  @appcast_filename
end

#applications_icon_positionObject

Position of the Application symlink icon



28
29
30
# File 'lib/chocbomb.rb', line 28

def applications_icon_position
  @applications_icon_position
end

#background_fileObject

The background image



22
23
24
# File 'lib/chocbomb.rb', line 22

def background_file
  @background_file
end

#base_urlObject

Returns the value of attribute base_url.



13
14
15
# File 'lib/chocbomb.rb', line 13

def base_url
  @base_url
end

#build_optionsObject

Build options



40
41
42
# File 'lib/chocbomb.rb', line 40

def build_options
  @build_options
end

#build_pathObject (readonly)

Returns the value of attribute build_path.



96
97
98
# File 'lib/chocbomb.rb', line 96

def build_path
  @build_path
end

#build_typeObject

Build type (Release, Debug, …)



34
35
36
# File 'lib/chocbomb.rb', line 34

def build_type
  @build_type
end

#bundleObject (readonly)

Returns the value of attribute bundle.



100
101
102
# File 'lib/chocbomb.rb', line 100

def bundle
  @bundle
end

#dmg_src_folderObject (readonly)

Returns the value of attribute dmg_src_folder.



99
100
101
# File 'lib/chocbomb.rb', line 99

def dmg_src_folder
  @dmg_src_folder
end

#dsa_signatureObject (readonly)

Returns the value of attribute dsa_signature.



106
107
108
# File 'lib/chocbomb.rb', line 106

def dsa_signature
  @dsa_signature
end

#filesObject (readonly)

Returns the value of attribute files.



103
104
105
# File 'lib/chocbomb.rb', line 103

def files
  @files
end

#hostObject

Returns the value of attribute host.



12
13
14
# File 'lib/chocbomb.rb', line 12

def host
  @host
end

#icon_sizeObject

Returns the value of attribute icon_size.



42
43
44
# File 'lib/chocbomb.rb', line 42

def icon_size
  @icon_size
end

#icon_text_sizeObject

Returns the value of attribute icon_text_size.



43
44
45
# File 'lib/chocbomb.rb', line 43

def icon_text_size
  @icon_text_size
end

#minimum_osx_versionObject

Returns the value of attribute minimum_osx_version.



19
20
21
# File 'lib/chocbomb.rb', line 19

def minimum_osx_version
  @minimum_osx_version
end

#nameObject (readonly)

Returns the value of attribute name.



93
94
95
# File 'lib/chocbomb.rb', line 93

def name
  @name
end

#pkgObject (readonly)

Returns the value of attribute pkg.



98
99
100
# File 'lib/chocbomb.rb', line 98

def pkg
  @pkg
end

#pkg_nameObject (readonly)

Returns the value of attribute pkg_name.



97
98
99
# File 'lib/chocbomb.rb', line 97

def pkg_name
  @pkg_name
end

#pkg_relative_urlObject (readonly)

Returns the value of attribute pkg_relative_url.



109
110
111
# File 'lib/chocbomb.rb', line 109

def pkg_relative_url
  @pkg_relative_url
end

#private_keyObject

Returns the value of attribute private_key.



17
18
19
# File 'lib/chocbomb.rb', line 17

def private_key
  @private_key
end

#release_notesObject

Returns the value of attribute release_notes.



16
17
18
# File 'lib/chocbomb.rb', line 16

def release_notes
  @release_notes
end

#release_notes_templateObject (readonly)

Returns the value of attribute release_notes_template.



111
112
113
# File 'lib/chocbomb.rb', line 111

def release_notes_template
  @release_notes_template
end

#su_feed_urlObject

Returns the value of attribute su_feed_url.



14
15
16
# File 'lib/chocbomb.rb', line 14

def su_feed_url
  @su_feed_url
end

#targetObject

Target



37
38
39
# File 'lib/chocbomb.rb', line 37

def target
  @target
end

#versionObject (readonly)

Returns the value of attribute version.



94
95
96
# File 'lib/chocbomb.rb', line 94

def version
  @version
end

#versionless_pkg_nameObject (readonly)

Returns the value of attribute versionless_pkg_name.



108
109
110
# File 'lib/chocbomb.rb', line 108

def versionless_pkg_name
  @versionless_pkg_name
end

#volume_backgroundObject (readonly)

Returns the value of attribute volume_background.



101
102
103
# File 'lib/chocbomb.rb', line 101

def volume_background
  @volume_background
end

#volume_iconObject

Icns for the volume icon



31
32
33
# File 'lib/chocbomb.rb', line 31

def volume_icon
  @volume_icon
end

#volume_pathObject (readonly)

Returns the value of attribute volume_path.



95
96
97
# File 'lib/chocbomb.rb', line 95

def volume_path
  @volume_path
end

Instance Method Details

#file(*args, &block) ⇒ Object

Add an explicit file/bundle/folder into the DMG Examples:

file 'build/Release/SampleApp.app', :position => [50, 100]
file :target_bundle, :position => [50, 100]
file proc { 'README.txt' }, :position => [50, 100]
file :position => [50, 100] { 'README.txt' }

Required option:

+:position+ - two item array [x, y] window position

Options:

+:name+    - override the name of the project when mounted in the DMG
+:exclude+ - do not include files/folders


56
57
58
59
60
61
# File 'lib/chocbomb.rb', line 56

def file(*args, &block)
  path_or_helper, options = args.first.is_a?(Hash) ? [block, args.first] : [args.first, args.last]
  throw "add_files #{path_or_helper}, :position => [x,y] option is missing" unless options[:position]
  
  @files[path_or_helper] = options
end

Add the whole project as a mounted item; e.g. a TextMate bundle Examples:

add_link "http://github.com/drnic/choctop", :name => 'Github', :position => [50, 100]
add_link "http://github.com/drnic/choctop", 'Github.webloc', :position => [50, 100]

Required option:

+:position+ - two item array [x, y] window position
+:name+    - override the name of the project when mounted in the DMG


70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/chocbomb.rb', line 70

def link(url, *options)
  name = options.first if options.first.is_a?(String)
  options = options.last || {}
  options[:url] = url
  options[:name] = name if name
  throw "add_link :position => [x,y] option is missing" unless options[:position]
  throw "add_link :name => 'Name' option is missing" unless options[:name]
  options[:name].gsub!(/(\.webloc|\.url)$/, '')
  options[:name] += ".webloc"
  
  @files[options[:name]] = options
end