Sha256: 3f198fec311f7eb7393798735d8f99fb3573bfa4f4007f140d9af1e7c1efae6e
Contents?: true
Size: 910 Bytes
Versions: 4
Compression:
Stored size: 910 Bytes
Contents
#!/usr/bin/env ruby # WANT_JSON # init bundler in dev env if ENV['QB_DEV_ENV'] ENV.each {|k, v| if k.start_with? 'QB_DEV_ENV_' ENV[k.sub('QB_DEV_ENV_', '')] = v end } require 'bundler/setup' end require 'qb' require 'cmds' class Stream < QB::Ansible::Module def main template = @args['template'] || @args['cmd'] if template.nil? raise ArgumentError, "Must supply `template` or `cmd` argument." end opts = {} [:args, :kwds, :input, :assert, :env, :chdir].each { |key| opts[key] = @args[key.to_s] if @args.key?(key.to_s) } [:format, :env_mode].each { |key| opts[key] = @args[key.to_s].to_sym if @args.key?(key.to_s) } cmd = Cmds.new(template, **opts) if @args['log'] info "STREAMING\n\n#{ cmd.prepare }\n\n" end cmd.stream! changed! end end Stream.new.run
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
qb-0.3.12 | library/stream |
qb-0.3.11 | library/stream |
qb-0.3.10 | library/stream |
qb-0.3.9 | library/stream |