Sha256: 86c313c97042d176a602a60dbd0be523728d5d449ac6b2ea4521053d63ab0519

Contents?: true

Size: 624 Bytes

Versions: 3

Compression:

Stored size: 624 Bytes

Contents

module Wrapp
  class DMGBuilder
    attr_reader :app_path

    class << self
      def run
        new(ARGV.first).create #TODO: Test this!
      end
    end

    def initialize(app_path)
      @app_path = app_path
    end

    def create
      create_dmg
    end

    private

    def create_dmg
      system("hdiutil create '#{dmg_path}' -srcfolder '#{app_path}'")
    end

    def dmg_path
      dmg_filename
    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

3 entries across 3 versions & 1 rubygems

Version Path
wrapp-0.1.2 lib/wrapp/dmg_builder.rb
wrapp-0.1.1-x86_64-darwin-12 lib/wrapp/dmg_builder.rb
wrapp-0.1.0 lib/wrapp/dmg_builder.rb