require 'rubygems' require 'amee' require 'optparse' # Command-line options - get username, password, and server options = {} OptionParser.new do |opts| opts.on("-u", "--username USERNAME", "AMEE username") do |u| options[:username] = u end opts.on("-p", "--password PASSWORD", "AMEE password") do |p| options[:password] = p end opts.on("-s", "--server SERVER", "AMEE server") do |s| options[:server] = s end end.parse! # Connect connection = AMEE::Connection.new(options[:server], options[:username], options[:password]) # List all available profiles profiles = AMEE::Profile.list(connection) puts "#{profiles.size} #{profiles.size == 1 ? "profile" : "profiles"} available in AMEE:" profiles.each do |p| puts p.uid end