Sha256: 91383dcdbc54acfd2b9e55858e42d37b52d825f578602dbe9bfbd7b230e222ed

Contents?: true

Size: 1.11 KB

Versions: 19

Compression:

Stored size: 1.11 KB

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

# For each path in arg list, show details
ARGV.each do |path|
  cat = AMEE::Data::Category.get(connection, path)
  puts "---------------------"
  puts "Category: #{cat.name}"
  puts "Path: #{cat.full_path}"
  puts "UID: #{cat.uid}"
  puts "Subcategories:"
  cat.children.each do |c|
    puts "  - #{c[:path]} (#{c[:name]})"
  end
  puts "Items:"
  cat.items.each do |i|
    puts "  - #{i[:path]} (#{i[:label]})"
  end
  
end


Version data entries

19 entries across 19 versions & 1 rubygems

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