<commit_before>package org.intermine.api.query.codegen;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.commons.lang.StringUtils;
import org.intermine.api.template.SwitchOffAbility;
import org.intermine.api.template.TemplateQuery;
import org.intermine.objectstore.query.ConstraintOp;
import org.intermine.pathquery.OrderDirection;
import org.intermine.pathquery.OrderElement;
import org.intermine.pathquery.OuterJoinStatus;
import org.intermine.pathquery.PathConstraint;
import org.intermine.pathquery.PathConstraintSubclass;
import org.intermine.pathquery.PathConstraintAttribute;
import org.intermine.pathquery.PathConstraintBag;
import org.intermine.pathquery.PathConstraintLookup;
import org.intermine.pathquery.PathConstraintLoop;
import org.intermine.pathquery.PathConstraintMultiValue;
import org.intermine.pathquery.PathException;
import org.intermine.pathquery.PathQuery;
import org.intermine.util.TypeUtil;

public class WebserviceRubyCodeGenerator implements WebserviceCodeGenerator 
{

    protected static final String INVALID_QUERY           = "Invalid query: ";
    protected static final String NULL_QUERY              = "Invalid query. Query can not be null.";

    protected static final String INDENT                  = "    ";
    protected static final String SPACE                   = " ";
    protected static final String LEFT_BRACE              = "{";
    protected static final String RIGHT_BRACE             = "}";
    protected static final String ENDL                    = System.getProperty("line.separator");

    protected static final String TEMPLATE_BAG_CONSTRAINT = "This template contains a list "
                                                              + "constraint, which is currently not supported."; 

    
    private void appendBoilerPlate(StringBuffer sb, WebserviceCodeGenInfo info) {
        
        sb.append("#!/usr/bin/env ruby" + ENDL + ENDL);
        sb.append("# This is an automatically generated script to run your query" + ENDL);
        sb.append("# to use it you will require the intermine ruby client." + ENDL);
        sb.append("# To install the client, run the following command from a terminal:" + ENDL);
        sb.append("#" + ENDL);
        sb.append("#     sudo gem install intermine" + ENDL);
        sb.append("#" + ENDL);
        sb.append("# For further documentation you can visit:" + ENDL);
        sb.append("#          http://intermine.org/docs/ruby-docs/" + ENDL);
        sb.append("#     and: http://intermine.org/docs/ruby-bio-docs/" + ENDL);
        sb.append("#" + ENDL);
        sb.append("# The following two lines will be needed in every python script:" + ENDL);
        sb.append("require \"rubygems\"" + ENDL);
        sb.append("require \"intermine/service\"" + ENDL);
        sb.append("service = Service.new(\"" + info.getServiceBaseURL() + "\"");
        if (!info.isPublic()) {
            sb.append(", \"YOUR-API-KEY\"");
        }<commit_msg>removed occurrance of 'python' in the ruby generator<commit_after>package org.intermine.api.query.codegen;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.commons.lang.StringUtils;
import org.intermine.api.template.SwitchOffAbility;
import org.intermine.api.template.TemplateQuery;
import org.intermine.objectstore.query.ConstraintOp;
import org.intermine.pathquery.OrderDirection;
import org.intermine.pathquery.OrderElement;
import org.intermine.pathquery.OuterJoinStatus;
import org.intermine.pathquery.PathConstraint;
import org.intermine.pathquery.PathConstraintSubclass;
import org.intermine.pathquery.PathConstraintAttribute;
import org.intermine.pathquery.PathConstraintBag;
import org.intermine.pathquery.PathConstraintLookup;
import org.intermine.pathquery.PathConstraintLoop;
import org.intermine.pathquery.PathConstraintMultiValue;
import org.intermine.pathquery.PathException;
import org.intermine.pathquery.PathQuery;
import org.intermine.util.TypeUtil;

public class WebserviceRubyCodeGenerator implements WebserviceCodeGenerator 
{

    protected static final String INVALID_QUERY           = "Invalid query: ";
    protected static final String NULL_QUERY              = "Invalid query. Query can not be null.";

    protected static final String INDENT                  = "    ";
    protected static final String SPACE                   = " ";
    protected static final String LEFT_BRACE              = "{";
    protected static final String RIGHT_BRACE             = "}";
    protected static final String ENDL                    = System.getProperty("line.separator");

    protected static final String TEMPLATE_BAG_CONSTRAINT = "This template contains a list "
                                                              + "constraint, which is currently not supported."; 

    
    private void appendBoilerPlate(StringBuffer sb, WebserviceCodeGenInfo info) {
        
        sb.append("#!/usr/bin/env ruby" + ENDL + ENDL);
        sb.append("# This is an automatically generated script to run your query" + ENDL);
        sb.append("# to use it you will require the intermine ruby client." + ENDL);
        sb.append("# To install the client, run the following command from a terminal:" + ENDL);
        sb.append("#" + ENDL);
        sb.append("#     sudo gem install intermine" + ENDL);
        sb.append("#" + ENDL);
        sb.append("# For further documentation you can visit:" + ENDL);
        sb.append("#          http://intermine.org/docs/ruby-docs/" + ENDL);
        sb.append("#     and: http://intermine.org/docs/ruby-bio-docs/" + ENDL);
        sb.append("#" + ENDL);
        sb.append("# The following two lines will be needed in every script:" + ENDL);
        sb.append("require \"rubygems\"" + ENDL);
        sb.append("require \"intermine/service\"" + ENDL);
        sb.append("service = Service.new(\"" + info.getServiceBaseURL() + "\"");
        if (!info.isPublic()) {
            sb.append(", \"YOUR-API-KEY\"");
        }
{'fraction_non_alphanumeric': 0.10975609756097561, 'fraction_numerical': 0.0, 'mean_word_length': 3.008360128617363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7491872', 'n_tokens_mistral': 1702, 'n_tokens_neox': 1659, 'n_words': 438}