From 41d03982087ac838887742afebd25bf44627bcb9 Mon Sep 17 00:00:00 2001 From: Oleg Sukhodolsky Date: Fri, 3 Oct 2014 16:45:14 +0400 Subject: [PATCH] RUBY-15804: not all keys are comparable so let's convert them to strings --- ChangeLog.md | 4 ++++ lib/ruby-debug-ide/version.rb | 2 +- lib/ruby-debug-ide/xml_printer.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 9122fae..caf8af5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +## [0.4.23.beta9](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23.beta9...v0.4.23.beta10) + +* fixed problem with printing hashes [RUBY-15804](https://youtrack.jetbrains.com/issue/RUBY-15804) + ## [0.4.23.beta9](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23.beta8...v0.4.23.beta9) * problem with calculating local varibales for 1.8 fixed diff --git a/lib/ruby-debug-ide/version.rb b/lib/ruby-debug-ide/version.rb index 00cd78f..21dfc1b 100755 --- a/lib/ruby-debug-ide/version.rb +++ b/lib/ruby-debug-ide/version.rb @@ -1,3 +1,3 @@ module Debugger - IDE_VERSION='0.4.23.beta9' + IDE_VERSION='0.4.23.beta10' end diff --git a/lib/ruby-debug-ide/xml_printer.rb b/lib/ruby-debug-ide/xml_printer.rb index d7cbb10..a160162 100644 --- a/lib/ruby-debug-ide/xml_printer.rb +++ b/lib/ruby-debug-ide/xml_printer.rb @@ -189,7 +189,7 @@ def build_compact_name(value_str, value) end end if value.is_a?(Hash) - slice = value.sort_by { |k,v| k }[0..5] + slice = value.sort_by { |k,v| k.to_s }[0..5] compact = slice.map {|kv| "#{kv[0]}: #{kv[1]}"}.join(", ") compact = "{" + compact + (slice.size != value.size ? ", ..." : "") + "}" end