lib/avro/protocol.rb in avro-1.7.5 vs lib/avro/protocol.rb in avro-1.7.6

- old
+ new

@@ -3,13 +3,13 @@ # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. @@ -20,11 +20,11 @@ VALID_TYPE_SCHEMA_TYPES_SYM = Set.new(VALID_TYPE_SCHEMA_TYPES.map(&:to_sym)) class ProtocolParseError < Avro::AvroError; end attr_reader :name, :namespace, :types, :messages, :md5 def self.parse(protocol_string) - json_data = Yajl.load(protocol_string) + json_data = MultiJson.load(protocol_string) if json_data.is_a? Hash name = json_data['protocol'] namespace = json_data['namespace'] types = json_data['types'] @@ -56,10 +56,10 @@ @messages = parse_messages(messages, type_names) @md5 = Digest::MD5.digest(to_s) end def to_s - Yajl.dump to_avro + MultiJson.dump to_avro end def ==(other) to_avro == other.to_avro end