Sha256: 8a354e823aa81326b29337d2ac9804598e65be9bd9cbd63975c6471089b1be03

Contents?: true

Size: 920 Bytes

Versions: 19

Compression:

Stored size: 920 Bytes

Contents

# Copyright (C) 2008-2011 AMEE UK Ltd. - http://www.amee.com
# Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details.

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::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

19 entries across 19 versions & 1 rubygems

Version Path
amee-4.4.0 examples/list_profiles.rb
amee-4.3.2 examples/list_profiles.rb
amee-4.3.1 examples/list_profiles.rb
amee-4.3.0 examples/list_profiles.rb
amee-4.2.0 examples/list_profiles.rb
amee-3.2.1 examples/list_profiles.rb
amee-3.2.0 examples/list_profiles.rb
amee-4.1.7 examples/list_profiles.rb
amee-4.1.6 examples/list_profiles.rb
amee-4.1.5 examples/list_profiles.rb
amee-4.1.4 examples/list_profiles.rb
amee-4.1.3 examples/list_profiles.rb
amee-3.1.2 examples/list_profiles.rb
amee-3.1.1 examples/list_profiles.rb
amee-4.1.2 examples/list_profiles.rb
amee-4.1.1 examples/list_profiles.rb
amee-4.1.0 examples/list_profiles.rb
amee-4.0.0 examples/list_profiles.rb
amee-3.0.1 examples/list_profiles.rb