cardmagic / simple-rss

A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.
https://github.com/cardmagic/simple-rss
Other
225 stars 68 forks source link

Fix regexp warning on UTF-8 characters #13

Closed todb-r7 closed 10 years ago

todb-r7 commented 11 years ago

By String#force_encoding("binary") in the unescape() method, it's easier to avoid the regexp warning:

./gems/simple-rss-ef0d5db568fa/lib/simple-rss.rb:155:
    warning: regexp match /.../n against to UTF-8 string

Using this fix today, seems to work all right. My test case is to watch a private RSS feed of an organization on GitHub, and marvel at the error's absence. I'm doing something trivial like:

uri = "https://github.com/organizations/%s/%s.private.atom?token=%s"
@rss = SimpleRSS.parse(open(uri))

against rapid7/metasploit-framwork (with my RSS token)

agirorn commented 11 years ago

+1