Sha256: 1b45c32ca00f1f7cd916b15dd855eaccadc90f7de991cfdb1e8f08ef284a5882

Contents?: true

Size: 419 Bytes

Versions: 3

Compression:

Stored size: 419 Bytes

Contents

# frozen_string_literal: true

require 'json'

module AppleReceipt
  # NextStepParser parses NextSTEP Plist data structures.
  module NextStepParser
    module_function

    def parse(input)
      # Transform JSON-like NextSTEP PList data into JSON
      raw_json = input.gsub(/;\n\t/, ",\n\t")
                      .gsub(/\ =/, ':')
                      .gsub(/;\n/, '')
      JSON.parse(raw_json)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
apple_receipt-0.2.1 lib/apple_receipt/next_step_parser.rb
apple_receipt-0.2.0 lib/apple_receipt/next_step_parser.rb
apple_receipt-0.1.1 lib/apple_receipt/next_step_parser.rb