Sha256: 2a59b10e23ab15a2d8efc076960a53e2a97ac1ff32ab06eafcdb0f9c1ed46fd6

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

module Wrapp
  class AppInfo
    attr_reader :plist

    def initialize(plist)
      @plist = plist
    end

    def full_name
      separator = '_'
      [name.downcase, version].join(separator).gsub(/\s+/, separator)
    end

    def name
      get_property('CFBundleName')
    end

    def version
      get_property('CFBundleShortVersionString')
    end

    def get_property(property)
      command_line = Cocaine::CommandLine.new('/usr/libexec/PlistBuddy',
                                              '-c :cmd :plist')
      command_line.run(:cmd => "Print #{property}", :plist => plist).strip
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wrapp-0.4.0 lib/wrapp/app_info.rb