Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Guard in NTriples::Reader.unescape.

  • Loading branch information...
commit fa5c6499ea8df770f7a3340c7047299c31f3d647 1 parent d9d9208
@gkellogg gkellogg authored
Showing with 4 additions and 12 deletions.
  1. +3 −12 lib/rdf/model/value.rb
  2. +1 −0  lib/rdf/ntriples/reader.rb
View
15 lib/rdf/model/value.rb
@@ -61,11 +61,10 @@ def term?
end
##
- # Returns `true` if this term is variable.
+ # Returns `true` if `self` is a {RDF::Resource}.
#
- # @return [Boolean] `true` or `false`
- # @see #constant?
- def variable?
+ # @return [Boolean]
+ def resource?
false
end
@@ -78,14 +77,6 @@ def literal?
end
##
- # Returns `true` if `self` is a {RDF::Resource}.
- #
- # @return [Boolean]
- def resource?
- false
- end
-
- ##
# Returns `true` if `self` is a {RDF::Node}.
#
# @return [Boolean]
View
1  lib/rdf/ntriples/reader.rb
@@ -201,6 +201,7 @@ def self.parse_literal(input)
# @see http://blog.grayproductions.net/articles/understanding_m17n
# @see http://yehudakatz.com/2010/05/17/encodings-unabridged/
def self.unescape(string)
+ string = string.to_s
string = string.dup.force_encoding(Encoding::ASCII_8BIT) if string.respond_to?(:force_encoding)
# Decode \t|\n|\r|\"|\\ character escapes:
Please sign in to comment.
Something went wrong with that request. Please try again.