Skip to content

Commit

Permalink
Replace unpack1 with unpack()[0] for old Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson committed Dec 25, 2023
1 parent 07a6d31 commit e384a00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plist/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ def to_ruby

class PData < PTag
def to_ruby
# unpack1("m") is equivalent to Base64.decode64
data = text.gsub(/\s+/, '').unpack1("m") unless text.nil?
# unpack("m")[0] is equivalent to Base64.decode64
data = text.gsub(/\s+/, '').unpack("m")[0] unless text.nil?
begin
return Marshal.load(data) if options[:marshal]
rescue Exception
Expand Down

0 comments on commit e384a00

Please sign in to comment.