From 104cc5dd9bc7c90a54398a50cbed8106c9b1192c Mon Sep 17 00:00:00 2001 From: Andre Starosta <afas15@c3sl.ufpr.br> Date: Tue, 11 Oct 2016 10:43:12 -0300 Subject: [PATCH] parser working --- scripts/scriptGeral.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/scriptGeral.rb b/scripts/scriptGeral.rb index fa23b43..dae670a 100644 --- a/scripts/scriptGeral.rb +++ b/scripts/scriptGeral.rb @@ -3,6 +3,25 @@ class String self[/#{"\""}(.*?)#{"\""}/m, 1] end end + +def parseCollection searchColl, client + client.communities.all.each do |community| + client.communities.collections(:id => community.id).each do |collection| + if((searchColl.gsub('_',' ') <=> collection.name) == 0) + return(collection.id) + end + end + end +end + +def parseCommunity searchComm, client + client.communities.all.each do |community| + if((searchComm.gsub('_',' ') <=> community.name) == 0) + return(community.id) + end + end +end + ################################################################################################### $LOAD_PATH.unshift('/home/starosta/c3sl/seppir/scriptsRuby/rest-client-gem/lib') #################################### A U T E N T I C A C A O ###################################### -- GitLab