Commit f315c8bc authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix Guides.to_array in Ruby 1.8.

In 1.9 the Hash#select method returns a Hash, but in 1.8 it returns an
array which can be converted to a hash using Hash[] (when passed a hash
it will just pass through) - so now the code will produce a hash in both
1.8 and 1.9.
parent f75d4015
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ module JsDuck
      @groups.map do |group|
        {
          "title" => group["title"],
          "items" => group["items"].map {|g| g.select {|k, v| k != :html } }
          "items" => group["items"].map {|g| Hash[g.select {|k, v| k != :html }] }
        }
      end
    end