Sha256: 825ab53e61d2a1f8f63be789224d25ebf2d229cc655412e27dd347027e01dbfe

Contents?: true

Size: 780 Bytes

Versions: 10

Compression:

Stored size: 780 Bytes

Contents

require 'plist'
require 'pp'

module Xcode
  class InfoPlist
    def initialize(project, plist_location)
      @project = project
      
      @plist_location = File.expand_path(plist_location)
      unless File.exists?(@plist_location)
        puts 'Plist not found ' + @plist_location
        exit 1
      end
      @plist = Plist::parse_xml(@plist_location)
    end

    def marketing_version
      @plist['CFBundleShortVersionString']
    end

    def marketing_version=(version)
      @plist['CFBundleShortVersionString'] = version
    end

    def version
      @plist['CFBundleVersion']
    end

    def version=(version)
      @plist['CFBundleVersion'] = version.to_s
    end

    def save
      File.open(@plist_location, 'w') {|f| f << @plist.to_plist}
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
xcoder-0.0.10 lib/xcode/info_plist.rb
xcoder-0.0.9 lib/xcode/info_plist.rb
xcoder-0.0.8 lib/xcode/info_plist.rb
xcoder-0.0.7 lib/xcode/info_plist.rb
xcoder-0.0.6 lib/xcode/info_plist.rb
xcoder-0.0.5 lib/xcode/info_plist.rb
xcoder-0.0.4 lib/xcode/info_plist.rb
xcoder-0.0.3 lib/xcode/info_plist.rb
xcoder-0.0.2 lib/xcode/info_plist.rb
xcoder-0.0.1 lib/xcode/info_plist.rb