Sha256: b7a8bc196622548d0e67dbdd6d967139996e17498fd93e880de4ee927c0344e6

Contents?: true

Size: 576 Bytes

Versions: 4

Compression:

Stored size: 576 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)
      output = `/usr/libexec/PlistBuddy -c 'Print :#{property}' '#{plist}'`
      raise "Error reading #{property} from #{plist}" unless $?.success?
      output.strip
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wrapp-0.7.0 lib/wrapp/app_info.rb
wrapp-0.6.0 lib/wrapp/app_info.rb
wrapp-0.5.1 lib/wrapp/app_info.rb
wrapp-0.5.0 lib/wrapp/app_info.rb