From 4be222a915087ac0ff4b388bb681f07d59fb7ec7 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 13 Oct 2015 13:59:37 -0400 Subject: [PATCH] Being more Ruby 2.1-friendly --- lib/squib/api/data.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/squib/api/data.rb b/lib/squib/api/data.rb index e9872ec..86e6e5b 100644 --- a/lib/squib/api/data.rb +++ b/lib/squib/api/data.rb @@ -81,9 +81,11 @@ module Squib hash[new_header] ||= table[header] end if import.strip? + new_hash = Hash.new hash.each do |header, col| - col.map! { |str| str.strip! if str.respond_to?(:strip); str } + new_hash[header] = col.map { |str| str = str.strip if str.respond_to?(:strip); str } end + hash = new_hash end return hash end