Sha256: fb06c78466c4217e5cdc5ef7e51ed5fb88717b24dd62d73ee173691f849361da
Contents?: true
Size: 1.04 KB
Versions: 22
Compression:
Stored size: 1.04 KB
Contents
module Kuroko2 module Workflow module Task class Env < Base def execute if option env = token.context['ENV'] || {} env.merge!(parse_option(option)) token.context['ENV'] = env end :next end def validate parse_option(option) end private def parse_option(option) env = {} scanner = StringScanner.new(option) until scanner.eos? case when scanner.scan(/(\w+)="((?:\\"|.)*?)"/) env[scanner[1]] = scanner[2].gsub(/\\"/, '"') when scanner.scan(/(\w+)='((?:\\'|.)*?)'/) env[scanner[1]] = scanner[2].gsub(/\\'/, "'") when scanner.scan(/(\w+)=(\S+)/) env[scanner[1]] = scanner[2] when scanner.scan(/\s+/) else raise Workflow::AssertionError, "Syntax error option value of env: #{option}" end end env end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems