Skip to content

Commit

Permalink
ref: dropping 1.8 compatibility
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
Christian Kruse committed Jan 13, 2018
1 parent ba6442e commit c450984
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/cfpropertylist/rbCFPropertyList.rb
Expand Up @@ -72,28 +72,12 @@ def append_node(parent, child)
end
end

class String
unless("".respond_to?(:bytesize)) then
def bytesize
self.length
end
end
end

dirname = File.dirname(__FILE__)
require dirname + '/rbCFPlistError.rb'
require dirname + '/rbCFTypes.rb'
require dirname + '/rbBinaryCFPropertyList.rb'
require dirname + '/rbPlainCFPropertyList.rb'

require 'iconv' unless "".respond_to?("encode")

# ensure that the module and class exist
module Enumerable
class Enumerator
end
end

begin
require dirname + '/rbLibXMLParser.rb'
temp = LibXML::XML::Parser::Options::NOBLANKS # check if we have a version with parser options
Expand Down Expand Up @@ -144,7 +128,7 @@ def guess(object, options = {})
when Time, DateTime, Date
CFDate.new(object)

when Array, Enumerator, Enumerable::Enumerator
when Array, Enumerator
ary = Array.new
object.each do |o|
ary.push CFPropertyList.guess(o, options)
Expand Down

0 comments on commit c450984

Please sign in to comment.