lib/lines.rb in lines-0.1.15 vs lib/lines.rb in lines-0.1.16
- old
+ new
@@ -286,10 +286,13 @@
end
# TODO: Single-quote espace if possible
def strenc(s)
s = s.to_s
- s = s.inspect unless is_literal?(s)
+ unless is_literal?(s)
+ s = s.inspect
+ s[0] = s[-1] = "'" unless s[1..-2].include?("'")
+ end
s
end
def numenc(n)
#case n