Execute a Ruby script using the GraalVM scripting engine.

yaml
type: "io.kestra.plugin.graalvm.ruby.Eval"

Execute a Ruby script using the GraalVM scripting engine.

yaml
id: evalRuby
namespace: company.team

tasks:
  - id: evalRuby
    type: io.kestra.plugin.graalvm.ruby.Eval
    outputs:
      - map
      - out
    script: |
      Counter = Java.type('io.kestra.core.models.executions.metrics.Counter')
      FileOutputStream = Java.type('java.io.FileOutputStream')
      # all variables must be imported before use
      logger = Polyglot.import('logger')
      runContext = Polyglot.import('runContext')
      logger.info('Task started')
      runContext.metric(Counter.of('total', 666, 'name', 'bla'))
      map = {test: 'here'}
      tempFile = runContext.workingDir().createTempFile().toFile()
      output = FileOutputStream.new(tempFile)
      output.write('Hello World'.bytes)
      out = runContext.storage().putFile(tempFile)
      return {map: map, out: out}
Properties

The script to evaluate

SubType string

A List of outputs variables that will be usable in outputs.

The captured outputs as declared on the outputs task property.