Sha256: 3540531ab8f76af2bfabbeb5a00c0b04fdb41fe9dc33aa2f04424714e031a1e8

Contents?: true

Size: 592 Bytes

Versions: 26

Compression:

Stored size: 592 Bytes

Contents

#!/usr/bin/env ruby

template_1 = "%s%s.step('%s')(function (step) {\n%s});\n"
template_2 = "%s%s.step('%s').dependsOn('%s')(function (step) {\n%s});\n"

WHITESPACE_REGEX = /^\s+/

target_template = template_1
previus_step = nil

flow = ARGV[0] || 'flow'

STDIN.each_line do |line|
  line.chomp!
  whitespace_prefix = line.scan(WHITESPACE_REGEX)[0]
  step_name = line.gsub(WHITESPACE_REGEX, '')
  previus_step ||= whitespace_prefix
  puts (target_template % [whitespace_prefix, flow, step_name, previus_step, whitespace_prefix])
  target_template = template_2
  previus_step = step_name
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ix-cli-0.0.27 bin/ix-flow
ix-cli-0.0.26 bin/ix-flow
ix-cli-0.0.25 bin/ix-flow
ix-cli-0.0.24 bin/ix-flow
ix-cli-0.0.23 bin/ix-flow
ix-cli-0.0.22 bin/ix-flow
ix-cli-0.0.21 bin/ix-flow
ix-cli-0.0.20 bin/ix-flow
ix-cli-0.0.19 bin/ix-flow
ix-cli-0.0.18 bin/ix-flow
ix-cli-0.0.17 bin/ix-flow
ix-cli-0.0.16 bin/ix-flow
ix-cli-0.0.15 bin/ix-flow
ix-cli-0.0.14 bin/ix-flow
ix-cli-0.0.13 bin/ix-flow
ix-cli-0.0.12 bin/ix-flow
ix-cli-0.0.11 bin/ix-flow
ix-cli-0.0.10 bin/ix-flow
ix-cli-0.0.9 bin/ix-flow
ix-cli-0.0.7 bin/ix-flow