Sha256: dfa45267833611979d8aec1feb01124cf893d7df7683a231d6fde0e839093713

Contents?: true

Size: 1.06 KB

Versions: 27

Compression:

Stored size: 1.06 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolpartycl"
o = PoolParty::Optioner.new(ARGV) do |opts, optioner|
  opts.on('-f [remote|local]', '--from [remote|local]', 'Remote or local (default: local)')    { |o| optioner.location o }
  opts.on('-r', '--remote', 'Remote listing')    { optioner.location "remote" }
  opts.on('-l', '--local', 'Local listing')    { optioner.location "local" }
  opts.on('-n name', '--name name', 'Listing for pool name')    { |p| optioner.poolname p }
end
load_pool(o.spec || Binary.get_existing_spec_location)

@location = o.location ? o.location : "remote"

include Remote

@pools = o.poolname ? [pool(o.poolname.downcase.to_sym)] : pools

@pools.each do |name, pool|
  with_pool(pool, {:location => @location}) do
    puts header("Listing pool #{name}")
    clouds.each do |name, cloud|
      puts subheader("Cloud: #{name}")
      out = location == "remote" ? cloud.list_from_remote({:cache => true}).map{|a| a.to_s} : cloud.list_from_local.map{|a| a.to_s}
      puts out
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
auser-poolparty-0.2.15 bin/pool-list
auser-poolparty-0.2.16 bin/pool-list
auser-poolparty-0.2.2 bin/pool-list
auser-poolparty-0.2.20 bin/pool-list
auser-poolparty-0.2.21 bin/pool-list
auser-poolparty-0.2.22 bin/pool-list
auser-poolparty-0.2.23 bin/pool-list
auser-poolparty-0.2.24 bin/pool-list
auser-poolparty-0.2.25 bin/pool-list
auser-poolparty-0.2.26 bin/pool-list
auser-poolparty-0.2.3 bin/pool-list
auser-poolparty-0.2.35 bin/pool-list
auser-poolparty-0.2.36 bin/pool-list
auser-poolparty-0.2.37 bin/pool-list
auser-poolparty-0.2.38 bin/pool-list
auser-poolparty-0.2.39 bin/pool-list
auser-poolparty-0.2.4 bin/pool-list
auser-poolparty-0.2.40 bin/pool-list
auser-poolparty-0.2.41 bin/pool-list
auser-poolparty-0.2.42 bin/pool-list