Sha256: a82a9aebf15cd50cfdd719bc7ea56c76545a0759bcc8de5473d3e38f687d36c0

Contents?: true

Size: 753 Bytes

Versions: 6

Compression:

Stored size: 753 Bytes

Contents

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


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
Floppy-amee-0.1.2 examples/list_profiles.rb
Floppy-amee-0.1.5 examples/list_profiles.rb
Floppy-amee-0.2.1 examples/list_profiles.rb
Floppy-amee-0.2.3 examples/list_profiles.rb
Floppy-amee-0.3.0 examples/list_profiles.rb
Floppy-amee-0.3.1 examples/list_profiles.rb