<commit_before>package org.b3mn.poem;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.javasupport.JavaEmbedUtils;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.ClassCache;
import org.jruby.runtime.Block;

public class PoEMServlet extends HttpServlet {
	private static final long serialVersionUID = -9128262564769832181L;
	@SuppressWarnings("unchecked")
	private final ClassCache classCache = JavaEmbedUtils.createClassCache(Thread.currentThread().getContextClassLoader());
	private final List<String> loadPaths = new ArrayList<String>();
	private final Ruby ruby;
	
	public PoEMServlet() {
		loadPaths.add("/opt/local/Tomcat6/webapps/poem-backend-1.0/WEB-INF/classes/jruby");
		ruby = JavaEmbedUtils.initialize(loadPaths, classCache);
	}

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		ruby.getLoadService().require("dispatcher");
		RubyClass dispatcher = ruby.getClass("Dispatcher");

		System.out.println("rufe Ruby::Dispatcher");
		IRubyObject[] args = {JavaEmbedUtils.javaToRuby(ruby, request), JavaEmbedUtils.javaToRuby(ruby, response)};
		IRubyObject[] damn_java_hack = {};
		IRubyObject instance = dispatcher.newInstance(damn_java_hack, Block.NULL_BLOCK);
		instance.callMethod(dispatcher.getRuntime().getCurrentContext(), "dispatch", args);
		System.out.println("Ruby::Dispatcher fertig");
	
	}

}<commit_msg>jruby loadpath adapted<commit_after>package org.b3mn.poem;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.javasupport.JavaEmbedUtils;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.ClassCache;
import org.jruby.runtime.Block;

public class PoEMServlet extends HttpServlet {
	private static final long serialVersionUID = -9128262564769832181L;
	@SuppressWarnings("unchecked")
	private final ClassCache classCache = JavaEmbedUtils.createClassCache(Thread.currentThread().getContextClassLoader());
	private final List<String> loadPaths = new ArrayList<String>();
	private final Ruby ruby;
	
	public PoEMServlet() {
		loadPaths.add("jruby");
		ruby = JavaEmbedUtils.initialize(loadPaths, classCache);
	}

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		ruby.getLoadService().require("dispatcher");
		RubyClass dispatcher = ruby.getClass("Dispatcher");

		System.out.println("rufe Ruby::Dispatcher");
		IRubyObject[] args = {JavaEmbedUtils.javaToRuby(ruby, request), JavaEmbedUtils.javaToRuby(ruby, response)};
		IRubyObject[] damn_java_hack = {};
		IRubyObject instance = dispatcher.newInstance(damn_java_hack, Block.NULL_BLOCK);
		instance.callMethod(dispatcher.getRuntime().getCurrentContext(), "dispatch", args);
		System.out.println("Ruby::Dispatcher fertig");
	
	}

}
{'fraction_non_alphanumeric': 0.11227232009555091, 'fraction_numerical': 0.012839653627948642, 'mean_word_length': 6.77262180974478, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5649953', 'n_tokens_mistral': 1114, 'n_tokens_neox': 998, 'n_words': 190}