* @param runtime Ruby runtime
* @param vars map to save a retrieved global variable.
* @param key name of the global variable
*/
public static void retrieveByKey(Ruby runtime, BiVariableMap vars, String key) {
GlobalVariables gvars = runtime.getGlobalVariables();
// if the specified key doesn't exist, this method is called before the
// evaluation. Don't update value in this case.
String rubyKey = ("$" + key).intern();
if (!gvars.getNames().contains(rubyKey)) return;
// the specified key is found, so let's update
IRubyObject value = gvars.get(rubyKey);
updateLocalGlobal((RubyObject)runtime.getTopSelf(), vars, key, value);
}