Sha256: 685ce60be40079398dd0cb2b024b31706441afa2d8a84e737118a3356acaa1ea

Contents?: true

Size: 569 Bytes

Versions: 8

Compression:

Stored size: 569 Bytes

Contents

module Wrapp
  class DMGBuilder
    attr_reader :app_path

    def initialize(app_path, opts = {})
      @app_path = app_path
      @opts = opts
    end

    def create
      system("hdiutil create '#{dmg_filename}' -srcfolder '#{source_path}'")
    end

    private

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

    def dmg_filename
      "#{app.full_name}.dmg"
    end

    def app
      @app_info ||= AppInfo.new(plist)
    end

    def plist
      File.join(app_path, 'Contents', 'Info.plist')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wrapp-0.5.1 lib/wrapp/dmg_builder.rb
wrapp-0.5.0 lib/wrapp/dmg_builder.rb
wrapp-0.4.0 lib/wrapp/dmg_builder.rb
wrapp-0.3.0 lib/wrapp/dmg_builder.rb
wrapp-0.2.3 lib/wrapp/dmg_builder.rb
wrapp-0.2.2 lib/wrapp/dmg_builder.rb
wrapp-0.2.1 lib/wrapp/dmg_builder.rb
wrapp-0.2.0 lib/wrapp/dmg_builder.rb