FIX: made SMF2 importer compatible with Ruby 2.0

This commit is contained in:
Jens Maier 2014-09-30 21:01:50 +02:00
parent 91cbdb565d
commit b74a7d271a
1 changed files with 2 additions and 1 deletions

View File

@ -445,7 +445,8 @@ class ImportScripts::Smf2 < ImportScripts::Base
# param1=value1=still1 value1 param2=value2 ...
# => {'param1' => 'value1=still1 value1', 'param2' => 'value2 ...'}
def parse_tag_params(params)
params.to_s.strip.scan(/(?<param>\w+)=(?<value>(?:(?>\S+)|\s+(?!\w+=))*)/).to_h
params.to_s.strip.scan(/(?<param>\w+)=(?<value>(?:(?>\S+)|\s+(?!\w+=))*)/).
inject({}) {|h,e| h[e[0]] = e[1]; h }
end
class << self