Class: Wrapp::DMGBuilder
- Inherits:
-
Object
- Object
- Wrapp::DMGBuilder
- Defined in:
- lib/wrapp/dmg_builder.rb
Constant Summary collapse
- DEFAULT_FILESYSTEM =
'HFS+'
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
Instance Method Summary collapse
- #create ⇒ Object
- #filesystem ⇒ Object
-
#initialize(app_path, opts = {}) ⇒ DMGBuilder
constructor
A new instance of DMGBuilder.
- #volume_name ⇒ Object
Constructor Details
#initialize(app_path, opts = {}) ⇒ DMGBuilder
Returns a new instance of DMGBuilder.
7 8 9 10 |
# File 'lib/wrapp/dmg_builder.rb', line 7 def initialize(app_path, opts = {}) @app_path = app_path @opts = opts end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
5 6 7 |
# File 'lib/wrapp/dmg_builder.rb', line 5 def app_path @app_path end |
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/wrapp/dmg_builder.rb', line 12 def create cmd = %w(hdiutil create) cmd << "-srcfolder '#{app_path}'" cmd << "-fs '#{filesystem}'" cmd << "-volname '#{volume_name}'" cmd << "'#{dmg_filename}'" system(cmd.join(' ')) end |
#filesystem ⇒ Object
21 22 23 |
# File 'lib/wrapp/dmg_builder.rb', line 21 def filesystem @opts.fetch(:filesystem) { DEFAULT_FILESYSTEM } end |
#volume_name ⇒ Object
25 26 27 |
# File 'lib/wrapp/dmg_builder.rb', line 25 def volume_name @opts.fetch(:volume_name) { app.name } end |