All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kohsuke.stapler.jelly.jruby.erb.ERbLanguage Maven / Gradle / Ivy

There is a newer version: 1.263
Show newest version
package org.kohsuke.stapler.jelly.jruby.erb;

import org.jruby.RubyClass;
import org.jruby.embed.ScriptingContainer;
import org.kohsuke.MetaInfServices;
import org.kohsuke.stapler.jelly.jruby.RubyTemplateContainer;
import org.kohsuke.stapler.jelly.jruby.RubyTemplateLanguage;

/**
 * @author Kohsuke Kawaguchi
 */
@MetaInfServices
public class ERbLanguage extends RubyTemplateLanguage {
    @Override
    protected String getScriptExtension() {
        return ".erb";
    }

    @Override
    protected Class getTearOffClass() {
        return ERbClassTearOff.class;
    }

    @Override
    protected RubyTemplateContainer createContainer(ScriptingContainer jruby) {
        return new RubyTemplateContainer(
            (RubyClass)jruby.runScriptlet(
                    "require 'org/kohsuke/stapler/jelly/jruby/erb/JRubyJellyERbScript'\n"+
                    "JRubyJellyScriptImpl::JRubyJellyERbScript"),
            this, jruby);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy