From 229669bb5f0c49f153754da60f451c932969fedb Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 20 Dec 2023 14:26:05 +0100 Subject: [PATCH] rubocop --- _plugins/gtn/supported.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_plugins/gtn/supported.rb b/_plugins/gtn/supported.rb index 34e9779379bbbf..b851010fe0b099 100644 --- a/_plugins/gtn/supported.rb +++ b/_plugins/gtn/supported.rb @@ -23,7 +23,11 @@ def self.calculate(data, tool_list) if data.nil? || data.empty? || tool_list.empty? || tool_list.nil? return { 'exact' => [], - 'inexact' => Gtn::Usegalaxy.servers.map{|x| x = x.map{|k, v| [k.to_s, v]}.to_h; x['usegalaxy'] = true; x } + 'inexact' => Gtn::Usegalaxy.servers.map do |x| + x = x.transform_keys(&:to_s) + x['usegalaxy'] = true + x + end } end @@ -68,7 +72,7 @@ def self.calculate(data, tool_list) # generate a 'false' value when merging sets. inexact_support -= exact_support - usegalaxy_server_urls = Gtn::Usegalaxy.servers.map{|x| x[:url]} + usegalaxy_server_urls = Gtn::Usegalaxy.servers.map { |x| x[:url] } { 'exact' => (exact_support || []).map do |id| @@ -76,11 +80,11 @@ def self.calculate(data, tool_list) { 'usegalaxy' => usegalaxy_server_urls.include?(data['servers'][id]['url']) } ) end, - 'inexact' => (inexact_support || []).map { |id| + 'inexact' => (inexact_support || []).map do |id| data['servers'][id].update( { 'usegalaxy' => usegalaxy_server_urls.include?(data['servers'][id]['url']) } ) - } + end } end end