Sha256: 4a6831e3fe67c0495748f3acc1ca083dbbc4333cdc046b221ab76a48d3460a7d
Contents?: true
Size: 803 Bytes
Versions: 14
Compression:
Stored size: 803 Bytes
Contents
$:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib') require 'ace-client' require 'thor' require 'nokogiri' BANNER = 'Usage: ace-q2 DescribeSomethings Key1=Value1 Key2=Value2 ...' def validate_env %w(ACE_ACCESS_KEY_ID ACE_SECRET_ACCESS_KEY ACE_ENDPOINT).each do |x| abort "Error: please set #{x} environment variable" if ENV[x].nil? end end def main(args) abort BANNER if args.size < 1 validate_env action = args.shift params = {} args.each do |arg| key, value = arg.split('=') if value.nil? abort 'Error: please specify params like Key=Value' end params[key] = value end response = AceClient::Query2.new.action(action, params) puts Nokogiri::XML(response.body).to_xml(:indent => 4) end main(ARGV.dup)
Version data entries
14 entries across 14 versions & 1 rubygems