class Wrapp::DMGBuilder

Constants

DEFAULT_FILESYSTEM

Attributes

app_path[R]

Public Class Methods

new(app_path, opts = {}) click to toggle source
# File lib/wrapp/dmg_builder.rb, line 7
def initialize(app_path, opts = {})
  @app_path = app_path
  @opts = opts
end

Public Instance Methods

create() click to toggle source
# 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() click to toggle source
# File lib/wrapp/dmg_builder.rb, line 21
def filesystem
  @opts.fetch(:filesystem) { DEFAULT_FILESYSTEM }
end
volume_name() click to toggle source
# File lib/wrapp/dmg_builder.rb, line 25
def volume_name
  @opts.fetch(:volume_name) { app.name }
end

Private Instance Methods

app() click to toggle source
# File lib/wrapp/dmg_builder.rb, line 39
def app
  @app_info ||= AppInfo.new(app_path)
end
dmg_filename() click to toggle source

def source_path @opts ? File.dirname(app_path) : app_path end

# File lib/wrapp/dmg_builder.rb, line 35
def dmg_filename
  "#{app.full_name}.dmg"
end