lib/simple-rss.rb in simple-rss-1.3.0 vs lib/simple-rss.rb in simple-rss-1.3.1
- old
+ new
@@ -1,10 +1,10 @@
require 'cgi'
require 'time'
class SimpleRSS
- VERSION = "1.3.0"
+ VERSION = "1.3.1"
attr_reader :items, :source
alias :entries :items
@@feed_tags = [
@@ -150,10 +150,10 @@
def clean_tag(tag)
tag.to_s.gsub(':','_').intern
end
def unescape(content)
- if content.force_encoding("binary") =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/n then
+ if content.respond_to?(:force_encoding) && content.force_encoding("binary") =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/n then
CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
else
content.gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
end
end