Skip to content

Commit

Permalink
(PDOC-27) Make fix compatible with Ruby 2x
Browse files Browse the repository at this point in the history
Prior to this commit, the fix for the 3x function issue was trying
to create an empty hash by calling Hash[ [[]] ] which in Ruby 1.9.3
produced and empty hash. However this is not the case in Ruby 2.0 and
up. Therefor, fix up the code so that it does not rely on Hash[ [[]] ]
creating and empty hash.
  • Loading branch information
HAIL9000 committed Feb 17, 2015
1 parent 0a3c373 commit 849c731
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ def process_parameters
# and the values on either side of it.
tuple.jump(:assoc).map{|e| process_element(e)}
end

options = Hash[opts]
else
opts = [[]]
options = {}
end

[name, Hash[opts]]
[name, options]
end

# Sometimes the YARD parser returns Heredoc strings that start with `<-`
Expand Down

0 comments on commit 849c731

Please sign in to comment.