Sha256: 8a85bdd4afbc1384b7af8d8d4c20c73b4bc76b286e79a903973d61783e3e3d52
Contents?: true
Size: 575 Bytes
Versions: 6
Compression:
Stored size: 575 Bytes
Contents
require 'conjur/command' class Conjur::Command::Field < Conjur::Command self.prefix = :field desc "Selects a field from structured input" arg_name "pattern (value | STDIN)" command :select do |c| c.action do |global_options,options,args| pattern = require_arg(args, 'pattern') value = args.shift || STDIN.read require 'json' json = JSON.parse(value) class << json def get_binding record = self binding end end puts json.get_binding.eval(pattern) end end end
Version data entries
6 entries across 6 versions & 1 rubygems