Sha256: b1143d8733889cbaf761a7a00278f58c88de98b71e24083408847737f66ad128

Contents?: true

Size: 528 Bytes

Versions: 8

Compression:

Stored size: 528 Bytes

Contents

require 'plist'

module Xcode
  class Project
    class PlistChanger
      attr_reader :plist_path

      def initialize(plist_path = 'Info.plist')
        @plist_path = plist_path
        read
      end

      def read
        set(plist[key])
      end

      def write
        plist.tap do |plist|
          plist[key] = to_s
        end.save_plist(plist_path)
      end

    private

      def key
        self.class.const_get(:KEY)
      end

      def plist
        Plist::parse_xml(plist_path)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
xcode-0.1.6 lib/xcode/project/plist_changer.rb
xcode-0.1.5 lib/xcode/project/plist_changer.rb
xcode-0.1.4 lib/xcode/project/plist_changer.rb
xcode-0.1.3 lib/xcode/project/plist_changer.rb
xcode-0.1.2 lib/xcode/project/plist_changer.rb
xcode-0.1.1 lib/xcode/project/plist_changer.rb
xcode-0.1.0 lib/xcode/project/plist_changer.rb
xcode-0.0.1 lib/xcode/project/plist_changer.rb