Search in sources :

Example 1 with EscapeNewLinesAndQuotesHelper

use of com.hubspot.singularity.executor.handlebars.EscapeNewLinesAndQuotesHelper in project Singularity by HubSpot.

the class SingularityExecutorModule method providesHandlebars.

@Provides
@Singleton
public Handlebars providesHandlebars() {
    // handlebars emits DEBUG logs before logger is properly configured
    SingularityRunnerBaseLogging.quietEagerLogging();
    final Handlebars handlebars = new Handlebars();
    handlebars.registerHelper(BashEscapedHelper.NAME, new BashEscapedHelper());
    handlebars.registerHelper(ShellQuoteHelper.NAME, new ShellQuoteHelper());
    handlebars.registerHelper(IfPresentHelper.NAME, new IfPresentHelper());
    handlebars.registerHelper(IfHasNewLinesOrBackticksHelper.NAME, new IfHasNewLinesOrBackticksHelper());
    handlebars.registerHelper(EscapeNewLinesAndQuotesHelper.NAME, new EscapeNewLinesAndQuotesHelper());
    return handlebars;
}
Also used : IfPresentHelper(com.hubspot.singularity.executor.handlebars.IfPresentHelper) Handlebars(com.github.jknack.handlebars.Handlebars) EscapeNewLinesAndQuotesHelper(com.hubspot.singularity.executor.handlebars.EscapeNewLinesAndQuotesHelper) ShellQuoteHelper(com.hubspot.singularity.executor.handlebars.ShellQuoteHelper) IfHasNewLinesOrBackticksHelper(com.hubspot.singularity.executor.handlebars.IfHasNewLinesOrBackticksHelper) BashEscapedHelper(com.hubspot.singularity.executor.handlebars.BashEscapedHelper) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

Handlebars (com.github.jknack.handlebars.Handlebars)1 Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 BashEscapedHelper (com.hubspot.singularity.executor.handlebars.BashEscapedHelper)1 EscapeNewLinesAndQuotesHelper (com.hubspot.singularity.executor.handlebars.EscapeNewLinesAndQuotesHelper)1 IfHasNewLinesOrBackticksHelper (com.hubspot.singularity.executor.handlebars.IfHasNewLinesOrBackticksHelper)1 IfPresentHelper (com.hubspot.singularity.executor.handlebars.IfPresentHelper)1 ShellQuoteHelper (com.hubspot.singularity.executor.handlebars.ShellQuoteHelper)1