lib/json-schema/attributes/ref.rb in json-schema-0.9.4 vs lib/json-schema/attributes/ref.rb in json-schema-0.9.5

- old
+ new

@@ -10,11 +10,11 @@ if path.nil? || path == '' temp_uri.path = current_schema.uri.path elsif path[0,1] == "/" temp_uri.path = Pathname.new(path).cleanpath.to_s else - temp_uri.path = (Pathname.new(current_schema.uri.path) + path).cleanpath.to_s + temp_uri = current_schema.uri.merge(path) end temp_uri.fragment = current_schema.schema['$ref'].split("#")[1] end temp_uri.fragment = "" if temp_uri.fragment.nil? @@ -49,6 +49,6 @@ raise ValidationError.new("The referenced schema '#{temp_uri.to_s}' cannot be found", fragments, current_schema) end end end end -end \ No newline at end of file +end