Class: Weskit::WML::Parser
Class Method Summary collapse
Class Method Details
.string(str, bck = :kpeg) ⇒ Object
10 11 12 |
# File 'lib/weskit/wml/parser.rb', line 10 def string str, bck = :kpeg parse str, bck end |
.uri(uri, bck = :kpeg) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/weskit/wml/parser.rb', line 14 def uri uri, bck = :kpeg begin str = open(uri).read rescue raise Errors::ReadError, "Couldn't open URI" ensure str = Zlib::GzipReader.new(StringIO.new str).read rescue str end parse str, bck end |