Sha256: 88f0c387d0e86d8f34dfef7ede19d17056911f843936afe71320687fbe459c5d
Contents?: true
Size: 538 Bytes
Versions: 10
Compression:
Stored size: 538 Bytes
Contents
command "run" do |c| c.syntax = "#{$datapimp_cli} run FILE" c.description = "runs a script in the context of the datapimp config" c.option '--format FORMAT', String, 'which format should we serialize the result? json default' c.action do |args, options| code = "" args.each do |arg| code += Pathname(arg).read end result = begin eval(code) rescue {error: $!} end if options.format == "json" puts JSON.generate(result) if result else puts result end end end
Version data entries
10 entries across 10 versions & 1 rubygems