Sha256: d693034925837ef5cd8dcc7819f538e5f6d9334d17fd8ef72222a554b5151e36

Contents?: true

Size: 860 Bytes

Versions: 22

Compression:

Stored size: 860 Bytes

Contents

dir = File.dirname(__FILE__) + '/../lib'
$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)

#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])

# Create a new profile item
category = AMEE::Profile::Category.get(connection, ARGV[0])
puts "loaded category #{category.name}"
AMEE::Profile::Item.create(category, ARGV[1])
puts "created item in #{category.name} OK"

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
Floppy-amee-0.4.1 examples/create_profile_item.rb
Floppy-amee-0.4.10 examples/create_profile_item.rb
Floppy-amee-0.4.12 examples/create_profile_item.rb
Floppy-amee-0.4.13 examples/create_profile_item.rb
Floppy-amee-0.4.14 examples/create_profile_item.rb
Floppy-amee-0.4.15 examples/create_profile_item.rb
Floppy-amee-0.4.16 examples/create_profile_item.rb
Floppy-amee-0.4.17 examples/create_profile_item.rb
Floppy-amee-0.4.18 examples/create_profile_item.rb
Floppy-amee-0.4.19 examples/create_profile_item.rb
Floppy-amee-0.4.2 examples/create_profile_item.rb
Floppy-amee-0.4.20 examples/create_profile_item.rb
Floppy-amee-0.4.21 examples/create_profile_item.rb
Floppy-amee-0.4.22 examples/create_profile_item.rb
Floppy-amee-0.4.23 examples/create_profile_item.rb
Floppy-amee-0.4.24 examples/create_profile_item.rb
Floppy-amee-0.4.25 examples/create_profile_item.rb
Floppy-amee-0.4.3 examples/create_profile_item.rb
Floppy-amee-0.4.4 examples/create_profile_item.rb
Floppy-amee-0.4.5 examples/create_profile_item.rb