I'm not sure if this is a Mac-only problem or what, but we were getting incompatible-function-pointer errors when trying to build the RocketAMF C extensions. This fixes that! (Maybe it's like, Mac-only but as of Ruby 3.4 in specific? We're running RocketAMF in production on Ruby 3.4 right now without this. Shrug.)
22 lines
No EOL
591 B
Ruby
22 lines
No EOL
591 B
Ruby
# Joc's monkeypatch for string bytesize (only available in 1.8.7+)
|
|
if !"amf".respond_to? :bytesize
|
|
class String #:nodoc:
|
|
def bytesize
|
|
self.size
|
|
end
|
|
end
|
|
end
|
|
|
|
# Add <tt>ArrayCollection</tt> override to arrays
|
|
class Array
|
|
# Override <tt>RocketAMF::ClassMapper.use_array_collection</tt> setting for
|
|
# this array. Adds <tt>is_array_collection?</tt> method, which is used by the
|
|
# serializer over the global config if defined.
|
|
def is_array_collection= a
|
|
@is_array_collection = a
|
|
|
|
def self.is_array_collection? #:nodoc:
|
|
@is_array_collection
|
|
end
|
|
end
|
|
end |