Merge pull request #2830 from Elberet/smf2-import

FIX: made SMF2 importer compatible with Ruby 2.0
This commit is contained in:
Sam 2014-10-01 10:17:54 +10:00
commit 3863553275
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