summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych.rb')
-rw-r--r--ext/psych/lib/psych.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index 69f3a7c1fe..df3acc0aff 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -148,8 +148,10 @@ module Psych
#
# See Psych::Nodes for more information about YAML AST.
def self.parse yaml, filename = nil
- children = parse_stream(yaml, filename).children
- children.empty? ? false : children.first.children.first
+ parse_stream(yaml, filename) do |node|
+ return node
+ end
+ false
end
###