Sha256: 595c0e05eca4b517acbc2698a38100d14e9d233080b268d830467f928b8e43cf

Contents?: true

Size: 601 Bytes

Versions: 7

Compression:

Stored size: 601 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)
      raise "No property found: #{property}" unless
        properties.has_key?(property)
      properties[property].strip
    end

    private

    def properties
      Plist::parse_xml plist
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wrapp-0.2.3 lib/wrapp/app_info.rb
wrapp-0.2.2 lib/wrapp/app_info.rb
wrapp-0.2.1 lib/wrapp/app_info.rb
wrapp-0.2.0 lib/wrapp/app_info.rb
wrapp-0.1.2 lib/wrapp/app_info.rb
wrapp-0.1.1-x86_64-darwin-12 lib/wrapp/app_info.rb
wrapp-0.1.0 lib/wrapp/app_info.rb