Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimmo Lehto committed Dec 20, 2018
1 parent afe685e commit 9ee69fe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/yaml/safe_load_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ module YAMLSafeLoadStream
doc_num += 1 if obj.is_a?(Psych::Nodes::Document)

if obj.respond_to?(:tag)
if tag = obj.tag
tag = obj.tag
unless tag.nil?
unless tag.to_s.start_with?('tag:yaml.org,')
message = "tag #{tag} encountered "
if obj.respond_to?(:start_line)
message += "on line #{obj.start_line} column #{obj.start_column} of document #{doc_num}"
else
message += "in document #{doc_num}"
end
message += if obj.respond_to?(:start_line)
"on line #{obj.start_line} column #{obj.start_column} of document #{doc_num}"
else
"in document #{doc_num}"
end
message += " in file #{filename}" if filename
raise Psych::DisallowedClass, message
end
Expand Down

0 comments on commit 9ee69fe

Please sign in to comment.